Driver Installation Guide

The installation instructions for the NVIDIA Driver on Linux.

1. Introduction

1.1. System Requirements

To use the NVIDIA Driver on your system, you will need the following installed:

The following table lists the supported Linux distributions. Please review the footnotes associated with the table.

Table 1 Supported Linux Distributions

Distribution

Kernel1

Default GCC

GLIBC

x86_64

RHEL 9.y (y <= 4)

5.14.0-427

11.4.1

2.34

RHEL 8.y (y <= 10)

4.18.0-553

8.5.0

2.28

OpenSUSE Leap 15.y (y <= 6)

6.4.0-150600.21

7.5.0

2.38

Rocky Linux 8.y (y<=10)

4.18.0-553

8.5.0

2.28

Rocky Linux 9.y (y<=4)

5.14.0-427

11.4.1

2.34

SUSE SLES 15.y (y <= 6)

6.4.0-150600.21

7.5.0

2.31

Ubuntu 24.04 LTS

6.8.0-31

13.2.0

2.39

Ubuntu 22.04.z (z <= 4) LTS

6.5.0-27

12.3.0

2.35

Ubuntu 20.04.z (z <= 6) LTS

5.15.0-67

9.4.0

2.31

Debian 12.x (x<=6)

6.1.0-22

12.2.0

2.36

Debian 11.y (y<=10)

5.10.209-2

10.2.1

2.31

Fedora 39

6.5.6-300

13.2.1

2.38

KylinOS V10 SP4 2403

4.19.90-89.11.v2401

7.3.0

2.28

MSFT Azure Linux 2.0

5.15.158.2-1

11.2.0

2.35

Amazon Linux 2023

6.1.82-99.168

11.4.1

2.34

Arm64 sbsa

RHEL 9.y (y <= 4)

5.14.0-427

11.4.1

2.34

RHEL 8.y (y <= 10)

4.18.0-553

8.5.0

2.28

SUSE SLES 15.y (y = 6)

6.4.0-150600.21

7.5.0

2.38

Kylin V10 SP3 2403

4.19.90-89

12.3.0

2.28

Ubuntu 24.04 LTS

6.8.0-31

13.2.0

2.39

Ubuntu 22.04 LTS (z <= 5) LTS

5.15.0-102

11.4.0

2.35

Ubuntu 20.04.z (z <= 5) LTS

5.4.0-174

9.4.0

2.31

  1. The following notes apply to the kernel versions supported:

1.2. OS Support Policy

  • NVIDIA driver support for Ubuntu 20.04.x, Ubuntu 22.04.x, Ubuntu 24.04.x, RHEL 8.x, RHEL 9.x, Rocky Linux 8.x, Rocky Linux 9.x, SUSE SLES 15.x and OpenSUSE Leap 15.x will be until the standard EOSS as defined for each OS. Please refer to the support lifecycle for these OSes to know their support timelines.

  • The NVIDIA driver supports the latest Fedora release version. For Fedora release timelines, visit https://docs.fedoraproject.org/en-US/releases/.

  • The NVIDIA driver supports a single KylinOS release version. For details, visit https://www.kylinos.cn/.

Refer to the support lifecycle for these supported OSes to know their support timelines and plan to move to newer releases accordingly.

1.3. About This Document

This document is intended for readers familiar with the Linux environment and the compilation of C programs from the command line.

Note

Many commands in this document might require superuser privileges. On most distributions of Linux, this will require you to log in as root. For systems that have enabled the sudo package, use the sudo prefix for all necessary commands.

2. Pre-installation Actions

Some actions must be taken before the NVIDIA driver can be installed on Linux:

  • Verify the system is running a supported version of Linux.

  • Verify the system has gcc installed.

  • Verify the system has the correct kernel headers and development packages installed.

  • Handle conflicting installation methods.

Note

You can override the install-time prerequisite checks by running the installer with the -override flag. Remember that the prerequisites will still be required to use the NVIDIA CUDA Toolkit.

2.1. Verify You Have a Supported Version of Linux

The CUDA Development Tools are only supported on some specific distributions of Linux. These are listed in the CUDA Toolkit release notes.

To determine which distribution and release number you’re running, type the following at the command line:

uname -m && cat /etc/<os-release>

The x86_64 line indicates you are running on a 64-bit system. The remainder gives information about your distribution.

2.2. Verify the System Has gcc Installed

The gcc compiler is required for development using the NVIDIA driver. It is not required for running CUDA applications. It is generally installed as part of the Linux installation, and in most cases the version of gcc installed with a supported version of Linux will work correctly.

To verify the version of gcc installed on your system, type the following on the command line:

gcc --version

If an error message displays, you need to install the development tools from your Linux distribution or obtain a version of gcc and its accompanying toolchain from the Web.

2.3. Verify the System has the Correct Kernel Headers and Development Packages Installed

The NVIDIA driver requires that the kernel headers and development packages for the running version of the kernel be installed at the time of the driver installation, as well whenever the driver is rebuilt. For example, if your system is running kernel version 3.17.4-301, the 3.17.4-301 kernel headers and development packages must also be installed.

The RPM and Debian installations of the driver will make an attempt to install the kernel header and development packages if no version of these packages is currently installed. However, it will install the latest version of these packages, which may or may not match the version of the kernel your system is using. Therefore, it is best to manually ensure the correct version of the kernel headers and development packages are installed prior to installing the NVIDIA Drivers, as well as whenever you change the kernel version.

The version of the kernel your system is running can be found by running the following command:

uname -r

This is the version of the kernel headers and development packages that must be installed prior to installing the NVIDIA drivers. This command will be used multiple times below to specify the version of the packages to install. Note that below are the common-case scenarios for kernel usage. More advanced cases, such as custom kernel branches, should ensure that their kernel headers and sources match the kernel build they are running.

Note

If you perform a system update which changes the version of the Linux kernel being used, make sure to rerun the commands below to ensure you have the correct kernel headers and kernel development packages installed. Otherwise, the NVIDIA Driver will fail to work with the new kernel.

2.4. Remove Outdated GPG Key

2.4.1. Remove Outdated RPM Signing Key

sudo rpm --erase gpg-pubkey-7fa2af80*

2.4.2. RPM-based CUDA Public GPG Key

The new GPG public key for the CUDA repository (RPM-based distros) is d42d0685.

2.4.3. RHEL and Fedora Install the New CUDA Public GPG Key

On a fresh installation of RHEL, the dnf package manager will prompt the user to accept new keys when installing packages the first time. Indicate you accept the change when prompted. For upgrades, you must also also fetch an updated .repo entry:

sudo dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/$distro/$arch/cuda-$distro.repo

2.4.4. OpenSUSE and SLES Install the New CUDA Public GPG Key

On fresh installation of openSUSE, the zypper package manager will prompt the user to accept new keys when installing packages the first time. Indicate you accept the change when prompted. For upgrades, you must also also fetch an updated .repo entry:

sudo zypper removerepo cuda-opensuse15-x86_64
sudo zypper addrepo https://developer.download.nvidia.com/compute/cuda/repos/$distro/$arch/cuda-$distro.repo

2.4.5. Remove Outdated DEB Signing Key

sudo apt-key del 7fa2af80

2.4.6. Debian-based public GPG key

The new GPG public key for the CUDA repository (Debian-based distros) is 3bf863cc.

This must be enrolled on the system, either using the cuda-keyring package or manually; the apt-key command is deprecated and not recommended.

2.4.7. CUDA Keyring

