How to install and update NVIDIA drivers on a GPU Server

Published on: October 31, 2026

The NVIDIA driver lets the operating system and your software use the GPU of a GPU Server. It also sets the newest CUDA version your software can use.

This guide covers Ubuntu 24.04. It walks you through updating the driver on the operating system with the NVIDIA driver preinstalled, and installing the driver on Ubuntu Server 24.04 LTS, which doesn't come with it. If you build your own CUDA code, it also shows how to install the CUDA Toolkit.

Before you start

You need:

Every change to the driver ends with a restart of the server, so stop the work running on the GPU before you begin.

Check the installed driver

nvidia-smi shows the version of the driver in the header of its output, next to the newest CUDA version the driver supports:

nvidia-smi
Output
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 595.58.03              Driver Version: 595.58.03      CUDA Version: 13.2     |
+-----------------------------------------+------------------------+----------------------+
...

The first number of the version, 595 here, is the driver branch. NVIDIA releases updates within each branch, and newer branches support newer CUDA versions.

If the driver isn't installed yet, the command isn't found, and Ubuntu suggests packages from its own archive:

Output
Command 'nvidia-smi' not found, but can be installed with:
apt install nvidia-utils-470         # version 470.256.02-0ubuntu0.24.04.1, or
apt install nvidia-utils-470-server  # version 470.256.02-0ubuntu0.24.04.1
...

Instead of the suggested packages, install the driver as described in Install the driver on Ubuntu 24.04.

Update the preinstalled driver

On Ubuntu Server 24.04 LTS (with NVIDIA drivers & CUDA), the driver comes from NVIDIA's CUDA repository, which the operating system already has set up. The operating system also comes with an apt pin that holds the driver at the version it was installed with, so apt upgrade updates the rest of the system but leaves the driver as it is. Like the rest of the operating system, keeping the driver up to date after you deploy the server is up to you. For the details, see Shared responsibility.

The pin comes from a package. To see which one is installed, run:

apt list --installed 'nvidia-driver-pinning*'
Output
nvidia-driver-pinning-595.58.03/unknown,now 595.58.03-1ubuntu1 all [installed]

NVIDIA's repository has two kinds of pinning packages. A version pin, like the nvidia-driver-pinning-595.58.03 above, holds the driver at one version. A branch pin, such as nvidia-driver-pinning-595, keeps the driver on one branch but still takes that branch's updates.

To see which branches are available, update the package lists and search for the branch pins:

sudo apt update
apt-cache search --names-only '^nvidia-driver-pinning-[0-9]+$' | sort
Output
nvidia-driver-pinning-570 - APT driver pinning file for driver branch 570
nvidia-driver-pinning-575 - APT driver pinning file for driver branch 575
nvidia-driver-pinning-580 - APT driver pinning file for driver branch 580
nvidia-driver-pinning-590 - APT driver pinning file for driver branch 590
nvidia-driver-pinning-595 - APT driver pinning file for driver branch 595
nvidia-driver-pinning-610 - APT driver pinning file for driver branch 610
nvidia-driver-pinning-615 - APT driver pinning file for driver branch 615

Update to the latest driver in the same branch

To take the latest driver in the branch you're on, replace the version pin with the branch pin. For the 595 branch, run:

sudo apt install nvidia-driver-pinning-595

apt asks to remove the version pin, which the branch pin replaces. Type Y and press Enter:

Output
The following packages will be REMOVED:
  nvidia-driver-pinning-595.58.03
The following NEW packages will be installed:
  nvidia-driver-pinning-595
...
Do you want to continue? [Y/n]

Then upgrade the packages, which now include the driver. The upgrade also updates the rest of the system, including the kernel when a newer one is available:

sudo apt upgrade

During the upgrade, a Configuring keyboard-configuration dialog might ask for the country and the layout of your keyboard. Keep the selected English (US), or select your own, and press Enter.

While apt installs the new driver, DKMS builds the driver's kernel module:

Output
...
Building initial module nvidia/595.112.07 for 6.8.0-134-generic
Sign command: /usr/bin/kmodsign
Binary update-secureboot-policy not found, modules won't be signed
Building module(s).......... done.
...

The message that the modules won't be signed is expected, and the driver works without signing. Other messages in the output, such as Could not execute systemctl and dpkg: warning: unable to delete old directory, don't affect the driver either.

When the upgrade includes a new kernel, a Pending kernel upgrade message at the end says that the server is still running the old kernel. Press Enter to close it.

Restart the server to load the new driver, and the new kernel if there is one:

sudo reboot

Once you've reconnected, run nvidia-smi again. The header shows the new version:

Output
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 595.112.07             Driver Version: 595.112.07     CUDA Version: 13.2     |
+-----------------------------------------+------------------------+----------------------+
...

From now on, sudo apt upgrade takes each new driver in the 595 branch. Restart the server after an upgrade that includes the driver.

Move to a newer driver branch

If your software needs a newer CUDA version than your driver supports, move to a newer branch by installing its pin, for example for the 615 branch:

sudo apt install nvidia-driver-pinning-615
sudo apt upgrade
sudo reboot

After the restart, nvidia-smi shows the newest driver in the new branch and the newer CUDA version it supports. On the 615 branch, the header calls them KMD Version and CUDA UMD Version:

Output
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 615.71.10              KMD Version: 615.71.10     CUDA UMD Version: 13.4     |
+-----------------------------------------+------------------------+----------------------+
...

Install the driver on Ubuntu 24.04

