这一页https://developer.download.nvidia.cn/compute/cuda/repos/ubuntu1804/x86_64/列出很多驱动程序。
我需要安装该版本,nvidia-driver-440_440.33.01-0ubuntu1_amd64.deb
因为我的dmesg
意思是:
NVRM: API mismatch: the client has the version 440.33, but
NVRM: this kernel module has the version 440.100. Please
NVRM: make sure that this kernel module and all NVIDIA driver
NVRM: components have the same version.
我跑完之后
docker run --gpus all nvidia/cuda:10.0-base nvidia-smi
所以我需要特定的版本440.33
我尝试下载并安装:
sudo apt install -y ./nvidia-driver-440_440.33.01-0ubuntu1_amd64.deb
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'nvidia-driver-440' instead of './nvidia-driver-440_440.33.01-0ubuntu1_amd64.deb'
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-440 : Depends: libnvidia-gl-440 (= 440.33.01-0ubuntu1) but 440.100-0ubuntu0.20.04.1 is to be installed
Depends: nvidia-dkms-440 (= 440.33.01-0ubuntu1)
Depends: nvidia-kernel-source-440 (= 440.33.01-0ubuntu1) but it is not going to be installed
Depends: libnvidia-compute-440 (= 440.33.01-0ubuntu1) but 440.100-0ubuntu0.20.04.1 is to be installed
Depends: nvidia-compute-utils-440 (= 440.33.01-0ubuntu1) but it is not going to be installed
Depends: libnvidia-decode-440 (= 440.33.01-0ubuntu1) but 440.100-0ubuntu0.20.04.1 is to be installed
Depends: libnvidia-encode-440 (= 440.33.01-0ubuntu1) but 440.100-0ubuntu0.20.04.1 is to be installed
Depends: nvidia-utils-440 (= 440.33.01-0ubuntu1) but it is not going to be installed
Depends: xserver-xorg-video-nvidia-440 (= 440.33.01-0ubuntu1) but 440.100-0ubuntu0.20.04.1 is to be installed
Depends: libnvidia-cfg1-440 (= 440.33.01-0ubuntu1) but 440.100-0ubuntu0.20.04.1 is to be installed
Depends: libnvidia-ifr1-440 (= 440.33.01-0ubuntu1) but 440.100-0ubuntu0.20.04.1 is to be installed
Depends: libnvidia-fbc1-440 (= 440.33.01-0ubuntu1) but 440.100-0ubuntu0.20.04.1 is to be installed
Recommends: nvidia-settings but it is not going to be installed
Recommends: nvidia-prime (>= 0.8) but it is not going to be installed
Recommends: libnvidia-compute-440:i386 (= 440.33.01-0ubuntu1)
Recommends: libnvidia-decode-440:i386 (= 440.33.01-0ubuntu1)
Recommends: libnvidia-encode-440:i386 (= 440.33.01-0ubuntu1)
Recommends: libnvidia-ifr1-440:i386 (= 440.33.01-0ubuntu1)
Recommends: libnvidia-fbc1-440:i386 (= 440.33.01-0ubuntu1)
Recommends: libnvidia-gl-440:i386 (= 440.33.01-0ubuntu1)
E: Unable to correct problems, you have held broken packages.
答案1
看起来手动安装包将导致依赖问题,并且您最终可能会破坏依赖树。
我建议您使用官方的 nvidia ubuntu ppa。它将自动安装必要的依赖项。
sudo add-apt-repository ppa:graphics-drivers/ppa -y
sudo apt update -y
sudo apt install nvidia-driver-440 -y
如果您正在为应用程序使用 docker 镜像,您可以重新构建特定版本的 docker 镜像以与驱动程序版本保持一致。您可以在 docker 文件中添加上述命令并构建 docker 镜像。