wget https://developer.download.nvidia.com/compute/cuda/repos/$distro/$arch/cuda-keyring_1.1-1_all.deb
sudo dpkg -i cuda_keyring_1.1-1_all.deb
sudo apt-get update

2.4.8. CUDA Archive Keyring

Manual instructions if unable to install the cuda-keyring package:

  1. Enroll the new signing key:

    wget https://developer.download.nvidia.com/compute/cuda/repos/<distro>/<arch>/cuda-archive-keyring.gpg
    sudo mv cuda-archive-keyring.gpg /usr/share/keyrings/cuda-archive-keyring.gpg
    
  2. Enable the network repository:

    echo "deb [signed-by=/usr/share/keyrings/cuda-archive-keyring.gpg] https://developer.download.nvidia.com/compute/cuda/repos/<distro>/<arch>/ /" | sudo tee /etc/apt/sources.list.d/cuda-<distro>-<arch>.list
    

2.5. Choose an Installation Method

The NVIDIA driver can be installed using distribution-specific packages (RPM and Debian packages).

The distribution-independent package has the advantage of working across a wider set of Linux distributions, but does not update the distribution’s native package management system. The distribution-specific packages interface with the distribution’s native package management system. It is recommended to use the distribution-specific packages, where possible.

When using RPM or Debian local repo installers, the downloaded package contains a repository snapshot stored on the local filesystem in /var/. Such a package only informs the package manager where to find the actual installation packages, but will not install them.

If the online network repository is enabled, RPM or Debian packages will be automatically downloaded at installation time using the package manager: apt-get, dnf, tdnf, yum, or zypper.

Distribution-specific instructions detail how to install NVIDIA driver:

Finally, some helpful package manager capabilities are detailed.

Note

Optional components such as nvidia-fs, libnvidia_nscq, and fabricmanager are not installed by default and will have to be installed separately as needed.

3. Recent Updates

3.1. Driver Installation

Open GPU kernel modules

Starting in CUDA 12.6, the cuda meta-package now installs the NVIDIA driver by default with the Open GPU kernel modules. Any previous version installed the proprietary kernel modules.

  • cuda-runtime-X-Ynvidia-open-XXX

  • cudanvidia-open

Note

Replace XXX with the NVIDIA driver branch number, such as 560.

Compute only and desktop installation

Driver 560 allows a new custom installation method which includes only part of the driver for different use cases. This allows for a more granular installation with fewer dependencies, especially for compute only systems where the desktop components would pull in a lot of extra libraries that then would go unused.

Depending on the operating system, it is now possible to install the driver in the following configuration:

  • Desktop – Contains all the X/Wayland drivers and libraries to allow running a GPU with power management enabled on a desktop system (laptop, workstation, and so on) but does not include any CUDA component.

  • Compute only, or “headless” – Contains everything required to run CUDA applications on a GPU system where the GPU is not used to drive a display: a computational cluster, a workstation with a dedicated NVIDIA GPU, and so on.

  • Desktop + Compute – The canonical way of installing the driver, with every possible library and display component. This might be required in cross functional combinations, for example using CUDA libraries for NVIDIA DLSS enhanced games.

_images/driver-chart.png

This option is now enabled for the following operating systems, with more to follow in future releases:

  • Red Hat Enterprise Linux 8

  • Red Hat Enterprise Linux 9

  • Kylin 10

  • Fedora 39

The installation of the driver for the following operating systems is provided only in compute only/headless mode:

  • Azure Linux (CBL Mariner 2)

  • Amazon Linux 2023

    • Upgrading the driver on Amazon Linux 2023 to version 560 will remove all the unused desktop components as part of the upgrade.

More information is available in the respective sections.

3.2. Driver Helper Script

A new script is available to detect and install the best NVIDIA driver packages for the user’s system. This piece of software is meant to help users decide on which NVIDIA graphics driver to install, based on the detected system’s hardware.

To install the driver helper script, install the nvidia-driver-assistant using apt-get/dnf/tdnf/zypper.

The following table explains the different flags for the driver helper script:

Table 2 Driver helper script flags

Flags Used

Description

--install

Install the recommended driver.

--branch [BRANCH]

Specify an NVIDIA Driver branch.

--list-supported-distros

Print out the list of the supported Linux distributions.

--supported-gpus [SUPPORTED_GPUS]

Use a different supported-gpus.json file.

--sys-path [SYS_PATH]

Use a different /sys path. Useful for testing.

--os-release-path [OS_RELEASE_PATH]

Use a different path for the os-release file. Useful for testing.

--distro [DISTRO]

Specify a Linux distro using the DISTRO:VERSION or DISTRO pattern. Useful for testing.

--module-flavor [MODULE_FLAVOR]

Specify a kernel module flavor; open and closed are accepted values. Useful for testing.

--verbose

[OPTIONAL] Verbose output.

The following are example command outputs:

Table 3 Command outputs

Command

Example Output

$ nvidia-driver-assistant

Detected GPUs:

NVIDIA GeForce RTX 3070 - (pci_id 0x2484)

Detected system:

Ubuntu 24.04

Please copy and paste the following command to install the open kernel module flavour:

sudo apt-get install -y nvidia-open

$ nvidia-driver-assistant --install

Detected GPUs:

NVIDIA GeForce RTX 3070 - (pci_id 0x2484)

Detected system:

Ubuntu 24.04

Using the NVIDIA driver implies acceptance of the NVIDIA Software License Agreement, contained in the "LICENSE" file in the "/usr/share/nvidia-driver-assistant/driver_eula" directory

Installing the following package for the open kernel module flavour:

sudo apt-get install -y nvidia-open

$ nvidia-driver-assistant --install --module-flavor closed

Detected GPUs:

NVIDIA GeForce RTX 3070 - (pci_id 0x2484)

Detected system:

Ubuntu 24.04

Using the NVIDIA driver implies acceptance of the NVIDIA Software License Agreement, contained in the "LICENSE" file in the "/usr/share/nvidia-driver-assistant/driver_eula" directory

Installing the following package for the legacy kernel module flavour:

sudo apt-get install -y cuda-drivers

3.3. Auto Hardware Selection

Starting in 560, the standalone NVIDIA driver runfile will use hardware detection to auto-select between installation of Open GPU or proprietary kernel modules based on the detected SKUs.

The CUDA runfile bundles an intact NVIDIA driver runfile and passes the --silent flag if the driver is selected (default) via ncurses or the CLI.

Therefore, by default the user will install the auto-detected flavor of the kernel modules using the CUDA runfile. Additionally, we expose overrides to select the open GPU or proprietary kernel modules in the ncurses UI advanced options, or via --kernel-module-type=open and --kernel-module-type=proprietary flags.

4. NVIDIA Kernel Modules

The NVIDIA Linux GPU Driver contains several kernel modules:

  • nvidia.ko

  • nvidia-modeset.ko

  • nvidia-uvm.ko

  • nvidia-drm.ko

  • nvidia-peermem.ko

Starting in the 515 driver release series, two “flavors” of these kernel modules are provided:

Starting in the 560 driver release series, the open kernel module flavor is the default installation.

4.1. NVIDIA Open GPU Kernel Modules Installation

Verify that your NVIDIA GPU is at least Turing or newer generation:

lspci | grep VGA

Starting in the 545 driver release, it is no longer required to manually enable support for GeForce and Quadro SKUs with:

echo "options nvidia NVreg_OpenRmEnableUnsupportedGpus=1" | sudo tee /etc/modprobe.d/nvidia-gsp.conf

