2013年4月7日

Linux Debian 安裝 NVIDIA 驅動 風扇控速 簡易顯示卡效能測試

請在終端機(terminal/console)鍵入底下指令

# lspci  觀看硬體配備

找到VGA查看你的顯示卡型號,如果沒有正確顯示卡型號如下:

01:00.0 VGA compatible controller: nVidia Corporation Device 1200 (rev a1)

則進行硬體資訊更新


# update-pciids

再執行一次

# lspci   可以看到有正確的顯示卡型號

01:00.0 VGA compatible controller: NVIDIA Corporation GF114 [GeForce GTX 560 Ti] (rev a1)

請到NVIDIA驅動程式下載頁面下載符合你顯卡型號的驅動程式

這邊採用「手動搜尋驅動程式」


由上面的硬體資訊[GeForce GTX 560 Ti]得知我們選為GeForce、GeForce 500 Series

補充:只要顯卡型號數字為5開頭的就為500 Series,6開頭的就為600 Series,其餘以此類推

            而如果是xxxM的通常為NOTEBOOK的顯示卡

再來就要看你的作業系統版本

$ uname -m

如果為i386、i586、i686為32位元
如果為X86_64為64位元

或者最直接的看法

$ getconf LONG_BIT
32

要看distribution則執行
$ lsb_release -a

No LSB modules are available.                             
Distributor ID: Debian                                          
Description:    Debian GNU/Linux 6.0.7 (squeeze)
Release:        6.0.7                                               
Codename:       squeeze                                       


選後按尋找即進入下載頁面

另外要是真的怕下載錯顯卡驅動,他下面有產品支持列表可以自行查看你的顯卡

產品支持列表

GeForce 500 Series

GeForce GTX 590, GeForce GTX 580, GeForce GTX 570, GeForce GTX 560 Ti, GeForce GTX 560 SE, GeForce GTX 560, GeForce GTX 555, GeForce GTX 550 Ti, GeForce GT 545, GeForce GT 530, GeForce GT 520, GeForce 510

下載完後~到下載目錄處執行

$ ls N*
NVIDIA-Linux-x86-310.44.run    確定下載成功

開始安裝流程


# apt-get install build-essential linux-headers-$(uname -r)

build-essential:為建構或編譯Debian套件包說需要的套件,此通常為編譯套件時必要安裝的

詳細資訊參考http://packages.ubuntu.com/lucid/build-essential

linux-headers:此套件包含建構Linux 核心模組所需的標頭檔與腳本
詳細資訊參考:http://unix.stackexchange.com/questions/63228/what-package-could-linux-headers-3-7-5-1-arch-mean
http://packages.ubuntu.com/zh-tw/hardy/linux-headers-2.6.24-16-386


此時必須登出圖形話介面(run level 5)

注意如果你有安裝gdm登入畫面程式如圖

先登出你的視窗管理xorg

後再按Ctrl+Alt+F2切換終端機

login: root
Password: XXXX

如果沒出現Password是亂碼,則登入後執行

# export LC_ALL=C


再執行
# /etc/init.d/gdm3 stop   登入畫面程式終止

執行驅動程式安裝

# sh NVIDIA-Linux-x86-310.44.run

(安裝過程中,若不確定的盡量選擇yes)

假設一切非常順利,安裝完成後,則重新啟動

# /sbin/shutdown -r now

檢查顯示卡驅動安裝成功與否
$ dmesg

有看到此行

[    2.888174] NVRM: loading NVIDIA UNIX x86 Kernel Module  310.44  Wed Mar 27 15:00:00 PDT 2013

------------------------------------------------------------------錯誤訊息除錯-------------------------------------------------------------

1. 未安裝binutils套件:

ERROR: Unable to find the system utility 'ld'; please make sure you have the package 'binutils' installed. If you do have binutils installed, then please check that 'ld' is in your PATH.

請安裝
# apt-get install binutils

----------------------------------------------------------------------------------------------------------------------------------------------

2. nouveau顯卡驅動模組載入中

ERROR: The Nouveau kernel driver is currently in use by your system. This driver is incompatible with the NVIDIA driver, and must be disabled before proceeding. Please consult the NVIDIA driver README and your Linux distribution's documentation for details on how to correctly disable the Nouveau kernel driver.

需先卸載noveau模組,,因其與NVIDIA 驅動不相容

blacklist 可以拒絕隨插即用的裝置模組,因此就能夠避免這個模組在下次開機後被啟用

