我刚刚安装了 Ubuntu18.04,并尝试安装新的 nvidia 驱动程序来安装 cuda,但无法摆脱此错误。堆栈跟踪:
sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
libnvidia-compute-390:i386
The following NEW packages will be installed:
libnvidia-compute-390:i386
0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
582 not fully installed or removed.
Need to get 0 B/21.0 MB of archives.
After this operation, 84.3 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 236531 files and directories currently installed.)
Preparing to unpack .../libnvidia-compute-390_390.77-0ubuntu0~gpu18.04.1_i386.deb ...
Unpacking libnvidia-compute-390:i386 (390.77-0ubuntu0~gpu18.04.1) ...
dpkg: error processing archive /var/cache/apt/archives/libnvidia-compute-390_390.77-0ubuntu0~gpu18.04.1_i386.deb (--unpack):
trying to overwrite shared '/etc/OpenCL/vendors/nvidia.icd', which is different from other instances of package libnvidia-compute-390:i386
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/libnvidia-compute-390_390.77-0ubuntu0~gpu18.04.1_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
在尝试@jordan 的答案时我收到以下错误:
lambda-stack-cuda : Depends: nvidia-cuda-toolkit but it is not going to be installed
Recommends: nvidia-driver-390 but it is not going to be installed
libcudnn-dev : Depends: nvidia-cuda-dev but it is not going to be installed
libnvidia-decode-390:i386 : Depends: libnvidia-compute-390:i386 (= 390.77-0ubuntu0~gpu18.04.1) but it is not going to be installed
python-pycuda : Depends: nvidia-cuda-toolkit but it is not going to be installed
python3-pycuda : Depends: nvidia-cuda-toolkit but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
答案1
我刚刚自己经历了这一切,我可以通过以下方式修复它:
sudo apt-get purge nvidia-*
sudo ubuntu-drivers autoinstall
reboot
答案2
禁用安全启动并安装 bumblebee 是使系统正常运行所需的操作。有关更多详细信息,请参阅这。