Go back

Fedora NVIDIA Driver Installation Guide

NVIDIA Driver Documentation:
https://docs.nvidia.com/datacenter/tesla/driver-installation-guide/index.html

This guide primarily focuses on Fedora. For other distributions, please refer to the official documentation.

This article is primarily based on Fedora 42.

Before getting started, there are several requirements for installing NVIDIA drivers on Linux.

Introduction

Linux System Requirements

To use NVIDIA drivers on your system, you need:

  • An NVIDIA GPU
  • A supported Linux version, compiler, and toolchain such as GCC

Also note that <distro> and <arch> mentioned in this section should be replaced with the values listed under the Codename and Architecture columns in the table below.

Support for each operating system continues until the standard EOSS/EOL date officially defined by that operating system.

Distribution Codename Architecture
amd64 systems (x86_66)
Red Hat Enterprise Linux 10 rhel10 x86_64
Red Hat Enterprise Linux 9 rhel9 x86_64
Red Hat Enterprise Linux 8 rhel8 x86_64
OpenSUSE Leap 15 SP6 opensuse15 x86_64
Rocky Linux 10 rhel10 x86_64
Rocky Linux 9 rhel9 x86_64
Rocky Linux 8 rhel8 x86_64
SUSE Linux Enterprise Server 15 SP6+ sles15 x86_64
Ubuntu 24.04 LTS ubuntu2404 amd64
Ubuntu 22.04 LTS ubuntu2204 amd64
Debian 12 debian12 amd64
Fedora 42 fedora42 x86_64
KylinOS V10 SP3 2403 kylin10 x86_64
Azure Linux 2.0 (CBL Mariner 2.0) cm2 x86_64
Azure Linux 3.0 azl3 x86_64
Amazon Linux 2023 amzn2023 x86_64
Oracle Linux 9 rhel9 x86_64
Oracle Linux 8 rhel8 x86_64
arm64 systems (sbsa)
Red Hat Enterprise Linux 10 rhel10 aarch64
Red Hat Enterprise Linux 9 rhel9 aarch64
Red Hat Enterprise Linux 8 rhel8 aarch64
SUSE Linux Enterprise Server 15 SP6+ sles15 aarch64
Kylin V10 SP3 2403 kylin10 aarch64
Ubuntu 24.04 LTS ubuntu2404 arm64
Ubuntu 22.04 LTS ubuntu2204 arm64
Azure Linux 3.0 azl3 aarch64
Amazon Linux 2023 amzn2023 aarch64

Commands that can be executed by a regular user are marked with $ at the beginning of the line.

Commands requiring administrative (root) privileges are marked with #.

The two sentences above describe the notation used in the original manual. In this article, commands that can be run by a regular user will not include any prefix. Commands that require root privileges will instead be written directly in a form that is easier to execute.

Many commands in this article may require superuser privileges.

On most Linux distributions, this requires logging in as root.

On systems with sudo enabled, add sudo before commands that require elevated privileges, or use sudo -i to enter a root shell.

Pre-installation Actions

Before installing the NVIDIA driver on Linux, complete the following steps:

  • Verify that the system is running a supported Linux version.
  • Verify that the appropriate kernel headers and development packages are installed.
  • Resolve any potentially conflicting installation methods.

Verify That You Are Using a Supported Linux Distribution

NVIDIA driver packages only support specific Linux distributions.

These distributions are listed in the NVIDIA driver release notes.

To check the current Linux distribution and version, run:

hostnamectl

Verify That the Correct Kernel Packages Are Installed

The NVIDIA driver requires kernel headers and development packages that match the currently running kernel version, both when the driver is initially installed and whenever the driver needs to be rebuilt later.

For example, if the system is running kernel version 3.17.4-301, the corresponding 3.17.4-301 kernel headers and development packages must also be installed.

Drivers installed through RPM or DEB packages may attempt to install the latest kernel headers and development packages if no related packages are detected.

However, the latest available package version may not match the kernel currently running on the system.

Therefore, the best practice is to manually ensure that the correct kernel headers and development packages are installed before installing the driver and whenever the kernel version changes.

To check the currently running kernel version:

sudo uname -r

