Before you start: schedule a maintenance window at least 48 hours in advance.You are responsible for the maintenance and any resulting interruption. Work performed outside the scheduled maintenance window may be treated as an operational failure.If you are unsure whether this operation could cause data loss, stop here.
A machine at or above its minimum needs nothing from this page. For a machine
below it, this page installs the minimum version from NVIDIA’s apt repository,
has DKMS build its kernel module, and holds it so nothing upgrades it. With
DKMS, a kernel update rebuilds the same driver for the new kernel instead of
changing the driver.
Driver branches newer than the ones in the table, such as 620, are not directly
supported yet, though a machine on one may still run on the platform. Hosts on
an unlisted branch are expected to keep the driver on the newest release of that
branch, for its latest security fixes. This page does not change it.
1. Check the current driver
nothing to do, stop here.
2. Prepare the build and the repository
Each command in this step installs only what is missing. Kernel headers for the running kernel and for kernels installed later. DKMS needs them to build the driver:apt-get update must finish without E: lines. For a Signed-By error, see
If apt-get update reports a Signed-By conflict.
Confirm NVIDIA publishes the version for this machine:
3. Remove the current driver
This removes a driver installed with NVIDIA’s.run installer, and does nothing
otherwise:
fabricmanager, the machine has NVSwitch; step 4
installs Fabric Manager again. Remove them:
REMOVED list. Every name must contain nvidia,
cuda, nvlink or nvsdm, or be libxnvctrl0, and the list must not include
nvidia-container-toolkit,
nvidia-container-toolkit-base, libnvidia-container1 or
libnvidia-container-tools. If either rule is broken, answer n and stop.
4. Install the driver
Pin the version first. NVIDIA’s pinning package makes apt install exactly that version of every driver package (NVIDIA: version locking):libnvsdm, which
NVIDIA publishes for x86_64 only:
Error!, see
If the DKMS build fails.
Check the module the reboot will load. A reboot normally starts the newest
kernel in /boot, and this prints the driver version built for it:
DRIVER_VERSION. modinfo: ERROR: Module nvidia not found.
means DKMS did not build for that kernel; see
If the DKMS build fails. Do not reboot until it
prints the version.
5. Hold the driver
6. Reboot and verify
Every GPU on the minimum driver version, module built by DKMS, driver held.
Kernel upgrades
When a kernel upgrade installs new headers, DKMS builds the held driver for the new kernel as part of the upgrade. Before rebooting into the new kernel, check:installed. If it has none, do not
reboot. Run the two install commands at the start of step 2, then build for the
new kernel, using its version in place of 7.0.0-38-generic:
Recovery
If the DKMS build fails
When the kernel’s headers are missing, DKMS says so:modinfo check at the end of step 4.
If nvidia-smi fails after the reboot
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver
means no module loaded for the running kernel:
installed, build it and
reboot:
If apt-get update reports a Signed-By conflict
cuda-ubuntu2404-x86_64.list (ubuntu2204 on 22.04, sbsa on ARM64),
which cuda-keyring installed. Move the other file out of
/etc/apt/sources.list.d/, or comment out the line if it is in
/etc/apt/sources.list, then run sudo apt-get update again.