Version locking#

For distributions without mechanisms to clearly segregate branches inside the same repository, the normal distribution version locking mechanisms can be used. Here are some examples on how to achieve locking onto a specific driver branch.

The examples below all refer to configuring version lock for branch 580. Make sure every package that you want to lock onto a specific branch has the appropriate line / code block in the configuration files.

DNF 4#

DNF version 4 is the package manager of the following distributions:

  • Red Hat Enterprise Linux 8 / Rocky Linux 8 / Oracle Linux 8

  • Red Hat Enterprise Linux 9 / Rocky Linux 9 / Oracle Linux 9

  • Red Hat Enterprise Linux 10 / Rocky Linux 10

  • Kylin 10

  • Amazon Linux 2023

Make sure the python3-dnf-plugin-versionlock package is installed to use it. Just run the dnf versionlock command to automatically populate the file /etc/dnf/plugins/versionlock.list and lock a specific driver version in place:

# dnf4 versionlock \*nvidia\*575\*
Adding versionlock on: kmod-nvidia-open-dkms-3:575.51-1.fc41.*
Adding versionlock on: nvidia-kmod-common-3:575.51-1.fc41.*
Adding versionlock on: nvidia-driver-cuda-libs-3:575.51-1.fc41.*
Adding versionlock on: nvidia-open-3:575.51-1.fc41.*
Adding versionlock on: nvidia-xconfig-3:575.51-1.fc41.*
Adding versionlock on: xorg-x11-nvidia-3:575.51-1.fc41.*
Adding versionlock on: kmod-nvidia-latest-dkms-3:575.51-1.fc41.*
Adding versionlock on: libnvidia-cfg-3:575.51-1.fc41.*
Adding versionlock on: nvidia-driver-cuda-3:575.51-1.fc41.*
Adding versionlock on: nvidia-driver-3:575.51-1.fc41.*
Adding versionlock on: libnvidia-fbc-3:575.51-1.fc41.*
Adding versionlock on: nvidia-libXNVCtrl-devel-3:575.51-1.fc41.*
Adding versionlock on: nvidia-libXNVCtrl-3:575.51-1.fc41.*
Adding versionlock on: libnvidia-ml-3:575.51-1.fc41.*
Adding versionlock on: nvidia-modprobe-3:575.51-1.fc41.*
Adding versionlock on: nvidia-settings-3:575.51-1.fc41.*
Adding versionlock on: nvidia-driver-libs-3:575.51-1.fc41.*
Adding versionlock on: nvidia-persistenced-3:575.51-1.fc41.*

# cat /etc/dnf/plugins/versionlock.list
kmod-nvidia-open-dkms-3:575.51-1.fc41.*
nvidia-kmod-common-3:575.51-1.fc41.*
nvidia-driver-cuda-libs-3:575.51-1.fc41.*
nvidia-open-3:575.51-1.fc41.*
nvidia-xconfig-3:575.51-1.fc41.*
xorg-x11-nvidia-3:575.51-1.fc41.*
kmod-nvidia-latest-dkms-3:575.51-1.fc41.*
libnvidia-cfg-3:575.51-1.fc41.*
nvidia-driver-cuda-3:575.51-1.fc41.*
nvidia-driver-3:575.51-1.fc41.*
libnvidia-fbc-3:575.51-1.fc41.*
nvidia-libXNVCtrl-devel-3:575.51-1.fc41.*
nvidia-libXNVCtrl-3:575.51-1.fc41.*
libnvidia-ml-3:575.51-1.fc41.*
nvidia-modprobe-3:575.51-1.fc41.*
nvidia-settings-3:575.51-1.fc41.*
nvidia-driver-libs-3:575.51-1.fc41.*
nvidia-persistenced-3:575.51-1.fc41.*

An alternative is to manually edit the configuration file /etc/dnf/plugins/versionlock.list and populate it with the following content to stick the driver to a particular branch, and no longer to a specific version:

kmod-nvidia*3:575*
libnvidia*3:575*
nvidia-driver*3:575*
nvidia-kmod-common-3:575*
nvidia-libXNVCtrl*3:575*
nvidia-modprobe-3:575*
nvidia-open-3:575*
nvidia-persistenced-3:575*
nvidia-settings-3:575*
nvidia-xconfig-3:575*
xorg-x11-nvidia-3:575*

