在 16.04 上切換 nvdia 驅動程式版本

在 16.04 上切換 nvdia 驅動程式版本

我目前在 Ubuntu 16.04 上運行專有的 nvidia 驅動程式 361.42

$ dmesg | grep -i nvid
[    4.233238] NVRM: loading NVIDIA UNIX x86_64 Kernel Module  361.42  Tue Mar 22 18:10:58 PDT 2016

該卡本身是 GTX-960

01:00.0 VGA compatible controller: NVIDIA Corporation GM206 [GeForce GTX 960] (rev a1) (prog-if 00 [VGA controller])
    Subsystem: Gigabyte Technology Co., Ltd GM206 [GeForce GTX 960]
    Flags: bus master, fast devsel, latency 0, IRQ 127
    Memory at de000000 (32-bit, non-prefetchable) [size=16M]
    Memory at c0000000 (64-bit, prefetchable) [size=256M]
    Memory at d0000000 (64-bit, prefetchable) [size=32M]
    I/O ports at e000 [size=128]
    [virtual] Expansion ROM at df000000 [disabled] [size=512K]
    Capabilities: <access denied>
    Kernel driver in use: nvidia
    Kernel modules: nvidiafb, nouveau, nvidia_361

不幸的是,我正在使用的一個軟體聲稱驅動程式中存在錯誤導致其軟體崩潰,並且我被要求將驅動程式降級到 352.79。

然而,它不只是想要 apt-get 安裝這個版本:

damien@damien-desktop:~$ sudo apt-get install nvidia-352
[sudo] password for damien: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
nvidia-352 is already the newest version (361.42-0ubuntu2).
0 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade.
damien@damien-desktop:~$ sudo apt-get install nvidia-352-updates
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  nvidia-352-updates
0 to upgrade, 1 to newly install, 0 to remove and 0 not to upgrade.
Need to get 4,814 B of archives.
After this operation, 17.4 kB of additional disk space will be used.
Get:1 http://au.archive.ubuntu.com/ubuntu xenial/restricted amd64 nvidia-352-updates amd64 361.42-0ubuntu2 [4,814 B]
Fetched 4,814 B in 0s (12.4 kB/s)             
Selecting previously unselected package nvidia-352-updates.
(Reading database ... 439776 files and directories currently installed.)
Preparing to unpack .../nvidia-352-updates_361.42-0ubuntu2_amd64.deb ...
Unpacking nvidia-352-updates (361.42-0ubuntu2) ...
Setting up nvidia-352-updates (361.42-0ubuntu2) ...

清除並重新安裝似乎會自動選擇版本361,這是我想避免的:

damien@damien-desktop:~$ sudo apt-get install nvidia-352
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  nvidia-361 nvidia-opencl-icd-361 nvidia-prime nvidia-settings
The following NEW packages will be installed:
  nvidia-352 nvidia-361 nvidia-opencl-icd-361 nvidia-prime nvidia-settings
