无法在 Ubuntu 18.04 上安装 Nvidia 驱动程序 v396

无法在 Ubuntu 18.04 上安装 Nvidia 驱动程序 v396

我正在尝试使用此工具在 Ubuntu 18.04 上安装 396 版 Nvidia 驱动程序关联。我收到一条关于未满足依赖项的消息(见下文)。实际上,使用ubuntu-drivers devices推荐版本 415 时。我尝试过,但得到了相同的结果。链接中提到的优秀帖子没有提到这个问题。有人知道这个问题的原因吗(为什么 apt 不安装这些依赖项)以及我该如何解决这个问题?

我有双 1080Ti 设置,驱动程序版本为 390。对于 Cuda 9.2,我至少需要版本 396。

Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 nvidia-driver-396 : Depends: libnvidia-gl-396 (= 396.54-0ubuntu0~gpu18.04.1) but it is not going to be installed
                     Depends: nvidia-dkms-396 (= 396.54-0ubuntu0~gpu18.04.1) but it is not going to be installed
                     Depends: libnvidia-compute-396 (= 396.54-0ubuntu0~gpu18.04.1) but it is not going to be installed
                     Depends: nvidia-compute-utils-396 (= 396.54-0ubuntu0~gpu18.04.1) but it is not going to be installed
                     Depends: libnvidia-decode-396 (= 396.54-0ubuntu0~gpu18.04.1) but it is not going to be installed
                     Depends: libnvidia-encode-396 (= 396.54-0ubuntu0~gpu18.04.1) but it is not going to be installed
                     Depends: nvidia-utils-396 (= 396.54-0ubuntu0~gpu18.04.1) but it is not going to be installed
                     Depends: libnvidia-ifr1-396 (= 396.54-0ubuntu0~gpu18.04.1) but it is not going to be installed
                     Recommends: libnvidia-compute-396:i386 (= 396.54-0ubuntu0~gpu18.04.1)
                     Recommends: libnvidia-decode-396:i386 (= 396.54-0ubuntu0~gpu18.04.1)
                     Recommends: libnvidia-encode-396:i386 (= 396.54-0ubuntu0~gpu18.04.1)
                     Recommends: libnvidia-ifr1-396:i386 (= 396.54-0ubuntu0~gpu18.04.1)
                     Recommends: libnvidia-gl-396:i386 (= 396.54-0ubuntu0~gpu18.04.1)
E: Unable to correct problems, you have held broken packages.

答案1

我尝试按照评论中的建议安装未满足的依赖项。我从 开始libnvidia-gl-396。这导致了有关未满足依赖项和损坏的包的相同错误消息。我尝试用

sudo apt-get install --fix-broken

但那没用。我重新启动并再次运行软件和更新。令我惊讶的是,它列出了从 390 开始的所有可用版本:390、396、410 和 415,而最初只列出了 390。尝试安装其中任何一个,但没有成功。没有收到有关原因的消息。

据我所知,之前有以下版本可用:

$ ubuntu-drivers devices
== /sys/devices/pci0000:00/0000:00:03.1/0000:08:00.0 ==
modalias : pci:v000010DEd00001B06sv00001458sd0000374Cbc03sc00i00
vendor   : NVIDIA Corporation
model    : GP102 [GeForce GTX 1080 Ti]
driver   : nvidia-driver-415 - third-party free recommended
driver   : nvidia-driver-396 - third-party free
driver   : nvidia-driver-390 - third-party free
driver   : nvidia-driver-410 - third-party free
driver   : xserver-xorg-video-nouveau - distro free builtin

目前版本 396 还可以,但是 Cuda 10 已经需要驱动程序版本 410,所以我可以接受这个建议。本文建议删除旧驱动程序并安装新驱动程序,如下所示:

sudo apt-get remove --purge nvidia-*
sudo ubuntu-drivers autoinstall

并且成功了。我现在可以运行 Tensorflow 1.12,它不会再抱怨驱动程序版本错误。

相关内容