Please refer to the dnf4-versionlock(8) manual page for more information and configuration options.

DNF 5#

DNF version 5 is the package manager of the following distributions:

  • Fedora 42

Just run the dnf versionlock add command to populate the file /etc/dnf/versionlock.toml (which can then be edited or left as is) to lock a specific driver version:

# dnf versionlock add \*nvidia\*575\*
Updating and loading repositories:
Repositories loaded.
Adding versionlock on "dkms-nvidia = 3:575.51.03-1.fc41".
Adding versionlock on "libnvidia-cfg = 3:575.51.03-1.fc41".
Adding versionlock on "libnvidia-fbc = 3:575.51.03-1.fc41".
Adding versionlock on "libnvidia-gpucomp = 3:575.51.03-1.fc41".
Adding versionlock on "libnvidia-ml = 3:575.51.03-1.fc41".
Adding versionlock on "nvidia-driver = 3:575.51.03-1.fc41".
Adding versionlock on "nvidia-driver-cuda = 3:575.51.03-1.fc41".
Adding versionlock on "nvidia-driver-cuda-libs = 3:575.51.03-1.fc41".
Adding versionlock on "nvidia-driver-libs = 3:575.51.03-1.fc41".
Adding versionlock on "nvidia-kmod-common = 3:575.51.03-1.fc41".
Adding versionlock on "nvidia-libXNVCtrl = 3:575.51.03-1.fc41".
Adding versionlock on "nvidia-modprobe = 3:575.51.03-1.fc41".
Adding versionlock on "nvidia-persistenced = 3:575.51.03-1.fc41".
Adding versionlock on "nvidia-settings = 3:575.51.03-1.fc41".

Alternatively, DNF 5 can be configured to specify a range in the configuration file, but this is very verbose. Configure the file /etc/dnf/versionlock.toml with the following content:

version = "1.0"

[[packages]]
name = "kmod-nvidia*"
[[packages.conditions]]
key = "evr"
comparator = ">="
value = "3:575"
[[packages.conditions]]
key = "evr"
comparator = "<"
value = "3:580"

[[packages]]
name = "libnvidia*"
[[packages.conditions]]
key = "evr"
comparator = ">="
value = "3:575"
[[packages.conditions]]
key = "evr"
comparator = "<"
value = "3:580"

[[packages]]
name = "nvidia-driver*"
[[packages.conditions]]
key = "evr"
comparator = ">="
value = "3:575"
[[packages.conditions]]
key = "evr"
comparator = "<"
value = "3:580"

[[packages]]
name = "nvidia-kmod-common*"
[[packages.conditions]]
key = "evr"
comparator = ">="
value = "3:575"
[[packages.conditions]]
key = "evr"
comparator = "<"
value = "3:580"

[[packages]]
name = "nvidia-libXNVCtrl*"
[[packages.conditions]]
key = "evr"
comparator = ">="
value = "3:575"
[[packages.conditions]]
key = "evr"
comparator = "<"
value = "3:580"

[[packages]]
name = "nvidia-modprobe*"
[[packages.conditions]]
key = "evr"
comparator = ">="
value = "3:575"
[[packages.conditions]]
key = "evr"
comparator = "<"
value = "3:580"

[[packages]]
name = "nvidia-open*"
[[packages.conditions]]
key = "evr"
comparator = ">="
value = "3:575"
[[packages.conditions]]
key = "evr"
comparator = "<"
value = "3:580"

[[packages]]
name = "nvidia-persistenced*"
[[packages.conditions]]
key = "evr"
comparator = ">="
value = "3:575"
[[packages.conditions]]
key = "evr"
comparator = "<"
value = "3:580"

[[packages]]
name = "nvidia-settings*"
[[packages.conditions]]
key = "evr"
comparator = ">="
value = "3:575"
[[packages.conditions]]
key = "evr"
comparator = "<"
value = "3:580"

[[packages]]
name = "nvidia-xconfig*"
[[packages.conditions]]
key = "evr"
comparator = ">="
value = "3:575"
[[packages.conditions]]
key = "evr"
comparator = "<"
value = "3:580"

