我最近尝试安装 cudahttps://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1804。我选择了 Linux、x86_64、Ubuntu、18.04(事实上,我正在运行 19.10)、deb(本地)。
不幸的是,它没有完全正确安装。
现在,每次我使用诸如 sudo apt dist-upgrade 或 sudo apt install ... 或 sudo dpkg --configure -a 之类的命令时,都会出现以下一系列错误消息:
Setting up nvidia-dkms-418 (418.87.01-0ubuntu1) ...
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 the following file:
/etc/modprobe.d/nvidia-graphics-drivers.conf
A new initrd image has also been created. To revert, please regenerate your
initrd by running the following command after deleting the modprobe.d file:
`/usr/sbin/initramfs -u`
*****************************************************************************
*** Reboot your computer and verify that the NVIDIA graphics driver can ***
*** be loaded. ***
*****************************************************************************
INFO:Enable nvidia
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/lenovo_thinkpad
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/put_your_quirks_here
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/dell_latitude
Removing old nvidia-418.87.01 DKMS files...
------------------------------
Deleting module version: 418.87.01
completely from the DKMS tree.
------------------------------
Done.
Loading new nvidia-418.87.01 DKMS files...
Building for 5.3.0-19-generic
Building for architecture x86_64
Building initial module for 5.3.0-19-generic
ERROR: Cannot create report: [Errno 17] File exists: '/var/crash/nvidia-dkms-418.0.crash'
Error! Bad return status for module build on kernel: 5.3.0-19-generic (x86_64)
Consult /var/lib/dkms/nvidia/418.87.01/build/make.log for more information.
dpkg: error processing package nvidia-dkms-418 (--configure):
installed nvidia-dkms-418 package post-installation script subprocess returned error exit status 10
dpkg: dependency problems prevent configuration of nvidia-driver-418:
nvidia-driver-418 depends on nvidia-dkms-418 (= 418.87.01-0ubuntu1); however:
Package nvidia-dkms-418 is not configured yet.
dpkg: error processing package nvidia-driver-418 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of cuda-drivers:
cuda-drivers depends on nvidia-dkms-418 (>= 418.87.01); however:
Package nvidia-dkms-418 is not configured yet.
cuda-drivers depends on nvidia-driver-418 (>= 418.87.01); however:
Package nvidia-driver-418 is not configured yet.
dpkg: error processing package cuda-drivers (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of cuda-runtime-10-1:
cuda-runtime-10-1 depends on cuda-drivers (>= 418.87); however:
Package cuda-drivers is not configured yet.
dpkg: error processing package cuda-runtime-10-1 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of cuda-demo-suite-10-1:
cuda-demo-suite-10-1 depends on cuda-runtime-10-1; however:
Package cuda-runtime-10-1 is not configured yet.
dpkg: error processing package cuda-demo-suite-10-1 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of cuda-10-1:
cuda-10-1 depends on cuda-runtime-10-1 (>= 10.1.243); however:
Package cuda-runtime-10-1 is not configured yet.
cuda-10-1 depends on cuda-demo-suite-10-1 (>= 10.1.243); however:
Package cuda-demo-suite-10-1 is not configured yet.
dpkg: error processing package cuda-10-1 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of cuda:
cuda depends on cuda-10-1 (>= 10.1.243); however:
Package cuda-10-1 is not configured yet.
dpkg: error processing package cuda (--configure):
dependency problems - leaving unconfigured
Processing triggers for initramfs-tools (0.133ubuntu10) ...
update-initramfs: Generating /boot/initrd.img-5.3.0-19-generic
Errors were encountered while processing:
nvidia-dkms-418
nvidia-driver-418
cuda-drivers
cuda-runtime-10-1
cuda-demo-suite-10-1
cuda-10-1
cuda
我能如何帮助解决这个问题?
如果没有,我该如何中止此安装,以便可以再次正常安装软件包?
答案1
这可以这是因为 CUDA 10.1 不支持 Ubuntu 19.10。我能够在 Ubuntu 19.10 上安装并运行 CUDA 10.2(也是 cuDNN),但由于 TensorFlow 适用于 CUDA 10.1 和不是10.2 我必须安装 10.1,遇到同样的问题。但是,要中止此安装,您应该做的是删除 NVIDIA 驱动程序安装:
sudo apt-get remove --purge '^nvidia-.*'
然后sudo apt-get autoremove
如果需要的话。这将删除您的 NVIDIA 驱动程序,以便 apt-get 可以再次正常工作。