For simplification, we’ve condensed the package manager recommendations in table format. All releases beyond driver version 560 and CUDA Toolkit 12.6 will use these packaging conventions.

Table 4 Package manager installation recommendations

Distro

Install the Latest

Install a Specific Release

Amazon Linux and Fedora

sudo dnf module install nvidia-driver:open-dkms

sudo dnf module install nvidia-driver:560-open

KylinOS and RHEL/Rocky Linux

sudo dnf module install nvidia-driver:open-dkms

sudo dnf module install nvidia-driver:560-open

Azure Linux

sudo tdnf install nvidia-open

sudo tdnf install nvidia-open-560

openSUSE

sudo zypper install nvidia-open

sudo zypper install nvidia-open-560

SLES

sudo zypper install nvidia-open{-azure,-64k}

sudo zypper install nvidia-open-560{-azure,-64k}

Debian

sudo apt-get install nvidia-open

sudo apt-get install nvidia-open-560

Ubuntu

sudo apt-get install nvidia-open

sudo apt-get install nvidia-open-560

4.2. NVIDIA Proprietary GPU Kernel Modules Installation

For older GPUs from the Maxwell, Pascal, or Volta architectures, the open-source GPU kernel modules are not compatible with your platform. Continue to use the NVIDIA proprietary driver.

Table 5 Proprietary GPU Kernel Module Installation

Distro

Install the Latest

Install a Specific Release

Amazon Linux and Fedora

sudo dnf module install nvidia-driver:latest-dkms

sudo dnf module install nvidia-driver:560-dkms

KylinOS and RHEL/Rocky Linux

sudo dnf module install nvidia-driver:latest-dkms

sudo dnf module install nvidia-driver:560-dkms

Azure Linux

Only the open kernel modules are supported.

Only the open kernel modules are supported.

openSUSE

sudo zypper install cuda-drivers

sudo zypper install cuda-drivers-560

SLES

sudo zypper install nvidia-driver-G06-kmp-$flavor

sudo zypper install cuda-drivers

sudo zypper install nvidia-driver-G06-kmp-$flavor

sudo zypper install cuda-drivers-560

Debian

sudo apt-get install cuda-drivers

sudo apt-get install cuda-drivers-560

Ubuntu

sudo apt-get install cuda-drivers

sudo apt-get install cuda-drivers-560

5. RHEL / Rocky

5.1. Prepare RHEL / Rocky

  1. Perform the Pre-installation Actions.

    Precompiled streams do not require kernel headers.

  2. The kernel headers and development packages for the currently running kernel can be installed with:

    sudo dnf install kernel-devel-$(uname -r) kernel-headers-$(uname -r)
    

    Precompiled streams do not require DKMS.

  3. Satisfy third-party package dependency:

    • Satisfy DKMS dependency: The NVIDIA driver RPM packages depend on other external packages, such as DKMS and libvdpau. Those packages are only available on third-party repositories, such as EPEL. Any such third-party repositories must be added to the package manager repository database before installing the NVIDIA driver RPM packages, or missing dependencies will prevent the installation from proceeding.

      To enable EPEL:

      sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
      
    • Enable optional repos:

      On RHEL 9 Linux only, execute the following steps to enable optional repositories.

      • On x86_64 systems:

        subscription-manager repos --enable=rhel-9-for-x86_64-appstream-rpms
        subscription-manager repos --enable=rhel-9-for-x86_64-baseos-rpms
        subscription-manager repos --enable=codeready-builder-for-rhel-9-x86_64-rpms
        

      On RHEL 8 Linux only, execute the following steps to enable optional repositories.

      • On x86_64 systems:

        subscription-manager repos --enable=rhel-8-for-x86_64-appstream-rpms
        subscription-manager repos --enable=rhel-8-for-x86_64-baseos-rpms
        subscription-manager repos --enable=codeready-builder-for-rhel-8-x86_64-rpms
        
  4. Choose an installation method: Local Repo Installation for RHEL / Rocky or Network Repo Installation for RHEL / Rocky.

5.2. Local Repo Installation for RHEL / Rocky

  1. Install local repository on file system:

    sudo rpm --install nvidia-driver-local-repo-<distro>X.<version>*.<arch>.rpm
    

5.3. Network Repo Installation for RHEL / Rocky

  1. Enable the network repo:

    sudo dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/$distro/$arch/cuda-$distro.repo
    

    where $distro/$arch should be replaced by one of the following:

    • rhel8/cross-linux-sbsa

    • rhel8/sbsa

    • rhel8/x86_64

    • rhel9/cross-linux-sbsa

    • rhel9/sbsa

    • rhel9/x86_64

  2. Clean DNF repository cache:

    sudo dnf clean expire-cache
    

5.4. NVIDIA Driver Installation for RHEL / Rocky

These instructions apply to both local and network installation.

Module Streams

sudo dnf module install nvidia-driver:<stream>/<profile>

5.5. Open Kernel Modules

sudo dnf module install nvidia-driver:open-dkms

where profile by default is default and does not need to be specified.

  • Example dkms streams: 560-open or open-dkms

5.6. Proprietary Kernel Modules

sudo dnf module install nvidia-driver:latest-dkms

where profile by default is default and does not need to be specified.

  • Example dkms streams: 560-dkms or latest-dkms

  • Example precompiled streams: 560 or latest

Note

Precompiled streams are only supported on RHEL8 x86_64 and RHEL9 x86_64.

5.7. Advanced Instructions for RHEL / Rocky

Compute only (headless) and desktop only (no compute) installation

It’s possible to install the driver without all the desktop components (GL, EGL, Vulkan, X drivers, and so on) to limit the footprint and dependencies on the system. With the same logic it’s possible to install a desktop system without any compute component.

5.8. Compute only system:

Open Kernel Modules

sudo dnf install nvidia-driver-cuda kmod-nvidia-open-dkms

Proprietary Kernel Modules

sudo dnf install nvidia-driver-cuda kmod-nvidia-latest-dkms

5.8.1. Desktop only system

Open Kernel Modules

sudo dnf install nvidia-driver kmod-nvidia-open-dkms

Proprietary Kernel Modules

sudo dnf install nvidia-driver kmod-nvidia-latest-dkms

Note

The component excluded at installation time can always be added at a later stage. This will pull in all the additional dependencies required.

5.9. Reboot the system:

  1. sudo reboot
    
  2. Perform the Post-installation Actions.

6. KylinOS

6.1. Prepare KylinOS

  1. Perform the Pre-installation Actions.

  2. The kernel headers and development packages for the currently running kernel can be installed with:

    sudo dnf install kernel-devel-$(uname -r) kernel-headers-$(uname -r)
    
  3. Choose an installation method: local repo or network repo.

6.2. Local Repo Installation for KylinOS

  1. Install local repository on file system:

    sudo rpm --install nvidia-driver-local-repo-kylin10-X.<version>*.<arch>.rpm
    

6.3. Network Repo Installation for KylinOS

  1. Enable the network repo:

    sudo dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/kylin10/x86_64/cuda-$distro.repo
    
  2. Clean DNF repository cache:

    sudo dnf clean expire-cache
    

6.4. NVIDIA Driver Installation for KylinOS

These instructions apply to both local and network installation.

Module Streams:

sudo dnf module install nvidia-driver:<stream>/<profile>

Open Kernel Modules

sudo dnf module install nvidia-driver:open-dkms

Proprietary Kernel Modules

sudo dnf module install nvidia-driver:latest-dkms