進入blacklist.conf檔案內
# vi /etc/modprobe.d/blacklist.conf
加入下列內容
# Disable nouveau
blacklist nouveau

存檔關閉後請重開機,nouveau模組將不被啟動

----------------------------------------------------------------------------------------------------------------------------------------------

3. 尚未安裝gcc套件或cc執行檔案

ERROR: Unable to find the development tool `cc` in your path; please make sure that you have the package
'gcc' installed. If gcc is installed on your system, then please check that `cc` is in your PATH.


請安裝
# apt-get install kernel-package

安裝內容包含gcc、cc等

----------------------------------------------------------------------------------------------------------------------------------------------

ERROR: Unable to find the kernel source tree for the currently running kernel. Please make sure you have installed the kernel source files for your kernel and that they are properly configured; on Red Hat Linux systems, for example, be sure you have the 'kernel-source' or 'kernel-devel' RPM installed. If you know the correct kernel source files are installed, you may specify the kernel source path with the '--kernel-source-path' command line option.

如果你是直接安裝新的核心,會沒有該核心的source
請自行編譯核心,再執行一次

沒安裝過新的核心(通常為2.6.32.XXXX)執行
# apt-get install linux-headers-(uname -r)

----------------------------------------------------------------------------------------------------------------------------------------------

# apt-get --purge remove xserver-xorg-video-nouveau nvidia-kernel-common nvidia-kernel-dkms nvidia-glx nvidia-smi


----------------------------------------------------------------------------------------------------------------------------------------------

風扇控速

請先確認你的顯示卡是否支援風扇控速

開啟一個terminal輸入

$ nvidia-settings   出現如下圖,請選擇請選擇Thermal Setting



如果裡面沒有Enable GPU Fan Setting則執行

# vi /etc/X11/xorg.conf

找到此區塊增加Option "Coolbits" "5"


Section "Device"
            Identifier "Device0"
            Driver "nvidia"
            VendorName "NVIDIA Corporation"
            BoardName "GeForce GTX 560 Ti"
            Option "Coolbits" "5"   =>增加此行
EndSection

esc => shift+ :  => wq   存檔關閉

若裡面內容如下
Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
EndSection

則執行
# X -configure
# mv /root/xorg.config.new /etc/X11/xorg.conf

若為下面內容

Section "Device"
        Identifier  "Card0"
        Driver      "nvidia"
        VendorName  "nVidia Corporation"
        BoardName   "Unknown Board"
        BusID       "PCI:1:0:0"
EndSection


則進行硬體資訊更新

# update-pciids


再執行一次# X -configure  # mv /root/xorg.config.new /etc/X11/xorg.conf


最後輸入完Option "Coolbits" "5"即可執行

$ nvidia-setting

即可設定風扇轉速

----------------------------------------------------------------------------------------------------------------------------------------------

簡易顯示卡效能測試

# apt-get install mesa-utils -y

安裝完成後執行

glxgears



出現三個齒輪再轉的動畫,而終端機會顯示每xx秒跑多少fps,所以顯示卡效能越好,每xx秒跑多少fps就越高

$ glxgears -fullscreen 全螢幕測試,可以發現fps會降低

如果跑起來,fps固定在60左右

Running synchronized to the vertical refresh. The framerate should be
approximately the same as the monitor refresh rate.
303 frames in 5.0 seconds = 60.418 FPS
300 frames in 5.0 seconds = 60.000 FPS
300 frames in 5.0 seconds = 60.000 FPS
300 frames in 5.0 seconds = 60.000 FPS
300 frames in 5.0 seconds = 60.000 FPS
300 frames in 5.0 seconds = 60.000 FPS
300 frames in 5.0 seconds = 59.999 FPS
300 frames in 5.0 seconds = 59.990 FPS
301 frames in 5.0 seconds = 60.004 FPS

請執行

$ export __GL_SYNC_TO_VBLANK=0vsync關閉 看解說請點

$ glxgears

129299 frames in 5.0 seconds = 25859.732 FPS
129480 frames in 5.0 seconds = 25895.922 FPS
129299 frames in 5.0 seconds = 25859.625 FPS
128901 frames in 5.0 seconds = 25780.102 FPS
129118 frames in 5.0 seconds = 25823.538 FPS
129383 frames in 5.0 seconds = 25876.466 FPS
129436 frames in 5.0 seconds = 25887.014 FPS
129278 frames in 5.0 seconds = 25855.568 FPS

沒有留言:

張貼留言

文章有誤或有問題麻煩您留言告知! 謝謝您~~