I set up the following pinning rule:
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
When I inspect the pinned packages, I receive the following output:
/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
so pinning the libcundnn8-dev package was successfully pinned by the configuration file above, but libcundd8 wasn't pinned successfully.
This is also confirmed by the following output:
/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
What did I do wrong?
edit: fixed typo in the pin file that I made when copying the file into this question. edit: also tried giving the libcudnn8 package the same priority as the other packages (9999).