6.5. Advanced Instructions for KylinOS

Compute only (headless) and desktop only (no compute) installation

It’s possible to install the driver without all the desktop components (GL, EGL, Vulkan, X drivers, and so on) to limit the footprint and dependencies on the system. With the same logic it’s possible to install a desktop system without any compute component.

6.5.1. Compute only system:

Open Kernel Modules

sudo dnf install nvidia-driver-cuda kmod-nvidia-open-dkms

Proprietary Kernel Modules

sudo dnf install nvidia-driver-cuda kmod-nvidia-latest-dkms

6.5.2. Desktop only system:

Open Kernel Modules

sudo dnf install nvidia-driver kmod-nvidia-open-dkms

Proprietary Kernel Modules

sudo dnf install nvidia-driver kmod-nvidia-latest-dkms

Note

The component excluded at installation time can always be added a later stage. This will pull in all the additional dependencies required.

6.6. Reboot the system:

  1. sudo reboot
    
  2. Perform the Post-installation Actions.

7. Fedora

7.1. Prepare Fedora

  1. Perform the Pre-installation Actions.

  2. The kernel headers and development packages for the currently running kernel can be installed with:

    sudo dnf install kernel-devel-$(uname -r) kernel-headers-$(uname -r)
    
  3. Choose an installation method: Local Repo Installation for Fedora or Network Repo Installation for Fedora.

7.2. Local Repo Installation for Fedora

  1. Install local repository on file system:

    sudo rpm --install nvidia-driver-local-repo-<distro>-X-Y-local-<version>*.x86_64.rpm
    

    where distro is fedora37 or fedora39, for example.

7.3. Network Repo Installation for Fedora

  1. Enable the network repo:

    sudo dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/$distro/x86_64/cuda-$distro.repo
    

    where $distro should be replaced by fedoraxx:

  2. Clean DNF repository cache:

    sudo dnf clean expire-cache
    

7.4. NVIDIA Driver Installation Instructions for Fedora

These instructions apply to both local and network installation for Fedora.

Module Streams:

sudo dnf module install nvidia-driver:<stream>/<profile>

Open Kernel Modules:

sudo dnf module install nvidia-driver:open-dkms

Proprietary Kernel Modules

sudo dnf module install nvidia-driver:latest-dkms

7.5. Advanced Instructions for Fedora

Compute only (headless) and desktop only (no compute) installation

It’s possible to install the driver without all the desktop components (GL, EGL, Vulkan, X drivers, and so on) to limit the footprint and dependencies on the system. With the same logic it’s possible to install a desktop system without any compute component.

7.5.1. Compute only system:

Open Kernel Modules

sudo dnf install nvidia-driver-cuda kmod-nvidia-open-dkms

Proprietary Kernel Modules

sudo dnf install nvidia-driver-cuda kmod-nvidia-latest-dkms

7.5.2. Desktop only system:

Open Kernel Modules

sudo dnf install nvidia-driver kmod-nvidia-open-dkms

Proprietary Kernel Modules

sudo dnf install nvidia-driver kmod-nvidia-latest-dkms

Note

The component excluded at installation time can always be added at a later stage. This will pull in all the additional dependencies required.

7.6. Reboot the system:

  1. sudo reboot
    
  2. Perform the Post-installation Actions.

8. SLES

8.1. Prepare SLES

  1. Perform the Pre-installation Actions.

  2. The kernel development packages for the currently running kernel can be installed with:

    sudo zypper install -y kernel-<variant>-devel=<version>
    

    Note

    <variant> may be: default, 64k, or azure.

    To run the above command, you will need the variant and version of the currently running kernel. Use the output of the uname command to determine the currently running kernel’s variant and version:

    $ uname -r
    3.16.6-2-default
    

    In the above example, the variant is default and version is 3.16.6-2.

    The kernel development packages for the default kernel variant can be installed with:

    sudo zypper install -y kernel-default-devel=$(uname -r | sed 's/\-default//')
    
  3. The kernel headers and development packages for the currently running kernel can be installed with:

    sudo zypper install -y kernel-<variant>-devel=<version>
    
  4. Add the user to the video group:

    sudo usermod -a -G video <username>
    
  5. Choose an installation method: Local Repo Installation for SLES or Network Repo Installation for SLES.

8.2. Local Repo Installation for SLES

  1. Install local repository on file system:

sudo rpm --install nvidia-driver-local-repo-sles15-X.<version>*.x86_64.rpm

8.3. Network Repo Installation for SLES

  1. Enable the network repo:

    sudo zypper addrepo https://developer.download.nvidia.com/compute/cuda/repos/$distro/$arch/cuda-$distro.repo
    

    where $distro/$arch should be replaced by one of the following:

    • sles15/cross-linux-sbsa

    • sles15/sbsa

    • sles15/x86_64

  2. Refresh Zypper repository cache:

    sudo SUSEConnect --product PackageHub/15/<architecture>
    sudo zypper refresh
    

8.4. NVIDIA Driver Installation for SLES

These instructions apply to both local and network installation for SLES.

Install NVIDIA Driver:

Open Kernel Modules

sudo zypper -v install nvidia-open

Note

The default kernel flavor is default.

On SLES 15 (x86_64), the azure kernel flavor is available:

sudo zypper -v install nvidia-open-azure

Note

The default kernel flavor is 64kb on SBSA.

On SLES 15 (sbsa), the 64kb kernel flavor is available. This is required for Grace-Hopper only.

sudo zypper -v install nvidia-open-64k

Proprietary Kernel Modules

sudo zypper -v install cuda-drivers

Note

The default kernel flavor is “default”.

On SLES 15 (x86_64), the azure kernel flavor is available:

sudo zypper -v install nvidia-driver-G06-kmp-azure
sudo zypper -v install cuda-drivers

Note

The default kernel flavor is 64kb on SBSA.

On SLES 15 (sbsa), the 64kb kernel flavor is available. This is required for Grace-Hopper only.

sudo zypper -v install nvidia-driver-G06-kmp-64kb
sudo zypper -v install cuda-drivers

On SLES 15 (sbsa), the default kernel flavor is available. This is required for non-Grace-Hopper.

sudo zypper -v install nvidia-driver-G06-kmp-default
sudo zypper -v install cuda-drivers

8.5. Reboot the system:

  1. sudo reboot
    
  2. Perform the Post-installation Actions.

9. OpenSUSE

9.1. Prepare OpenSUSE

  1. Perform the Pre-installation Actions.

  2. The kernel development packages for the currently running kernel can be installed with:

    sudo zypper install -y kernel-default-devel=<version>
    

    To run the above command, you will need the variant and version of the currently running kernel. Use the output of the uname command to determine the currently running kernel’s variant and version:

    $ uname -r
    3.16.6-2-default
    

    In the above example, the variant is default and version is 3.16.6-2.

    The kernel development packages for the default kernel variant can be installed with:

    sudo zypper install -y kernel-default-devel=$(uname -r | sed 's/\-default//')
    
  3. Add the user to the video group:

    sudo usermod -a -G video $USER
    
  4. Choose an installation method: Local Repo Installation for OpenSUSE or Network Repo Installation for OpenSUSE.

9.2. Local Repo Installation for OpenSUSE

  1. Install local repository on file system:

    sudo rpm --install nvidia-driver-local-repo-opensuse15-X.<version>.x86_64.rpm
    