[[packages]]
name = "xorg-x11-nvidia*"
[[packages.conditions]]
key = "evr"
comparator = ">="
value = "3:575"
[[packages.conditions]]
key = "evr"
comparator = "<"
value = "3:580"

Please refer to the dnf5-versionlock(8) manual page for more information and configuration options.

APT#

APT is the package manager of the following distributions:

  • Debian 12

  • Ubuntu 22.04

  • Ubuntu 24.04

Create a configuration file like /etc/apt/preferences.d/nvidia and populate it with the following content to pin the driver to a particular branch and/or version.

Ubuntu:

# Basic driver packages, includes foreign architectures
Package: src:nvidia-graphics-drivers-580:any src:nvidia-kmod-open:any
Pin: version 580*
Pin-Priority: 1000

# Basic driver packages, only in the native architectures
Package: src:nvidia-modprobe src:nvidia-modprobe src:nvidia-persistenced src:nvidia-settings src:nvidia-xconfig
Pin: version 580*
Pin-Priority: 1000

# Meta packages, includes foreign architectures
Package: src:cuda-drivers:any src:nvidia-open:any
Pin: version 580*
Pin-Priority: 1000

# Extra driver packages, only in the native architectures
Package: src:libnvidia-nscq src:libnvsdm src:nvidia-fabricmanager src:nvidia-imex src:nvlink5 src:fabricmanager src:imex
Pin: version 580*
Pin-Priority: 1000

Debian:

# Basic driver packages, includes foreign architectures
Package: src:nvidia-graphics-drivers:any src:nvidia-kmod-open:any
Pin: version 580*
Pin-Priority: 1000

# Basic driver packages, only in the native architectures
Package: src:nvidia-modprobe src:nvidia-modprobe src:nvidia-persistenced src:nvidia-settings src:nvidia-xconfig
Pin: version 580*
Pin-Priority: 1000

# Meta packages, includes foreign architectures
Package: src:cuda-drivers:any src:nvidia-open:any
Pin: version 580*
Pin-Priority: 1000

# Extra driver packages, only in the native architectures
Package: src:libnvidia-nscq src:libnvsdm src:nvidia-fabricmanager src:nvidia-imex src:nvlink5 src:fabricmanager src:imex
Pin: version 580*
Pin-Priority: 1000

A priority of >= 1000 allows APT to also consider downgrades with a higher priority. Please refer to the apt_preferences(5) manual page for more information and configuration options.

Pinning packages#

To facilitate locking driver packages to branches or to pin specific driver version, packages that contain precompiled pinning files are available. These version locking packages have a few benefits:

  • All packages are aligned to the same driver branch, including ones that were never consistent (nvidia-modprobe. etc.).

  • All packages can have proper versions even if we must declare dependencies as equal or higher (ex. nvidia-fabricmanager, etc.) due to APT limitations.

  • Users can also downgrade easily, both to versions and specific driver branches, which is not something that can be really achieved for Debian.

  • Ubuntu specific benefits:

    • From version 590 onwards, all packages will be renamed, simplified and made consistent for all branches. This means consistent documentation and consistent instructions for every new branch.

    • Extra packages (for example from Canonical) are no longer pulled down and mixed in a transaction with NVIDIA packages when installing / upgrading.

    • Non DGX users (laptops, workstations, etc.) can just add the repository and get upgraded to the latest drivers without the need to reinstall the packages for every new branch.

Hint

For the best experience when locking a branch, we suggest to install the pinning package prior to installing the driver.

For example, the branch locking packages are called:

nvidia-driver-pinning-570
nvidia-driver-pinning-575
nvidia-driver-pinning-580
nvidia-driver-pinning-590

On top of that there are version specific pinning packages that are built as part of the driver, and that allow pinning a specific driver version. For example:

nvidia-driver-pinning-570.199
nvidia-driver-pinning-570.200
nvidia-driver-pinning-580.102.03
nvidia-driver-pinning-580.103

Note

APT flags every file under /etc as a configuration file, so the pinning file is marked as configuration and not overwritten / removed unless the user purges the configuration (--purge).

Each of these packages have the following conflicts set, so only one can be installed at a time:

Provides: nvidia-driver-pinning
Replaces: nvidia-driver-pinning
Conflicts: nvidia-driver-pinning

