1. 程式人生 > >先解除安裝 nvidia-387.26驅動,再安裝nvidia-384.81 驅動

先解除安裝 nvidia-387.26驅動,再安裝nvidia-384.81 驅動

1 首先第一個問題是驅動不一致。我需要的是384.81 驅動支援CUDA9.0,而已經安裝了387.26 驅動支援CUDA9.1。 需要解除安裝NVIDIA 驅動 Handle Conflicting Installation Methods

Use the following command to uninstall a Driver runfile installation:

$ sudo /usr/bin/nvidia-uninstall

2 重新安裝 NVIDIA 驅動

[email protected]:~$ sudo apt-get install nvidia-384
Reading package lists... Done
Building dependency tree       
Reading state information... Done
nvidia-384 is already the newest version (384.145-0ubuntu1).
The following packages were automatically installed and are no longer required:
  libnvidia-container-tools libnvidia-container1 linux-headers-4.4.0-116 linux-headers-4.4.0-116-generic linux-headers-4.4.0-130 linux-headers-4.4.0-130-generic
  linux-headers-4.4.0-134 linux-headers-4.4.0-134-generic linux-image-4.4.0-116-generic linux-image-4.4.0-130-generic linux-image-4.4.0-134-generic
  linux-image-extra-4.4.0-116-generic linux-image-extra-4.4.0-130-generic linux-image-extra-4.4.0-134-generic linux-tools-4.4.0-130 linux-tools-4.4.0-130-generic
  linux-tools-4.4.0-134 linux-tools-4.4.0-134-generic nvidia-container-runtime nvidia-container-runtime-hook
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up nvidia-384 (384.145-0ubuntu1) ...
update-alternatives: using /usr/lib/nvidia-384/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: warning: skip creation of /usr/share/grub-gfxpayload-lists/blacklist/10_proprietary-graphics-drivers because associated file /usr/share/nvidia-38
4/nvidia-384.grub-gfxpayload (of link group x86_64-linux-gnu_gl_conf) doesn't existupdate-alternatives: error: error creating symbolic link '/usr/lib/nvidia/alternate-install-present.dpkg-tmp': No such file or directory
dpkg: error processing package nvidia-384 (--configure):
 subprocess installed post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of libcuda1-384:
 libcuda1-384 depends on nvidia-384 (>= 384.145); however:
  Package nvidia-384 is not configured yet.

dpkg: error processing package libcuda1-384 (--configure):
 dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.23-0ubuntu10) ...
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          Errors were encountered while processing:
 nvidia-384
 libcuda1-384
E: Sub-process /usr/bin/dpkg returned an error code (1)

3 上述方法報錯。原因未知,可能是因為安裝不完全導致。用以下方法安裝 nvidia 387.26 for ubuntu 16.04 package broken

[email protected]:~$ sudo mkdir /usr/lib/nvidia
[email protected]:~$ sudo apt-get install nvidia-384
Reading package lists... Done
Building dependency tree       
Reading state information... Done
nvidia-384 is already the newest version (384.145-0ubuntu1).
The following packages were automatically installed and are no longer required:
  libnvidia-container-tools libnvidia-container1 linux-headers-4.4.0-116 linux-headers-4.4.0-116-generic linux-headers-4.4.0-130 linux-headers-4.4.0-130-generic
  linux-headers-4.4.0-134 linux-headers-4.4.0-134-generic linux-image-4.4.0-116-generic linux-image-4.4.0-130-generic linux-image-4.4.0-134-generic
  linux-image-extra-4.4.0-116-generic linux-image-extra-4.4.0-130-generic linux-image-extra-4.4.0-134-generic linux-tools-4.4.0-130 linux-tools-4.4.0-130-generic
  linux-tools-4.4.0-134 linux-tools-4.4.0-134-generic nvidia-container-runtime nvidia-container-runtime-hook
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up nvidia-384 (384.145-0ubuntu1) ...
update-alternatives: using /usr/lib/nvidia-384/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: warning: skip creation of /usr/share/grub-gfxpayload-lists/blacklist/10_proprietary-graphics-drivers because associated file /usr/share/nvidia-38
4/nvidia-384.grub-gfxpayload (of link group x86_64-linux-gnu_gl_conf) doesn't existupdate-alternatives: using /usr/lib/nvidia-384/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-384/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-384/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-384/glamor.conf to provide /usr/share/X11/xorg.conf.d/glamoregl.conf (glamor_conf) in auto mode
update-initramfs: deferring update (trigger activated)

A modprobe blacklist file has been created at /etc/modprobe.d to prevent Nouveau from loading. This can be reverted by deleting /etc/modprobe.d/nvidia-graphics-driver
s.conf.A new initrd image has also been created. To revert, please replace /boot/initrd-4.4.0-138-generic with /boot/initrd-$(uname -r)-backup.

*****************************************************************************
*** Reboot your computer and verify that the NVIDIA graphics driver can   ***
*** be loaded.                                                            ***
*****************************************************************************

Adding system user `nvidia-persistenced' (UID 113) ...
Adding new group `nvidia-persistenced' (GID 119) ...
Adding new user `nvidia-persistenced' (UID 113) with group `nvidia-persistenced' ...
Not creating home directory `/'.
Loading new nvidia-384-384.145 DKMS files...
First Installation: checking all kernels...
Building only for 4.4.0-138-generic
Building for architecture x86_64
Building initial module for 4.4.0-138-generic
Done.

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

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

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

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

depmod....

DKMS: install completed.
Setting up libcuda1-384 (384.145-0ubuntu1) ...
Processing triggers for libc-bin (2.23-0ubuntu10) ...
Processing triggers for initramfs-tools (0.122ubuntu8.11) ...
update-initramfs: Generating /boot/initrd.img-4.4.0-138-generic
W: Possible missing firmware /lib/firmware/ast_dp501_fw.bin for module ast
W: mdadm: /etc/mdadm/mdadm.conf defines no arrays.