9.3. Network Repo Installation for OpenSUSE

  1. Enable the network repo:

    sudo zypper addrepo https://developer.download.nvidia.com/compute/cuda/repos/opensuse15/x86_64/cuda-opensuse15.repo
    
  2. Refresh Zypper repository cache:

    sudo zypper refresh
    

9.4. NVIDIA Driver Installation for OpenSUSE

These instructions apply to both local and network installation for OpenSUSE.

Install NVIDIA Driver:

Open Kernel Modules

sudo zypper install nvidia-open

Proprietary Kernel Modules

sudo zypper install cuda-drivers

9.5. Reboot the system:

  1. sudo reboot
    
  2. Perform the Post-installation Actions.

10. Ubuntu

10.1. Prepare Ubuntu

  1. Perform the Pre-installation Actions.

  2. The kernel headers and development packages for the currently running kernel can be installed with:

    sudo apt-get install linux-headers-$(uname -r)
    
  3. Choose an installation method: Local Repo Installation for Ubuntu or Network Repo Installation for Ubuntu.

10.2. Local Repo Installation for Ubuntu

  1. Install local repository on file system:

    sudo dpkg -i nvidia-driver-local-repo-<distro>-X.<version>_<architecture>.deb
    
  2. Enroll ephemeral public GPG key:

    sudo cp /var/nvidia-driver-local-repo-<distro>-X.<version>/nvidia-driver-*-keyring.gpg /usr/share/keyrings/
    

10.3. Network Repo Installation for Ubuntu

  1. Install the new cuda-keyring package:

    wget https://developer.download.nvidia.com/compute/cuda/repos/$distro/$arch/cuda-keyring_1.1-1_all.deb
    

    where $distro/$arch should be replaced by one of the following:

    • ubuntu2004/sbsa

    • ubuntu2004/x86_64

    • ubuntu2204/sbsa

    • ubuntu2204/x86_64

    • ubuntu2404/sbsa

    • ubuntu2404/x86_64

    sudo dpkg -i cuda-keyring_1.1-1_all.deb
    
  2. Or if you are unable to install the cuda-keyring package, refer to CUDA Archive Keyring.

10.4. NVIDIA Driver Installation for Ubuntu

These instructions apply to both local and network installation for Ubuntu.

  1. Update the Apt repository cache:

    sudo apt-get update
    
  2. Install NVIDIA Driver:

    Open Kernel Modules

    sudo apt-get install nvidia-open
    

    Proprietary Kernel Modules

    sudo apt-get install cuda-drivers
    

10.5. Reboot the system

  1. sudo reboot
    
  2. Perform the Post-installation Actions.

11. Debian

11.1. Prepare Debian

  1. Perform the Pre-installation Actions.

  2. The kernel headers and development packages for the currently running kernel can be installed with:

    sudo apt-get install linux-headers-$(uname -r)
    
  3. Enable the contrib repository:

    sudo add-apt-repository contrib
    
  4. Choose an installation method: Local Repo Installation for Debian or Network Repo Installation for Debian.

11.1.1. Local Repo Installation for Debian

  1. Install local repository on file system:

    sudo dpkg -i nvidia-driver-local-repo-<distro>-X.<version>*_x86_64.deb
    
  2. Enroll ephemeral public GPG key:

    sudo cp /var/nvidia-driver-local-repo-<distro>-X.<version>/nvidia-driver-*-keyring.gpg /usr/share/keyrings/
    

11.2. Network Repo Installation for Debian

  1. Install the new cuda-keyring package:

    wget https://developer.download.nvidia.com/compute/cuda/repos/<distro>/<arch>/cuda-keyring_1.1-1_all.deb
    

    where $distro/$arch should be replaced by one of the following:

    • debian11/x86_64

    • debian12/x86_64

    sudo dpkg -i cuda-keyring_1.1-1_all.deb
    
  2. Or if you are unable to install the cuda-keyring package, refer to CUDA Archive Keyring.

11.3. NVIDIA Driver Installation for Debian

These instructions apply to both local and network installation for Debian.

  1. Update the Apt repository cache:

    sudo apt-get update
    

    Note

    If you are using Debian 11, you may instead need to run:

    sudo apt-get --allow-releaseinfo-change update
    
  2. Install NVIDIA Driver:

    Open Kernel Modules

    sudo apt-get -V install nvidia-open
    

    Proprietary Kernel Modules

    sudo apt-get -V install cuda-drivers
    

11.4. Reboot the system:

  1. sudo reboot
    
  2. Perform the Post-installation Actions.

12. Amazon Linux

12.1. Prepare Amazon Linux

  1. Perform the Pre-installation Actions.

  2. The kernel headers and development packages for the currently running kernel can be installed with:

    sudo dnf install kernel-devel-$(uname -r) kernel-headers-$(uname -r) kernel-modules-extra-$(uname -r)
    
  3. Choose an installation method: Local Repo Installation for Amazon Linux or Network Repo Installation for Amazon Linux.

12.2. Local Repo Installation for Amazon Linux

  1. Install local repository on file system:

    sudo rpm --install nvidia-driver-local-repo-amzn2023-X.<version>*.x86_64.rpm
    

12.3. Network Repo Installation for Amazon Linux

  1. Enable the network repository:

    sudo dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/amzn2023/x86_64/cuda-amzn2023.repo
    
  2. Clean DNF repository cache:

    sudo dnf clean expire-cache
    

12.4. NVIDIA Driver Installation for Amazon Linux

These instructions apply to both local and network installation for Amazon Linux.

  1. Install NVIDIA Driver:

    Open Kernel Modules

    sudo dnf module install nvidia-driver:open-dkms
    

    Proprietary Kernel Modules

    sudo dnf module install nvidia-driver:latest-dkms
    

12.5. Reboot the system:

  1. sudo reboot
    
  2. Perform the Post-installation Actions.

13. Azure Linux

13.1. Prepare Azure Linux

  1. Perform the Pre-installation Actions.

  2. The kernel headers and development packages for the currently running kernel can be installed with:

    sudo tdnf install kernel-devel-$(uname -r) kernel-headers-$(uname -r) kernel-modules-extra-$(uname -r)
    
  3. Choose an installation method: Local Repo Installation for Azure Linux or Network Repo Installation for Azure Linux.

13.2. Local Repo Installation for Azure Linux

  1. Install local repository on file system:

    sudo rpm --install nvidia-driver-local-repo-cm2-X.<version>*.x86_64.rpm
    

13.3. Network Repo Installation for Azure Linux

  1. Enable the network repository:

    sudo tdnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/cm2/x86_64/cuda-cm2.repo
    
  2. Clean TDNF repository cache:

    sudo tdnf clean expire-cache
    

13.4. NVIDIA Driver Installation for Azure Linux

These instructions apply to both local and network installation for Azure Linux.

  1. Enable Mariner extended repo:

    sudo tdnf install mariner-repos-extended
    
  2. Install NVIDIA Driver:

    sudo tdnf install nvidia-open
    

13.5. Reboot the system:

  1. sudo reboot
    
  2. Perform the Post-installation Actions.

14. Additional Package Manager Capabilities

Below are some additional capabilities of the package manager that users can take advantage of.

14.1. Meta Packages

Meta packages are RPM/Deb packages which contain no (or few) files but have multiple dependencies. They are used to install many CUDA packages when you may not know the details of the packages you want. The following table lists the meta packages.

Table 6 Kernel Modules Meta Packages

Meta Package

Purpose

nvidia-open

Installs all NVIDIA Open GPU kernel modules Driver packages. Handles upgrading to the next version of the Driver packages when they are released.

