2012年9月9日 星期日

NVIDIA Driver

為了DIABLO 3,終於買了顯卡…之前就聽說N家的顯卡對ubuntu較友善。想不到是惡夢的開始。裝了驅動程式之後,螢幕解析度抓不到。就一直是 640x480。於是放棄ubuntu…

過了4個月,才有耐心解決這個問題。

A. 安裝官方的驅動程式,以下參考手把手網站的內容
  1. 請先去Nvidia官網下載你的驅動程式
    名字太長了我改成 nvidia.run並放到~/ (家目錄)下面
  2. 要賦予nvidia.run執行權限才能安裝哦
    • chmod +x nvidia.run
  3. 移除nvidia舊版並移除舊的設定檔
    • sudo apt-get --purge remove nvidia-* 
  4. 安裝編譯所需套件與核心 (這一個步驟我有點問題…說linux-restricted-modules...找不到)
    • sudo apt-get install build-essential libc6-dev pkg-config xserver-xorg-dev linux-headers-$(uname -r) linux-restricted-modules-$(uname -r) nvidia-settings gcc gcc-3.4
  5. 請按Ctrl+Alt+F1進入文字終端機
  6. 中斷X windows才能正確安裝顯示卡驅動程式
    • sudo /etc/init.d/gdm stop
  7. 開始安裝nvidia官方版驅動程式
    • sudo sh ~/nvidia.run
      1. 接著就進入了Nvidia的授權頁,第一個選accept同意他的授權聲明 按tab鍵可移動
      2. There appears to already be a driver installed on your system (version: 173.14.12).  As part of installing this driver (version: 173.14.12), the existing driver will be uninstalled.  Are you sure you want to continue? ('no' will abort installation) (Answer: Yes)
      3. No precompiled kernel interface was found to match your kernel; would you like the installer to attempt to download a kernel interface for your kernel from the NVIDIA ftp site (ftp://download.nvidia.com)? (Answer: No)
      4. Install NVIDIA's 32-bit compatibility OpenGL libraries? (Answer: No)此項只有amd64版本才會出現
      5. Would you like to run the nvidia-xconfig utility to automatically update your X configuration file so that the NVIDIA X driver will be used when you restart X?  Any pre-existing X configuration file will be backed up(Answer: Yes)
  8. 最後回到x windows會看到一個Nvida的畫面,這樣就代表安裝好了
    • sudo /etc/init.d/gdm start
  9. 咱們來看看有沒有安裝成功
    • glxinfo | grep "OpenGL version string:"
      OpenGL version string: .....
    • lspci | grep VGA
      01:00.0 VGA ......
B. 裝完之後,仍然解析度無效…網路上說要改 /etc/X11/xorg.conf
我試了n偏,仍然無效,最後在外國的討論區才發現重要的步驟

these options were critical
Option "ExactModeTimingsDVI" "TRUE"
Option "ModeValidation" "NoEdidModes"

貼上我的 xorg.conf
Section "Monitor"
    Identifier     "Monitor0"
    Vendorname "Generic LCD Display"
    Modelname "LCD Panel 1920x1080"
    Horizsync 31.0-83.0
    Vertrefresh 56.0 - 76.0
    Option         "DPMS"
    Option "ExactModeTimingsDVI" "TRUE"
    Modeline "1920x1080_60.00"  172.80  1920 2040 2248 2576  1080 1081 1084 1118  -HSync +Vsync
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    Option "ModeValidation" "NoEdidModes"
EndSection
經過我的試驗,如果少了藍字,解析度依然無效。多了橘字…畫面字會糊掉

我不知道為什麼…這次的經驗,讓我對ubuntu的喜愛程度大打折扣