Debian Linux Stretch 當 Desktop 使用,但是看 YouTube 卻會有點卡卡的,應該是 VGA(顯示卡)驅動程式問題,於是來安裝驅動。
先查看顯示卡型號
- $ lspci | grep -i vga
01:00.0 VGA compatible controller: NVIDIA Corporation G96 [GeForce 9400 GT] (rev a1)
於是此篇文章就來安裝 GeForce 9400 GT 的 Driver。
- 註:NVIDIA 不能亂裝,驅動程式有問題的話,反而 Xwindow 都會無法進入
Debian Linux 安裝 NVIDIA GeForce 9400 GT 驅動程式
顯示卡是 NVIDIA GeForce 9400 GT,由此篇 Nvidia Graphics Drivers - Debian Wiki 看到下述:
- Version 375.66 (supported devices)
- For Kepler/Maxwell/newer GPUs.
- Version 340.102 (legacy GPUs) (supported devices)
- For GeForce 8xxx through 7xx GPUs.
- Version 304.135 (legacy GPUs) (supported devices)
- For GeForce 6xxx and 7xxx GPUs.
上述都沒有 GeForce 9xxx,所以還是讓他自己偵測比較保險
NVIDIA 顯示卡偵測 步驟
- $ sudo apt install nvidia-detect
- $ nvidia-detect
Detected NVIDIA GPUs:
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation G96 [GeForce 9400 GT] [10de:0641] (rev a1)
Checking card: NVIDIA Corporation G96 [GeForce 9400 GT] (rev a1)
Your card is only supported up to the 340 legacy drivers series.
It is recommended to install the
nvidia-legacy-340xx-driver
package.
上述提到是使用 nvidia-legacy-340xx-driver 的驅動,於 Nvidia Graphics Drivers - Debian Wiki 提到的頁面可以有步驟參考:
安裝 nvidia-legacy-340xx-driver 步驟
- vim /etc/apt/sources.list # 將 stretch main 後面都加上 contrib non-free 如下:
deb http://ftp.tw.debian.org/debian/ stretch main non-free contrib
deb-src http://ftp.tw.debian.org/debian/ stretch main non-free contrib
deb http://security.debian.org/ stretch/updates main non-free contrib
deb-src http://security.debian.org/ stretch/updates main non-free contrib
deb http://ftp.tw.debian.org/debian stretch-backports main - sudo apt install nvidia-legacy-340xx-driver # 或者 sudo apt install linux-headers-$(uname -r|sed 's/[^-]-[^-]-//') nvidia-legacy-304xx-driver
- reboot # 安裝完成後,重新開機即可
- lsmod | grep nv # 出現 nvidia 就是完成囉,這時候再測試看其他 YouTube 影片就正常了
- sudo apt install nvidia-alternative firmware-realtek # 若上述還有問題,附加再補上這些套件
NVIDIA xorg.conf config 設定 (非必要)
若是發現無法正常開機,會需要設定檔的話,可以參考下述:(註:不確定是否能使用,我上面安裝完就已經可以正常觀看 YouTube 了)
- 詳見:Nvidia Graphics Drivers Configure - Debian Wiki
- /etc/X11/xorg.conf.d/20-nvidia.conf
Section "Device"
Identifier "My GPU"
Driver "nvidia"
EndSection - # mkdir /etc/X11/xorg.conf.d
- # echo -e 'Section "Device"\n\tIdentifier "My GPU"\n\tDriver "nvidia"\nEndSection' > /etc/X11/xorg.conf.d/20-nvidia.conf
- /etc/X11/xorg.conf.d/20-nvidia.conf