nvidia-open-560

Installs all NVIDIA Open GPU kernel modules Driver packages. Will not upgrade beyond the 560.xxx branch drivers.

cuda-drivers

Installs all NVIDIA proprietary kernel modules Driver packages. Handles upgrading to the next version of the Driver packages when they are released.

cuda-drivers-560

Installs all NVIDIA proprietary kernel modules Driver packages. Will not upgrade beyond the 560.xx branch drivers.

14.2. Optional 32-bit Packages for Linux x86_64 .deb/.rpm

These packages provide 32-bit driver libraries needed for things such as Steam (popular game app store/launcher), older video games, and some compute applications.

For Debian 11 and Debian 12:

sudo dpkg --add-architecture i386
sudo apt-get update
apt install nvidia-driver-libs:i386

For Ubuntu:

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libnvidia-compute-<branch>:i386 libnvidia-decode-<branch>:i386 \
 libnvidia-encode-<branch>:i386 libnvidia-extra-<branch>:i386 libnvidia-fbc1-<branch>:i386 \
 libnvidia-gl-<branch>:i386

Where <branch> is the driver version, for example 560.

For Amazon Linux, Fedora, KylinOS, RHEL, and Rocky Linux:

sudo dnf install nvidia-driver-cuda-libs.i686 \
 nvidia-driver-libs.i686 nvidia-driver-NVML.i686 libnvidia-fbc.i686 libnvidia-ml.i686

Note

There is no modularity profile support.

For openSUSE and SLES:

sudo zypper install nvidia-compute-G06-32bit nvidia-gl-G06-32bit nvidia-video-G06-32bit

14.3. Package Upgrades

The nvidia-open package points to the latest open GPU driver release available in the NVIDIA driver repository. When a new version is available, use the following commands to upgrade the driver:

sudo dnf module install nvidia-driver:open-dkms             # Amazon Linux, Fedora, KylinOS, RHEL, and Rocky Linux

sudo tdnf install nvidia-open                               # Azure Linux

sudo zypper install nvidia-open                             # OpenSUSE and SLES

sudo apt-get install nvidia-open                            # Ubuntu and Debian

The cuda-drivers package points to the latest proprietary kernel modules release available in the NVIDIA driver repository. When a new version is available, use the following commands to upgrade the driver:

sudo dnf module install nvidia-driver:latest-dkms            # Amazon Linux, Fedora, KylinOS, RHEL, and Rocky Linux

sudo zypper install cuda-drivers                             # OpenSUSE and SLES

sudo apt-get install cuda-drivers                            # Ubuntu and Debian

Some desktop environments, such as GNOME or KDE, will display a notification alert when new packages are available.

15. Precompiled Streams

Precompiled streams offer an optional method of streamlining the installation process.

The advantages of precompiled streams:

  • Precompiled: faster boot up after driver and/or kernel updates

  • Pre-tested: kernel and driver combination has been validated

  • Removes gcc dependency: no compiler installation required

  • Removes dkms dependency: enabling EPEL repository not required

  • Removes kernel-devel and kernel-headers dependencies: no black screen if matching packages are missing

When using precompiled drivers, a plugin for the dnf package manager is enabled that cleans up stale .ko files. To prevent system breakages, the NVIDIA dnf plugin also prevents upgrading to a kernel for which no precompiled driver yet exists. This can delay the application of security fixes but ensures that a tested kernel and driver combination is always used. A warning is displayed by dnf during that upgrade situation:

NOTE:  Skipping kernel installation since no NVIDIA driver kernel module package
 kmod-nvidia-${driver}-${kernel} ... could be found

Packaging templates and instructions are provided on GitHub to allow you to maintain your own precompiled kernel module packages for custom kernels and derivative Linux distros: NVIDIA/yum-packaging-precompiled-kmod

To use the new driver packages on RHEL 8 or RHEL 9:

  1. First, ensure that the Red Hat repositories are enabled:

    RHEL 8:

    subscription-manager repos --enable=rhel-8-for-x86_64-appstream-rpms
    subscription-manager repos --enable=rhel-8-for-x86_64-baseos-rpms
    

    or

    RHEL 9:

    subscription-manager repos --enable=rhel-9-for-x86_64-appstream-rpms
    subscription-manager repos --enable=rhel-9-for-x86_64-baseos-rpms
    
  2. Choose one of the four options below depending on the desired driver:

    • latest always updates to the highest versioned driver (precompiled):

      sudo dnf module install nvidia-driver:latest
      
    • <id> locks the driver updates to the specified driver branch (precompiled):

      sudo dnf module install nvidia-driver:<id>
      

      Note

      Replace <id> with the appropriate driver branch streams, for example 520, 515, 470, or 450.

    • latest-dkms always updates to the highest versioned driver (non-precompiled):

      sudo dnf module install nvidia-driver:latest-dkms
      

      Note

      This is the default stream.

    • <id>-dkms locks the driver updates to the specified driver branch (non-precompiled):

      sudo dnf module install nvidia-driver:<id>-dkms
      

      Note

      Valid streams include 560-dkms, 550-dkms, 535-dkms, and 470-dkms.

15.1. Precompiled Streams Support Matrix

This table shows the supported precompiled, legacy, and open DKMS streams for each driver.

Table 7 Streams Support Matrix

NVIDIA Driver

Precompiled Stream

Legacy DKMS Stream

Open DKMS Stream

Highest version

latest

latest-dkms

open-dkms

Locked at 560.x

560

560-dkms

560-open

Locked at 515.x

515

515-dkms

515-open

Prior to switching between module streams, first reset:

sudo dnf module reset nvidia-driver

Note

This is also required for upgrading between branch locked streams.

Or alternatively:

sudo dnf module switch-to nvidia-driver:<stream>

15.2. Modularity Profiles

Modularity profiles work with any supported modularity stream and allow for additional use cases. These modularity profiles are available on Amazon 2023, Fedora, KylinOS, and RHEL8+..

Table 8 Modularity Profiles

Stream

Profile

Use Case

Default

/default

Installs all the driver packages in a stream.

Kickstart

/ks

Performs unattended Linux OS installation using a config file.

NVSwitch Fabric

/fm

Installs all the driver packages plus components required for bootstrapping an NVSwitch system (including the Fabric Manager and NSCQ telemetry).

Source

/src

Source headers for compilation (precompiled streams only).

For example:

sudo dnf module nvidia-driver:<stream>/default
sudo dnf module nvidia-driver:<stream>/ks
sudo dnf module nvidia-driver:<stream>/fm
sudo dnf module nvidia-driver:<stream>/src

You can install multiple modularity profiles using BASH curly brace expansion, for example:

sudo dnf module install nvidia-driver:latest/{default,src}

Refer to https://developer.nvidia.com/blog/streamlining-nvidia-driver-deployment-on-rhel-8-with-modularity-streams in the Developer Blog and https://developer.download.nvidia.com/compute/cuda/repos/rhel8/x86_64/precompiled/ for more information.

16. Kickstart Installation

16.1. RHEL 8 / Rocky Linux 8 Kickstart Installation

  1. Enable the EPEL repository:

    repo --name=epel --baseurl=http://download.fedoraproject.org/pub/epel/8/Everything/x86_64/
    
  2. Enable the CUDA repository:

    repo --name=cuda-rhel8 --baseurl=https://developer.download.nvidia.com/compute/cuda/repos/rhel8/x86_64/
    
  3. In the packages section of the ks.cfg file, make sure you are using the /ks profile and :open-dkms stream:

    @nvidia-driver:open-dkms/ks
    
  4. Perform the Post-installation Actions.