Choose an Installation Method

The NVIDIA driver can be installed using distribution-specific packages such as RPM or Debian packages.

It can also be installed using the distribution-independent standalone runfile.

The distribution-independent package can be used across a wider range of Linux distributions, but it does not integrate with the distribution’s native package management system for updates.

Distribution-specific packages integrate with the package management system of the distribution and are recommended whenever possible.

When using an RPM or Debian local repository package, the downloaded package contains a repository snapshot on the local filesystem, such as under /var/.

These packages do not directly install the actual driver packages. Instead, they tell the package manager where to obtain them.

If an online network repository is enabled, RPM or Debian packages will automatically download the required packages through the system package manager, such as apt, dnf, tdnf, yum, or zypper.

Additional Information

If you do not need these details, you can skip the Additional Information section.

Driver Assistant

NVIDIA currently provides a script that detects the system and helps install the NVIDIA driver package best suited for the user’s hardware.

This tool is designed to help users determine which NVIDIA GPU driver should be installed based on the detected system hardware.

To install the driver assistant, use apt/dnf/tdnf/zypper to install the nvidia-driver-assistant package.

The table below describes the available flags.

Driver Assistant Flags

Flags Used Description
--install Install the recommended driver.
--branch [BRANCH] Specify an NVIDIA driver branch.
--list-supported-distros Print the list of supported Linux distributions.
--supported-gpus [SUPPORTED_GPUS] Use a different supported-gpus.json file.
--sys-path [SYS_PATH] Use a different /sys path. Commonly used for testing.
--os-release-path [OS_RELEASE_PATH] Use a different os-release file path. Commonly used for testing.
--distro [DISTRO] Specify the Linux distribution using DISTRO:VERSION or DISTRO. Commonly used for testing.
--module-flavor [MODULE_FLAVOR] Specify the kernel module type. Accepted values are open and closed. Commonly used for testing.
--verbose [Optional] Enable verbose output.

Example command output:

Command Output

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 install -y nvidia-open

Automatic Hardware Selection

Starting with version 560, the standalone NVIDIA driver runfile uses hardware detection to automatically select either the open-source GPU kernel modules or proprietary kernel modules based on the detected SKU.

The CUDA runfile bundles a complete NVIDIA driver runfile.

If the user chooses to install the driver through the ncurses interface or command line, which is the default option, it passes the --silent flag.

Therefore, by default, users installing through the CUDA runfile will receive the automatically detected kernel module type.

Override options are also available in the advanced options of the ncurses UI, or through the following flags:

--kernel-module-type=open
--kernel-module-type=proprietary

These options allow the user to manually choose between the open-source GPU kernel modules and proprietary kernel modules.

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 with the 515 driver series, two versions of the kernel modules are available:

  • Proprietary — This is the traditional version provided by NVIDIA. It is intended for older GPU architectures such as Maxwell, Pascal, and Volta. The open-source GPU kernel modules are not compatible with these platforms, so the proprietary modules must be used.
  • Open-source — Kernel modules released under the dual MIT/GPLv2 license. These are only supported on Turing and newer architectures. If your GPU uses one of these architectures, this is the version you should use.

Starting with the 560 driver series, the open-source kernel modules are the default installation option.

The open-source GPU kernel modules only support Turing and newer generations.

To verify that your NVIDIA GPU is at least Turing or newer:

lspci | grep VGA

Open GPU Kernel Module Installation

For simplicity, the package manager recommendations are summarized in the following table.

All distributions after version 570 use these packaging conventions.

The following commands install a complete driver package, including all desktop components as well as CUDA libraries and tools for compute workloads.

Table 6. Package Manager Installation Recommendations

Distribution Install Latest Version Install Specific Version
Red Hat Enterprise Linux 8/9, Rocky Linux 8/9

Oracle Linux 8/9, KylinOS 10, Amazon Linux 2023
sudo dnf module enable nvidia-driver:open-dkms

sudo dnf install nvidia-open
sudo dnf module enable nvidia-driver:580-open

sudo dnf install nvidia-open-580
Red Hat Enterprise Linux 10, Rocky Linux 10,