Switching the pinning from one branch/version to another is only a matter of installing a new one. For example:

# apt install -V --purge nvidia-driver-pinning-590
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be REMOVED:
   nvidia-driver-570 (570-0ubuntu1)
The following NEW packages will be installed:
   nvidia-driver-590 (590-0ubuntu1)
0 upgraded, 1 newly installed, 0 downgraded, 1 to remove and 0 not upgraded.
Need to get 10 KB of archives.
After this operation, 10 KB of additional disk space will be used.
Do you want to continue? [Y/n]

Due to the higher piority, these packages can be used to install, downgrade or upgrade to specific versions.

Warning

On Ubuntu, up and including to branch 580, the packages still have the branch reference in the package name. The upgrade/downgrade/install of driver packages that would easily switch branches is only supported on 590+.

From 590 driver releases onwards, Ubuntu packages will lose the branch definition in the package names (like Debian packages) to allow easy switching back and forth on branches and versions.

For example, to switch from the generic latest driver to a specific release on Debian:

# apt-get install nvidia-driver-pinning-570.199
[..]
# apt-get -V dist-upgrade --autoremove
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages will be REMOVED:
   libnvidia-present (580.103-1)
The following packages will be DOWNGRADED:
   firmware-nvidia-gsp (580.103-1 => 570.199-1)
   libcuda1 (580.103-1 => 570.199-1)
   libcuda1:i386 (580.103-1 => 570.199-1)
   libcudadebugger1 (580.103-1 => 570.199-1)
   libegl-nvidia0 (580.103-1 => 570.199-1)
   libegl-nvidia0:i386 (580.103-1 => 570.199-1)
   libgles-nvidia1 (580.103-1 => 570.199-1)
   libgles-nvidia1:i386 (580.103-1 => 570.199-1)
   libgles-nvidia2 (580.103-1 => 570.199-1)
   libgles-nvidia2:i386 (580.103-1 => 570.199-1)
   libglx-nvidia0 (580.103-1 => 570.199-1)
   libglx-nvidia0:i386 (580.103-1 => 570.199-1)
   libnvcuvid1 (580.103-1 => 570.199-1)
   libnvidia-allocator1 (580.103-1 => 570.199-1)
   libnvidia-allocator1:i386 (580.103-1 => 570.199-1)
   libnvidia-api1 (580.103-1 => 570.199-1)
   libnvidia-cfg1 (580.103-1 => 570.199-1)
   libnvidia-eglcore (580.103-1 => 570.199-1)
   libnvidia-eglcore:i386 (580.103-1 => 570.199-1)
   libnvidia-encode1 (580.103-1 => 570.199-1)
   libnvidia-fbc1 (580.103-1 => 570.199-1)
   libnvidia-glcore (580.103-1 => 570.199-1)
   libnvidia-glcore:i386 (580.103-1 => 570.199-1)
   libnvidia-glvkspirv (580.103-1 => 570.199-1)
   libnvidia-glvkspirv:i386 (580.103-1 => 570.199-1)
   libnvidia-gpucomp (580.103-1 => 570.199-1)
   libnvidia-gpucomp:i386 (580.103-1 => 570.199-1)
   libnvidia-ml1 (580.103-1 => 570.199-1)
   libnvidia-ml1:i386 (580.103-1 => 570.199-1)
   libnvidia-ngx1 (580.103-1 => 570.199-1)
   libnvidia-nvvm4 (580.103-1 => 570.199-1)
   libnvidia-opticalflow1 (580.103-1 => 570.199-1)
   libnvidia-pkcs11-openssl3 (580.103-1 => 570.199-1)
   libnvidia-ptxjitcompiler1 (580.103-1 => 570.199-1)
   libnvidia-ptxjitcompiler1:i386 (580.103-1 => 570.199-1)
   libnvidia-rtcore (580.103-1 => 570.199-1)
   libnvidia-sandboxutils (580.103-1 => 570.199-1)
   libnvidia-vksc-core (580.103-1 => 570.199-1)
   libnvoptix1 (580.103-1 => 570.199-1)
   libxnvctrl0 (580.103-1 => 570.199-1)
   nvidia-driver (580.103-1 => 570.199-1)
   nvidia-driver-cuda (580.103-1 => 570.199-1)
   nvidia-driver-libs (580.103-1 => 570.199-1)
   nvidia-driver-libs:i386 (580.103-1 => 570.199-1)
   nvidia-egl-icd (580.103-1 => 570.199-1)
   nvidia-kernel-open-dkms (580.103-1 => 570.199-1)
   nvidia-kernel-support (580.103-1 => 570.199-1)
   nvidia-modprobe (580.103-1 => 570.199-1)
   nvidia-open (580.103-1 => 570.199-1)
   nvidia-opencl-icd (580.103-1 => 570.199-1)
   nvidia-persistenced (580.103-1 => 570.199-1)
   nvidia-settings (580.103-1 => 570.199-1)
   nvidia-vdpau-driver (580.103-1 => 570.199-1)
   nvidia-vulkan-icd (580.103-1 => 570.199-1)
   nvidia-vulkan-icd:i386 (580.103-1 => 570.199-1)
   nvidia-xconfig (580.103-1 => 570.199-1)
   xserver-xorg-video-nvidia (580.103-1 => 570.199-1)