16.2. RHEL 9 / Rocky Linux 9 Kickstart Installation

  1. Enable the EPEL repository:

    repo --name=epel --baseurl=http://download.fedoraproject.org/pub/epel/9/Everything/x86_64/
    
  2. Enable the CUDA repository:

    repo --name=cuda-rhel9 --baseurl=https://developer.download.nvidia.com/compute/cuda/repos/rhel9/x86_64/
    
  3. In the packages section of the ks.cfg file, make sure you are using the /ks profile and :open-dkms stream:

    @nvidia-driver:open-dkms/ks
    
  4. Perform the Post-installation Actions.

17. Optional Components

17.1. GPUDirect Storage

Install NVIDIA Filesystem.

RHEL:

sudo dnf install nvidia-fs

Note

Precompiled streams may require addition of source module profile.

sudo dnf module install nvidia-driver:$stream/src

Ubuntu:

sudo apt-get install nvidia-fs

17.2. NVSwitch

To install Fabric Manager, NSCQ, NVSDM, IMEX:

RHEL:

sudo dnf module install nvidia-driver:$stream/fm

Ubuntu:

sudo apt-get install -V nvidia-fabric-manager-XXX libnvidia-nscq-XXX libnvsdm-XXX nvidia-imex-XXX

18. Tarball and Zip Archive Deliverables

In an effort to meet the needs of a growing customer base requiring alternative installer packaging formats, as well as a means of input into community CI/CD systems, tarball and zip archives are available for each component.

These tarball and zip archives, known as binary archives, are provided at https://developer.download.nvidia.com/compute/nvidia-driver/redist/.

_images/tarball-archives.png

These component .tar.xz and .zip binary archives do not replace existing packages such as .deb, .rpm, runfile, conda, etc. and are not meant for general consumption, as they are not installers. However this standardized approach will replace existing .txz archives.

For each release, a JSON manifest is provided such as redistrib_550.90.07.json, which corresponds to the Datacenter Driver release label which includes the release date, the name of each component, license name, relative URL for each platform and checksums.

Package maintainers are advised to check the provided LICENSE for each component prior to redistribution. Instructions for developers using CMake and Bazel build systems are provided in the next sections.

19. Post-installation Actions

The post-installation actions must be manually performed.

19.1. Install Persistence Daemon

NVIDIA is providing a user-space daemon on Linux to support persistence of driver state across CUDA job runs. The daemon approach provides a more elegant and robust solution to this problem than persistence mode. For more details on the NVIDIA Persistence Daemon, see the documentation here.

The NVIDIA Persistence Daemon can be started as the root user by running:

systemctl start persistenced

This command should be run on boot. Consult your Linux distribution’s init documentation for details on how to automate this.

19.2. Verify the Driver Version

If you installed the driver, verify that the correct version of it is loaded.

When the driver is loaded, the driver version can be found by executing the command

cat /proc/driver/nvidia/version

Note that this command will not work on an iGPU/dGPU system.

19.2.1. Local Repo Removal

Removal of the local repo installer is recommended after installation of NVIDIA driver.

Amazon Linux / Fedora / KylinOS / RHEL / Rocky Linux

sudo dnf remove "nvidia-driver-local-repo-<distro>*"

Azure Linux

sudo tdnf remove "nvidia-driver-local-repo-<distro>*"

Ubuntu and Debian

sudo apt-get remove --purge "nvidia-driver-local-repo-<distro>*"

openSUSE 15 and SLES 15

sudo zypper remove "nvidia-driver-local-repo-<distro>*"

20. Advanced Setup

This section contains information on some advanced setup scenarios which are not covered in the basic instructions above.

Table 9 Advanced Setup Scenarios

Scenario

Instructions

Extract the contents of the installers.

RPM

The RPM packages can be extracted by running:

rpm2cpio package.rpm | cpio -idmv

Deb

The Deb packages can be extracted by running:

dpkg-deb -x package.deb output_dir

Modify Ubuntu’s apt package manager to query specific architectures for specific repositories.

This is useful when a foreign architecture has been added, causing “404 Not Found” errors to appear when the repository meta-data is updated.

Each repository you wish to restrict to specific architectures must have its sources.list entry modified. This is done by modifying the /etc/apt/sources.list file and any files containing repositories you wish to restrict under the /etc/apt/sources.list.d/ directory. Normally, it is sufficient to modify only the entries in /etc/apt/sources.list

An architecture-restricted repository entry looks like:

deb [arch=<arch1>,<arch2>] <url>

For example, if you wanted to restrict a repository to only the amd64 and i386 architectures, it would look like:

deb [arch=amd64,i386] <url>

It is not necessary to restrict the deb-src repositories, as these repositories don’t provide architecture-specific packages.

For more details, see the sources.list manpage.

The nvidia.ko kernel module fails to load, saying some symbols are unknown.

For example:

nvidia: Unknown symbol drm_open (err 0)

Check to see if there are any optionally installable modules that might provide these symbols which are not currently installed.

For the example of the drm_open symbol, check to see if there are any packages which provide drm_open and are not already installed. For instance, on Ubuntu 14.04, the linux-image-extra package provides the DRM kernel module (which provides drm_open). This package is optional even though the kernel headers reflect the availability of DRM regardless of whether this package is installed or not.

In case of the error: E: Failed to fetch file:/var/cuda-repo File not found

Debian and Ubuntu

This can occur when installing CUDA after uninstalling a different version. Use the following command before installation:

sudo rm -v /var/lib/apt/lists/*cuda* /var/lib/apt/lists/*nvidia*

Verbose installation on Debian and Ubuntu

Use the --verbose-versions flag, for example:

sudo apt-get install --verbose-versions nvidia-open

21. Additional Considerations

Now that you have CUDA-capable hardware and the NVIDIA driver installed, you can examine and enjoy the numerous included programs. To install the CUDA Toolkit, consult the CUDA Installation Guide, located in https://docs.nvidia.com/cuda/cuda-installation-guide-linux/.

For technical support on installation questions, consult and participate in the developer forums at https://forums.developer.nvidia.com/c/gpu-graphics/linux/148.

22. Switching between Driver Module Flavors

Use the following steps to switch between the NVIDIA driver proprietary and open module flavors on your system.

Note

Replace XXX with the NVIDIA driver branch number such as 560.

Amazon Linux, Fedora, KylinOS, RHEL, and Rocky Linux

To switch between proprietary and open kernel modules:

sudo dnf -y module switch-to nvidia-driver:<stream> --allowerasing

Azure Linux

Only the open kernel modules are supported.

Ubuntu

To switch from proprietary to open:

sudo apt-get --purge remove cuda-drivers-XXX
sudo apt-get install --verbose-versions nvidia-open-XXX

To switch from open to proprietary:

sudo apt-get remove --purge nvidia-kernel-source-XXX-open
sudo apt-get install  -V cuda-drivers-XXX

Debian

To switch from proprietary to open:

sudo apt-get --purge remove cuda-drivers-XXX
sudo apt-get install --verbose-versions nvidia-open-XXX

To switch from open to proprietary:

sudo apt-get remove --purge nvidia-open-XXX
sudo apt-get install --verbose-versions cuda-drivers-XXX

OpenSUSE and SLES

To switch from proprietary to open:

sudo zypper remove cuda-drivers-XXX
sudo zypper install --details nvidia-open-XXX

To switch from open to proprietary:

sudo zypper remove nvidia-open-XXX
sudo zypper install --details cuda-drivers-XXX

23. Removing NVIDIA Driver

Follow the below steps to properly uninstall NVIDIA Drivers from your system. These steps will ensure that the uninstallation will be clean.

Amazon Linux, Fedora, KylinOS, RHEL, and Rocky Linux

To remove NVIDIA Drivers:

sudo dnf module remove --all nvidia-driver

To reset the module stream:

sudo dnf module reset nvidia-driver

Azure Linux

To remove NVIDIA Drivers:

sudo tdnf remove "nvidia*"

To clean up the uninstall:

sudo tdnf autoremove

OpenSUSE and SLES

To remove NVIDIA Drivers:

sudo zypper remove "nvidia*G06*"

Ubuntu and Debian

To remove NVIDIA Drivers:

sudo apt-get remove --purge -V remove "nvidia-driver*" "libxnvctrl*"

To clean up the uninstall:

sudo apt-get autoremove --purge -V

24. Frequently Asked Questions

24.1. Why do I see multiple “404 Not Found” errors when updating my repository meta-data on Ubuntu?

These errors occur after adding a foreign architecture because apt is attempting to query for each architecture within each repository listed in the system’s sources.list file. Repositories that do not host packages for the newly added architecture will present this error. While noisy, the error itself does no harm. Please see the Advanced Setup section for details on how to modify your sources.list file to prevent these errors.

24.2. How can I tell X to ignore a GPU for compute-only use?

To make sure X doesn’t use a certain GPU for display, you need to specify which other GPU to use for display. For more information, please refer to the “Use a specific GPU for rendering the display” scenario in the Advanced Setup section.

24.3. Why doesn’t the cuda-keyring package install the NVIDIA Drivers?

When using RPM or Deb, the downloaded package is a repository package. Such a package only informs the package manager where to find the actual installation packages, but will not install them.

See the Package Manager Installation section for more details.

24.4. What do I do if the display does not load, or CUDA does not work, after performing a system update?

System updates may include an updated Linux kernel. In many cases, a new Linux kernel will be installed without properly updating the required Linux kernel headers and development packages. To ensure the CUDA driver continues to work when performing a system update, rerun the commands in the Kernel Headers and Development Packages section.

Additionally, on Fedora, the Akmods framework will sometimes fail to correctly rebuild the NVIDIA kernel module packages when a new Linux kernel is installed. When this happens, it is usually sufficient to invoke Akmods manually and regenerate the module mapping files by running the following commands in a virtual console, and then rebooting:

sudo akmods --force
sudo depmod

You can reach a virtual console by hitting ctrl+alt+f2 at the same time.

24.5. How do I install a CUDA driver with a version less than 367 using a network repo?

To install a CUDA driver at a version earlier than 367 using a network repo, the required packages will need to be explicitly installed at the desired version. For example, to install 352.99, instead of installing the cuda-drivers metapackage at version 352.99, you will need to install all required packages of cuda-drivers at version 352.99.

24.6. Why does the installation on SUSE install the Mesa-dri-nouveau dependency?

This dependency comes from the SUSE repositories and shouldn’t affect the use of the NVIDIA driver or the CUDA Toolkit. To disable this dependency, you can lock that package with the following command:

sudo zypper al Mesa-dri-nouveau

24.7. How do I handle “Errors were encountered while processing: glx-diversions”?

This sometimes occurs when trying to uninstall CUDA after a clean .deb installation. Run the following commands:

sudo apt-get install glx-diversions --reinstall
sudo apt-get remove nvidia-alternative

Then re-run the commands from Removing CUDA Toolkit and Driver.

25. Notices

25.1. Notice

This document is provided for information purposes only and shall not be regarded as a warranty of a certain functionality, condition, or quality of a product. NVIDIA Corporation (“NVIDIA”) makes no representations or warranties, expressed or implied, as to the accuracy or completeness of the information contained in this document and assumes no responsibility for any errors contained herein. NVIDIA shall have no liability for the consequences or use of such information or for any infringement of patents or other rights of third parties that may result from its use. This document is not a commitment to develop, release, or deliver any Material (defined below), code, or functionality.

NVIDIA reserves the right to make corrections, modifications, enhancements, improvements, and any other changes to this document, at any time without notice.

Customer should obtain the latest relevant information before placing orders and should verify that such information is current and complete.

NVIDIA products are sold subject to the NVIDIA standard terms and conditions of sale supplied at the time of order acknowledgement, unless otherwise agreed in an individual sales agreement signed by authorized representatives of NVIDIA and customer (“Terms of Sale”). NVIDIA hereby expressly objects to applying any customer general terms and conditions with regards to the purchase of the NVIDIA product referenced in this document. No contractual obligations are formed either directly or indirectly by this document.

NVIDIA products are not designed, authorized, or warranted to be suitable for use in medical, military, aircraft, space, or life support equipment, nor in applications where failure or malfunction of the NVIDIA product can reasonably be expected to result in personal injury, death, or property or environmental damage. NVIDIA accepts no liability for inclusion and/or use of NVIDIA products in such equipment or applications and therefore such inclusion and/or use is at customer’s own risk.

NVIDIA makes no representation or warranty that products based on this document will be suitable for any specified use. Testing of all parameters of each product is not necessarily performed by NVIDIA. It is customer’s sole responsibility to evaluate and determine the applicability of any information contained in this document, ensure the product is suitable and fit for the application planned by customer, and perform the necessary testing for the application in order to avoid a default of the application or the product. Weaknesses in customer’s product designs may affect the quality and reliability of the NVIDIA product and may result in additional or different conditions and/or requirements beyond those contained in this document. NVIDIA accepts no liability related to any default, damage, costs, or problem which may be based on or attributable to: (i) the use of the NVIDIA product in any manner that is contrary to this document or (ii) customer product designs.

No license, either expressed or implied, is granted under any NVIDIA patent right, copyright, or other NVIDIA intellectual property right under this document. Information published by NVIDIA regarding third-party products or services does not constitute a license from NVIDIA to use such products or services or a warranty or endorsement thereof. Use of such information may require a license from a third party under the patents or other intellectual property rights of the third party, or a license from NVIDIA under the patents or other intellectual property rights of NVIDIA.

Reproduction of information in this document is permissible only if approved in advance by NVIDIA in writing, reproduced without alteration and in full compliance with all applicable export laws and regulations, and accompanied by all associated conditions, limitations, and notices.

THIS DOCUMENT AND ALL NVIDIA DESIGN SPECIFICATIONS, REFERENCE BOARDS, FILES, DRAWINGS, DIAGNOSTICS, LISTS, AND OTHER DOCUMENTS (TOGETHER AND SEPARATELY, “MATERIALS”) ARE BEING PROVIDED “AS IS.” NVIDIA MAKES NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL NVIDIA BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, PUNITIVE, OR CONSEQUENTIAL DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF ANY USE OF THIS DOCUMENT, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Notwithstanding any damages that customer might incur for any reason whatsoever, NVIDIA’s aggregate and cumulative liability towards customer for the products described herein shall be limited in accordance with the Terms of Sale for the product.

25.2. OpenCL

OpenCL is a trademark of Apple Inc. used under license to the Khronos Group Inc.

25.3. Trademarks

NVIDIA and the NVIDIA logo are trademarks or registered trademarks of NVIDIA Corporation in the U.S. and other countries. Other company and product names may be trademarks of the respective companies with which they are associated.