On Ubuntu Server 24.04 LTS, you install the driver from NVIDIA's CUDA repository, the same one the operating system with the NVIDIA driver preinstalled uses.

The driver's kernel module is built for the running kernel, so it needs the kernel's headers. Update the package lists and install the headers:

sudo apt update
sudo apt install linux-headers-$(uname -r)

Next, add NVIDIA's CUDA repository with its cuda-keyring package:

wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/cuda-keyring_1.1-1_all.deb
sudo dpkg -i cuda-keyring_1.1-1_all.deb
sudo apt update

Before you install the driver, choose a branch and install its pin, so the driver stays on that branch when you upgrade later. To list the branches and pin the 615 branch, run:

apt-cache search --names-only '^nvidia-driver-pinning-[0-9]+$' | sort
sudo apt install nvidia-driver-pinning-615

Then install the driver:

sudo apt install nvidia-dkms-open libnvidia-compute

nvidia-dkms-open is the driver's kernel module, and libnvidia-compute holds the libraries that CUDA software uses, along with nvidia-smi. NVIDIA's nvidia-open package installs the same driver with its graphics and video libraries, but it also brings an X server and other desktop packages.

The install ends with DKMS building the module for the running kernel:

Output
...
Building initial module nvidia/615.71.10 for 6.8.0-137-generic
Sign command: /usr/bin/kmodsign
Binary update-secureboot-policy not found, modules won't be signed
Building module(s)........ done.
...

The message that the modules won't be signed is expected, and the driver works without signing.

Restart the server to finish the install:

sudo reboot

Once you've reconnected, check the driver:

nvidia-smi
Output
Sat Oct 31 08:39:30 2026
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 615.71.10              KMD Version: 615.71.10     CUDA UMD Version: 13.4     |
+-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA RTX PRO 6000 Blac...    On  |   00000000:00:06.0 Off |                    0 |
| N/A   34C    P8             89W /  600W |       0MiB /  97887MiB |      0%      Default |
|                                         |                        |             Disabled |
+-----------------------------------------+------------------------+----------------------+
...

From now on, sudo apt upgrade takes each new driver in the pinned branch. To move to a newer branch, see Move to a newer driver branch.

Install the CUDA Toolkit

To build your own CUDA code, you need the CUDA Toolkit, which includes the nvcc compiler. The operating system with the NVIDIA driver preinstalled already has it, so these steps are for Ubuntu Server 24.04 LTS.

cuda-toolkit installs the newest version:

sudo apt install cuda-toolkit

For a specific version, add it to the package name, such as cuda-toolkit-13-2 for CUDA 13.2.

The toolkit goes in /usr/local/cuda, but its programs aren't on the PATH. Add their folder to the PATH, and to ~/.bashrc so that it's set in your later sessions too:

export PATH=/usr/local/cuda/bin:$PATH
echo 'export PATH=/usr/local/cuda/bin:$PATH' >> ~/.bashrc

Check that nvcc is found:

nvcc --version
Output
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2026 NVIDIA Corporation
Built on Tue_Sep_01_08:45:21_PDT_2026
Cuda compilation tools, release 13.4, V13.4.92
Build cuda_13.4.r13.4/compiler.38855100_0

Build a test program

To check that the toolkit and the driver work together, you can build a small program that adds two arrays on the GPU. Create a file named vector_add.cu with the following content:

#include <cstdio>

__global__ void add(int n, const float *x, float *y) {
    int i = blockIdx.x * blockDim.x + threadIdx.x;
    if (i < n) y[i] += x[i];
}

int main() {
    int n = 1 << 20;
    float *x, *y;
    cudaMallocManaged(&x, n * sizeof(float));
    cudaMallocManaged(&y, n * sizeof(float));
    for (int i = 0; i < n; i++) { x[i] = 1.0f; y[i] = 2.0f; }
    add<<<(n + 255) / 256, 256>>>(n, x, y);
    cudaError_t err = cudaDeviceSynchronize();
    printf("%s, y[0] = %.1f\n", cudaGetErrorString(err), y[0]);
    return err != cudaSuccess;
}

Compile it with nvcc and run it:

nvcc -o vector_add vector_add.cu
./vector_add

The program prints no error and the first result, 1 + 2:

Output
no error, y[0] = 3.0

Keep the driver working through kernel updates

When sudo apt upgrade installs a new kernel, DKMS builds the driver's kernel module for it too, using the headers that linux-headers-generic installs with each new kernel. Both Ubuntu 24.04 operating systems come with that package.

The upgrade might show the same Configuring keyboard-configuration dialog as in Update to the latest driver in the same branch. At the end, a Pending kernel upgrade message says that the server is still running the old kernel. Press Enter to close each of them.

Before you restart the server, you can check that the module was built for the new kernel. dkms status lists one line for each kernel:

dkms status
Output
nvidia/615.71.10, 6.8.0-137-generic, x86_64: installed
nvidia/615.71.10, 6.8.0-147-generic, x86_64: installed

Then restart the server with sudo reboot.

Troubleshooting

  • Failed to initialize NVML: Driver/library version mismatch

    nvidia-smi shows this after a driver update until you restart the server. Restart it with sudo reboot.

  • Command 'nvcc' not found, but can be installed with: apt install nvidia-cuda-toolkit

    The toolkit's folder isn't on the PATH. Instead of the suggested package, add the folder to the PATH as described in Install the CUDA Toolkit.

Next steps

NVIDIA is a registered trademark of NVIDIA Corporation.

Contributed by: Samir Haliru

Can't find what you're looking for?

For more help you can contact our awesome 24/7 support team