0 upgraded, 0 newly installed, 57 downgraded, 1 to remove and 0 not upgraded.
Need to get 0 B/341 MB of archives.
After this operation, 171 MB disk space will be freed.
Do you want to continue? [Y/n]

Zypper#

Zypper is the package manager of the following distributions:

  • SUSE Enterprise Linux 15 SP6

  • openSUSE Leap 15.6

Just run the zypper addlock command to populate the file /etc/zypp/loccks (which can then be edited or left as is) to lock a specific driver version.

Note

The selection is negative, so the lock specifies the packages that needs to be excluded.

# zypper addlock "*nvidia* >= 580"
Specified lock has been successfully added.
# cat /etc/zypp/locks

type: package
version: >= 580
match_type: glob
case_sensitive: on
solvable_name: *nvidia*

This will make sure that anything above and including branch 580 is excluded. For example, with 580 already in the CUDA repository, we can see it only allows anything lower than 580:

# zypper search --details nvidia-compute-G06
Loading repository data...
Reading installed packages...

S  | Name                     | Type    | Version      | Arch   | Repository
---+--------------------------+---------+--------------+--------+-----------------------
 l | nvidia-compute-G06       | package | 580.82.07-1  | x86_64 | cuda-opensuse15-x86_64
 l | nvidia-compute-G06       | package | 580.65.06-1  | x86_64 | cuda-opensuse15-x86_64
   | nvidia-compute-G06       | package | 575.57.08-1  | x86_64 | cuda-opensuse15-x86_64
   | nvidia-compute-G06       | package | 575.51.03-1  | x86_64 | cuda-opensuse15-x86_64
   | nvidia-compute-G06       | package | 570.172.08-1 | x86_64 | cuda-opensuse15-x86_64
   | nvidia-compute-G06       | package | 570.158.01-1 | x86_64 | cuda-opensuse15-x86_64
   | nvidia-compute-G06       | package | 570.148.08-1 | x86_64 | cuda-opensuse15-x86_64
   | nvidia-compute-G06       | package | 570.133.20-1 | x86_64 | cuda-opensuse15-x86_64
   | nvidia-compute-G06       | package | 570.124.06-1 | x86_64 | cuda-opensuse15-x86_64
   | nvidia-compute-G06       | package | 570.86.15-1  | x86_64 | cuda-opensuse15-x86_64
   | nvidia-compute-G06       | package | 570.86.10-1  | x86_64 | cuda-opensuse15-x86_64
   | nvidia-compute-G06       | package | 565.57.01-1  | x86_64 | cuda-opensuse15-x86_64
   | nvidia-compute-G06       | package | 560.35.05-1  | x86_64 | cuda-opensuse15-x86_64
   | nvidia-compute-G06       | package | 560.35.03-0  | x86_64 | cuda-opensuse15-x86_64
   | nvidia-compute-G06       | package | 560.28.03-0  | x86_64 | cuda-opensuse15-x86_64
   | nvidia-compute-G06       | package | 555.42.06-0  | x86_64 | cuda-opensuse15-x86_64
   | nvidia-compute-G06       | package | 555.42.02-0  | x86_64 | cuda-opensuse15-x86_64
   | nvidia-compute-G06       | package | 550.163.01-1 | x86_64 | cuda-opensuse15-x86_64
   | nvidia-compute-G06       | package | 550.144.03-1 | x86_64 | cuda-opensuse15-x86_64
   | nvidia-compute-G06       | package | 550.127.08-1 | x86_64 | cuda-opensuse15-x86_64
   | nvidia-compute-G06       | package | 550.127.05-1 | x86_64 | cuda-opensuse15-x86_64
   | nvidia-compute-G06       | package | 550.90.12-1  | x86_64 | cuda-opensuse15-x86_64
   | nvidia-compute-G06       | package | 550.90.07-0  | x86_64 | cuda-opensuse15-x86_64
   | nvidia-compute-G06       | package | 550.54.15-0  | x86_64 | cuda-opensuse15-x86_64
   | nvidia-compute-G06       | package | 550.54.14-0  | x86_64 | cuda-opensuse15-x86_64
 l | nvidia-compute-G06-32bit | package | 580.82.07-1  | x86_64 | cuda-opensuse15-x86_64
 l | nvidia-compute-G06-32bit | package | 580.65.06-1  | x86_64 | cuda-opensuse15-x86_64
   | nvidia-compute-G06-32bit | package | 575.57.08-1  | x86_64 | cuda-opensuse15-x86_64
   | nvidia-compute-G06-32bit | package | 575.51.03-1  | x86_64 | cuda-opensuse15-x86_64
   | nvidia-compute-G06-32bit | package | 570.172.08-1 | x86_64 | cuda-opensuse15-x86_64
   | nvidia-compute-G06-32bit | package | 570.158.01-1 | x86_64 | cuda-opensuse15-x86_64
   | nvidia-compute-G06-32bit | package | 570.148.08-1 | x86_64 | cuda-opensuse15-x86_64
   | nvidia-compute-G06-32bit | package | 570.133.20-1 | x86_64 | cuda-opensuse15-x86_64
   | nvidia-compute-G06-32bit | package | 570.124.06-1 | x86_64 | cuda-opensuse15-x86_64
   | nvidia-compute-G06-32bit | package | 570.86.15-1  | x86_64 | cuda-opensuse15-x86_64
   | nvidia-compute-G06-32bit | package | 570.86.10-1  | x86_64 | cuda-opensuse15-x86_64
   | nvidia-compute-G06-32bit | package | 565.57.01-1  | x86_64 | cuda-opensuse15-x86_64
   | nvidia-compute-G06-32bit | package | 560.35.05-1  | x86_64 | cuda-opensuse15-x86_64
   | nvidia-compute-G06-32bit | package | 560.35.03-0  | x86_64 | cuda-opensuse15-x86_64
   | nvidia-compute-G06-32bit | package | 560.28.03-0  | x86_64 | cuda-opensuse15-x86_64
   | nvidia-compute-G06-32bit | package | 555.42.06-0  | x86_64 | cuda-opensuse15-x86_64
   | nvidia-compute-G06-32bit | package | 555.42.02-0  | x86_64 | cuda-opensuse15-x86_64
   | nvidia-compute-G06-32bit | package | 550.163.01-1 | x86_64 | cuda-opensuse15-x86_64
   | nvidia-compute-G06-32bit | package | 550.144.03-1 | x86_64 | cuda-opensuse15-x86_64
   | nvidia-compute-G06-32bit | package | 550.127.08-1 | x86_64 | cuda-opensuse15-x86_64
   | nvidia-compute-G06-32bit | package | 550.127.05-1 | x86_64 | cuda-opensuse15-x86_64
   | nvidia-compute-G06-32bit | package | 550.90.12-1  | x86_64 | cuda-opensuse15-x86_64
   | nvidia-compute-G06-32bit | package | 550.90.07-0  | x86_64 | cuda-opensuse15-x86_64
   | nvidia-compute-G06-32bit | package | 550.54.15-0  | x86_64 | cuda-opensuse15-x86_64
   | nvidia-compute-G06-32bit | package | 550.54.14-0  | x86_64 | cuda-opensuse15-x86_64

Please refer to the locks(5) manual page for more information and configuration options.