0 to upgrade, 5 to newly install, 0 to remove and 0 not to upgrade.
Need to get 866 kB/77.5 MB of archives.
After this operation, 339 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://au.archive.ubuntu.com/ubuntu xenial/main amd64 nvidia-prime amd64 0.8.2 [11.1 kB]
Get:2 http://au.archive.ubuntu.com/ubuntu xenial/main amd64 nvidia-settings amd64 361.42-0ubuntu1 [855 kB]
Fetched 866 kB in 2s (324 kB/s)          
Selecting previously unselected package nvidia-361.
(Reading database ... 439200 files and directories currently installed.)
Preparing to unpack .../nvidia-361_361.42-0ubuntu2_amd64.deb ...
Unpacking nvidia-361 (361.42-0ubuntu2) ...
Selecting previously unselected package nvidia-352.
Preparing to unpack .../nvidia-352_361.42-0ubuntu2_amd64.deb ...
Unpacking nvidia-352 (361.42-0ubuntu2) ...
Selecting previously unselected package nvidia-opencl-icd-361.
Preparing to unpack .../nvidia-opencl-icd-361_361.42-0ubuntu2_amd64.deb ...
Unpacking nvidia-opencl-icd-361 (361.42-0ubuntu2) ...
Selecting previously unselected package nvidia-prime.
Preparing to unpack .../nvidia-prime_0.8.2_amd64.deb ...
Unpacking nvidia-prime (0.8.2) ...
Selecting previously unselected package nvidia-settings.
Preparing to unpack .../nvidia-settings_361.42-0ubuntu1_amd64.deb ...
Unpacking nvidia-settings (361.42-0ubuntu1) ...
Processing triggers for libc-bin (2.23-0ubuntu3) ...
Processing triggers for ureadahead (0.100.0-19) ...
ureadahead will be reprofiled on next reboot
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for gnome-menus (3.13.3-6ubuntu3) ...
Processing triggers for desktop-file-utils (0.22-1ubuntu5) ...
Processing triggers for bamfdaemon (0.5.3~bzr0+16.04.20160415-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for mime-support (3.59ubuntu1) ...
Setting up nvidia-361 (361.42-0ubuntu2) ...
update-alternatives: using /usr/lib/nvidia-361/ld.so.conf to provide /etc/ld.so.conf.d/x86_64-linux-gnu_GL.conf (x86_64-linux-gnu_gl_conf) in auto mode
update-alternatives: using /usr/lib/nvidia-361/ld.so.conf to provide /etc/ld.so.conf.d/x86_64-linux-gnu_EGL.conf (x86_64-linux-gnu_egl_conf) in auto mode
update-alternatives: using /usr/lib/nvidia-361/alt_ld.so.conf to provide /etc/ld.so.conf.d/i386-linux-gnu_GL.conf (i386-linux-gnu_gl_conf) in auto mode
update-alternatives: using /usr/lib/nvidia-361/alt_ld.so.conf to provide /etc/ld.so.conf.d/i386-linux-gnu_EGL.conf (i386-linux-gnu_egl_conf) in auto mode
update-alternatives: using /usr/share/nvidia-361/glamor.conf to provide /usr/share/X11/xorg.conf.d/glamoregl.conf (glamor_conf) in auto mode
update-initramfs: deferring update (trigger activated)
INFO:Enable nvidia-361
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/lenovo_thinkpad
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/dell_latitude
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/put_your_quirks_here
Adding system user `nvidia-persistenced' (UID 123) ...
Adding new group `nvidia-persistenced' (GID 130) ...
Adding new user `nvidia-persistenced' (UID 123) with group `nvidia-persistenced' ...
Not creating home directory `/'.
Loading new nvidia-361-361.42 DKMS files...
First Installation: checking all kernels...
Building only for 4.4.0-22-generic
Building for architecture x86_64
Building initial module for 4.4.0-22-generic
Done.

nvidia_361:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/4.4.0-22-generic/updates/dkms/

nvidia_361_modeset.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/4.4.0-22-generic/updates/dkms/

nvidia_361_uvm.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/4.4.0-22-generic/updates/dkms/

depmod....

DKMS: install completed.
Setting up nvidia-352 (361.42-0ubuntu2) ...
Setting up nvidia-opencl-icd-361 (361.42-0ubuntu2) ...
Setting up nvidia-prime (0.8.2) ...
Setting up nvidia-settings (361.42-0ubuntu1) ...
Processing triggers for libc-bin (2.23-0ubuntu3) ...
Processing triggers for initramfs-tools (0.122ubuntu8) ...
update-initramfs: Generating /boot/initrd.img-4.4.0-22-generic
Processing triggers for ureadahead (0.100.0-19) ...

如何安全降級到此版本的驅動程式?我不能簡單地刪除所有 nvidia 驅動程式並重新安裝,因為 nouveau 似乎根本不適用於我的硬體(我必須將 Ubuntu 安裝為伺服器版本,然後將其隱藏到桌面)。

答案1

在 Ubuntu 16.04 中nvidia-352只是nvidia-361.
幸運的nvidia-352是可以從專有 GPU 驅動程式 PPA 中獲得。從 PPA
下載以下相關軟體包:nvidia-352.79

libcuda1-352_352.79-0ubuntu0~gpu16.04.2_amd64.deb
nvidia-352_352.79-0ubuntu0~gpu16.04.2_amd64.deb
nvidia-libopencl1-352_352.79-0ubuntu0~gpu16.04.2_amd64.deb
nvidia-opencl-icd-352_352.79-0ubuntu0~gpu16.04.2_amd64.deb

但首先您應該檢查最新的穩定驅動程式是否nvidia-364可以解決該問題。

刪除 NVIDIA 驅動程式 361 - 開啟終端並執行:

sudo apt purge nvidia*  
sudo reboot  

選擇 Ubuntu 選單項目並E按鍵。
加到nouveau.modeset=0linux 行的末尾。
按鍵F10啟動進入作業系統。

重要提示:Space在該行的最後一個字元linux和之間設定 a nouveau.modeset=0

當登入畫面出現時,按Ctrl+ Alt+ F1
輸入您的使用者名稱和密碼,然後執行:

sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt update
sudo apt install nvidia-364
sudo reboot

如果這些驅動程式不起作用 - 打開終端並執行:

sudo apt purge nvidia*  
sudo reboot  

選擇 Ubuntu 選單項目並E按鍵。
加到nouveau.modeset=0linux 行的末尾。
按鍵F10啟動進入作業系統。

重要提示:Space在該行的最後一個字元linux和之間設定 a nouveau.modeset=0

當登入畫面出現時,按Ctrl+ Alt+ F1
輸入您的使用者名稱和密碼,然後執行:

cd /<path-to-the-folder-which-contains-the-.deb-files-you-have-downloaded-before>  

sudo dpkg -i libcuda1-352_352.79-0ubuntu0~gpu16.04.2_amd64.deb
sudo dpkg -i nvidia-352_352.79-0ubuntu0~gpu16.04.2_amd64.deb  
sudo dpkg -i nvidia-libopencl1-352_352.79-0ubuntu0~gpu16.04.2_amd64.deb  
sudo dpkg -i nvidia-opencl-icd-352_352.79-0ubuntu0~gpu16.04.2_amd64.deb  

sudo reboot  

注意:如果出現依賴性錯誤,請apt install -f在每個錯誤後執行。

相關內容