Fedora 42
sudo dnf install nvidia-open sudo dnf install nvidia-open-580
Azure Linux 2 / Azure Linux 3 sudo tdnf install nvidia-open sudo tdnf install nvidia-open-580
openSUSE Leap 15 sudo zypper install nvidia-open sudo zypper install nvidia-open-580
SUSE Linux Enterprise Server 15 (x86_64) sudo zypper install nvidia-open sudo zypper install nvidia-open-580
SUSE Linux Enterprise Server 15 (aarch64) sudo zypper install nvidia-open sudo zypper install nvidia-open-580
Debian 12 sudo apt install nvidia-open #sudo apt install nvidia-open-580
Ubuntu 22.04/24.04 sudo apt install nvidia-open sudo apt install nvidia-open-580

Proprietary GPU Kernel Module Installation

For simplicity, the package manager recommendations are summarized in the following table.

All distributions after version 570 use these packaging conventions.

The following commands install a complete driver package, including all desktop components as well as CUDA libraries and tools for compute workloads.

Table 7. Proprietary GPU Kernel Module Installation

Distribution Install Latest Version Install Specific Version
Red Hat Enterprise Linux 8/9, Rocky Linux 8/9

Oracle Linux 8/9, KylinOS 10, Amazon Linux 2023
sudo dnf module enable nvidia-driver:latest-dkms

sudo dnf install cuda-drivers
sudo dnf module enable nvidia-driver:580-dkms

sudo dnf install cuda-drivers-580
Red Hat Enterprise Linux 10, Rocky Linux 10,

Fedora 42
sudo dnf install cuda-drivers sudo dnf install cuda-drivers-580
Azure Linux 2 / Azure Linux 3 Only the open kernel modules are supported. Only the open kernel modules are supported.
openSUSE Leap 15 sudo zypper install cuda-drivers sudo zypper install cuda-drivers-580
SUSE Linux Enterprise Server 15 sudo zypper install cuda-drivers sudo zypper install cuda-drivers-580
Debian 12 sudo apt install cuda-drivers sudo apt install cuda-drivers-580
Ubuntu 22.04/24.04 sudo apt install cuda-drivers sudo apt install cuda-drivers-580

Fedora

Complete the Pre-installation Actions First

Install the kernel headers and development packages corresponding to the currently running kernel:

sudo dnf install kernel-devel-matched kernel-headers

This guide uses Network Repository Installation.

Run the following command.

For Fedora 42, replace $distro with fedora42 and $arch with x86_64.

For other distributions, refer to the table at the beginning of this article and substitute the corresponding values.

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

After running the command above, clean the DNF repository cache:

sudo dnf clean expire-cache

Driver Installation

Install the driver.

ⓘ Important

If you are using an RTX 20-series or GTX 16-series GPU (Turing or newer architecture), install the Open Kernel Modules. For older architectures such as Maxwell, Pascal, or Volta, install the Proprietary Kernel Modules.

Installing the wrong one can be troublesome.

Open Kernel Modules

sudo dnf install nvidia-open

Proprietary Kernel Modules

sudo dnf install cuda-drivers

After the installation is complete, perform the Post-installation Actions.

Post-installation Actions

Post-installation actions must be performed manually.

It is recommended to reboot the system before performing these steps.

Running them without rebooting first may result in errors.

Persistence Daemon

NVIDIA provides a user-space daemon service on Linux to maintain driver state between multiple CUDA workload runs.

Compared with persistence mode, the daemon provides a more elegant and robust solution to this problem.

For more information about the NVIDIA Persistence Daemon, see:

http://docs.nvidia.com/deploy/driver-persistence/index.html#persistence-daemon

All distribution packages include a systemd preset.

If the service is installed as a dependency of another driver component, it will be enabled automatically.

It can also be restarted manually with:

sudo systemctl restart nvidia-persistenced

Verify the Driver Version

If you installed the driver, verify that the correct version has been loaded.

When the driver is loaded, its version can be found with:

cat /proc/driver/nvidia/version

Remove the Local Repository

After the driver installation is complete, it is recommended to remove the local repository installer.

For Fedora 42, use:

sudo dnf remove nvidia-driver-local-repo\*

The NVIDIA driver installation is now complete.