我设置了以下固定规则:
Package: cuda
PIN: version 12.1.0-1
Pin-Priority: 9999
Package: libcudnn8
PIN: version 8.5.0.96-1+cuda11.7
Pin-Priority: 99999
Package: libcudnn8-dev
PIN: version 8.5.0.96-1+cuda11.7
Pin-Priority: 9999
当我检查固定的包时,我收到以下输出:
/etc/apt/preferences.d$ apt-cache policy
Package files:
...
Pinned packages:
xserver-xorg-video-nouveau -> 1:1.0.17-2build1 with priority 9999
libnvidia-common-525 -> 525.105.17-0ubuntu0.22.04.1 with priority 9999
libnvidia-fbc1-525 -> 525.105.17-0ubuntu0.22.04.1 with priority 9999
libnvidia-gl-525 -> 525.105.17-0ubuntu0.22.04.1 with priority 9999
libnvidia-extra-525 -> 525.105.17-0ubuntu0.22.04.1 with priority 9999
nvidia-compute-utils-525 -> 525.105.17-0ubuntu0.22.04.1 with priority 9999
nvidia-container-runtime -> 3.12.0-1 with priority 9999
libnvidia-encode-525 -> 525.105.17-0ubuntu0.22.04.1 with priority 9999
nsight-compute -> 2021.3.1.4~11.5.1-1ubuntu1 with priority -1
nvidia-utils-525 -> 525.105.17-0ubuntu0.22.04.1 with priority 9999
ubuntu-drivers-common -> 1:0.9.6.1 with priority 9999
xserver-xorg-video-nvidia-525 -> 525.105.17-0ubuntu0.22.04.1 with priority 9999
libvdpau1 -> 1.4-3build2 with priority 9999
libnvidia-decode-525 -> 525.105.17-0ubuntu0.22.04.1 with priority 9999
libnvidia-egl-wayland1 -> 1:1.1.9-1.1 with priority 9999
docker-ce -> 5:20.10.23~3-0~ubuntu-jammy with priority 9999
nvidia-kernel-common-525 -> 525.105.17-0ubuntu0.22.04.1 with priority 9999
vdpau-driver-all -> 1.4-3build2 with priority 9999
telegraf -> 1.25.2-1 with priority 9999
libnvidia-cfg1-525 -> 525.105.17-0ubuntu0.22.04.1 with priority 9999
nvidia-kernel-source-525 -> 525.105.17-0ubuntu0.22.04.1 with priority 9999
libnvidia-compute-525 -> 525.105.17-0ubuntu0.22.04.1 with priority 9999
nsight-systems -> 2021.3.3.2~11.5.1-1ubuntu1 with priority -1
libcudnn8-dev -> 8.5.0.96-1+cuda11.7 with priority 9999
因此,上面的配置文件已成功固定 libcundnn8-dev 包,但 libcundd8 未成功固定。
以下输出也证实了这一点:
/etc/apt/preferences.d$ apt-cache policy libcudnn8
libcudnn8:
Installed: 8.5.0.96-1+cuda11.7
Candidate: 8.9.0.131-1+cuda12.1
Version table:
8.9.0.131-1+cuda12.1 600
600 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64 Packages
8.9.0.131-1+cuda11.8 600
600 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64 Packages
8.8.1.3-1+cuda12.0 600
600 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64 Packages
8.8.1.3-1+cuda11.8 600
600 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64 Packages
8.8.0.121-1+cuda12.0 600
600 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64 Packages
8.8.0.121-1+cuda11.8 600
600 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64 Packages
8.7.0.84-1+cuda11.8 600
600 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64 Packages
8.6.0.163-1+cuda11.8 600
600 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64 Packages
*** 8.5.0.96-1+cuda11.7 600
600 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64 Packages
100 /var/lib/dpkg/status
我做错了什么?
编辑:修复了我将文件复制到此问题时所犯的 pin 文件中的拼写错误。 编辑:还尝试给予 libcudnn8 包与其他包相同的优先级(9999)。
答案1
原来是之前安装的 CUDA 残留了配置文件。通过删除它
/etc/apt/sources.list.d$ sudo rm cuda-ubuntu2204-12-1-local.list
有帮助,现在问题的命令输出:
julius@dataspree-MVP-5100:/etc/apt/sources.list.d$ sudo apt-cache policy libcudnn8
libcudnn8:
Installed: 8.5.0.96-1+cuda11.7
Candidate: 8.5.0.96-1+cuda11.7
Version table:
8.9.0.131-1+cuda12.1 600
600 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64 Packages
8.9.0.131-1+cuda11.8 600
600 https://developer.download.nvidia.com/compute/cuda/repos
[ ... ]
/ubuntu2204/x86_64 Packages
*** 8.5.0.96-1+cuda11.7 9999
600 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64 Packages
100 /var/lib/dpkg/status
sudo apt-cache policy
# ...
Pinned packages:
xserver-xorg-video-nouveau -> 1:1.0.17-2build1 with priority 9999
libnvidia-common-525 -> 525.105.17-0ubuntu0.22.04.1 with priority 9999
libnvidia-fbc1-525 -> 525.105.17-0ubuntu0.22.04.1 with priority 9999
libnvidia-gl-525 -> 525.105.17-0ubuntu0.22.04.1 with priority 9999
libnvidia-extra-525 -> 525.105.17-0ubuntu0.22.04.1 with priority 9999
nvidia-compute-utils-525 -> 525.105.17-0ubuntu0.22.04.1 with priority 9999
nvidia-container-runtime -> 3.12.0-1 with priority 9999
libnvidia-encode-525 -> 525.105.17-0ubuntu0.22.04.1 with priority 9999
nsight-compute -> 2021.3.1.4~11.5.1-1ubuntu1 with priority -1
nvidia-utils-525 -> 525.105.17-0ubuntu0.22.04.1 with priority 9999
ubuntu-drivers-common -> 1:0.9.6.1 with priority 9999
xserver-xorg-video-nvidia-525 -> 525.105.17-0ubuntu0.22.04.1 with priority 9999
libvdpau1 -> 1.4-3build2 with priority 9999
libnvidia-decode-525 -> 525.105.17-0ubuntu0.22.04.1 with priority 9999
libnvidia-egl-wayland1 -> 1:1.1.9-1.1 with priority 9999
docker-ce -> 5:20.10.23~3-0~ubuntu-jammy with priority 9999
nvidia-kernel-common-525 -> 525.105.17-0ubuntu0.22.04.1 with priority 9999
vdpau-driver-all -> 1.4-3build2 with priority 9999
telegraf -> 1.25.2-1 with priority 9999
libnvidia-cfg1-525 -> 525.105.17-0ubuntu0.22.04.1 with priority 9999
cuda -> 12.1.0-1 with priority 9999
nvidia-kernel-source-525 -> 525.105.17-0ubuntu0.22.04.1 with priority 9999
libnvidia-compute-525 -> 525.105.17-0ubuntu0.22.04.1 with priority 9999
nsight-systems -> 2021.3.3.2~11.5.1-1ubuntu1 with priority -1
libcudnn8 -> 8.5.0.96-1+cuda11.7 with priority 9999
libcudnn8-dev -> 8.5.0.96-1+cuda11.7 with priority 9999
and the package is no longer listed when performing an `apt update`.