Go back

Fedora CUDA Toolkit Installation Guide

Official documentation:

https://docs.nvidia.com/cuda/index.html

https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html

Alright, this can seem a little complicated.

First of all, to use CUDA, you need the CUDA Toolkit. To use the CUDA Toolkit, you need an NVIDIA driver.

NVIDIA does provide bundled packages containing both, but in general it is better to install them separately.

Therefore, this article focuses specifically on installing the CUDA Toolkit.

There are several things you need to be aware of.

They will be explained below in order.

This article uses Fedora 42 as the default environment.

Last updated: 2025-11-03

System Information

System Requirements

To use NVIDIA CUDA on your system, you need:

  • A CUDA-capable GPU
  • A supported Linux version with the GCC compiler and toolchain installed
  • The CUDA Toolkit

Please note that the original documentation uses the following notation:

  • Commands that can be executed by a regular user are prefixed with $.
  • Commands that require administrator (root) privileges are prefixed with #.

For convenience, this article replaces # directly with sudo, while commands prefixed with $ are shown without any prefix.

The CUDA development environment is closely integrated with the host development environment, including the host compiler and C runtime libraries.

Therefore, only distributions that have been validated for compatibility with the corresponding CUDA version are supported.

The table below lists the Linux distributions supported by CUDA 13.0 Update 2.

Note: The values shown in the Codename column and the architecture values in parentheses are represented as <distro> and <arch> in this article.

Distribution OS Version Kernel¹ Default GCC GLIBC
x86_64
RHEL 10.x (x = 0) 6.12.0-55 14.2.1 2.39
RHEL 9.x (x ≤ 6) 5.14.0-570.12.1 11.5.0 2.34
RHEL 8.x (x ≤ 10) 4.18.0-553 8.5.0 2.28
Rocky Linux 10.x (x = 0) 6.12.0-55.21.1 14.2.1 2.39
Rocky Linux 9.x (x ≤ 6) 5.14.0-570.19.1 11.5.0 2.34
Rocky Linux 8.x (x ≤ 10) 4.18.0-553 8.5.0 2.28
Oracle Linux 9 5.14.0-427 11.4.1 2.34
Oracle Linux 8 4.18.0-553 8.5.0 2.28
SUSE SLES 15.x (x = 6/7) 6.4.0-150600.21 7.5.0 2.38
Ubuntu 24.04.x LTS (x ≤ 3) 6.14.0-29 13.3.0 2.39
Ubuntu 22.04.x LTS (x ≤ 5) 6.5.0-45 12.3.0 2.35
Debian 12.x (x ≤ 12) 6.1.148-1 12.2.0 2.36
OpenSUSE Leap 15.x (x = 6) 6.4.0-150600.21 7.5.0 2.38
Fedora 42 6.14.0-63 15.1.1 2.41
KylinOS V10 SP3 2403 4.19.90-89.11.v2401 10.x 2.28
Amazon Linux 2023 AL2023 6.1.82-99.168 11.4.1 2.34
MSFT Azure Linux 3.0 6.6.64.2-9.azl3 11.2.0 2.38-8
MSFT Azure Linux 2.0 5.15.158.2-1 13.2.0 2.35
Generic amd64 systems (sbsa)
RHEL 10.x (x = 0) 6.12.0-55.7.1.el10_0 14.2.1 2.39
RHEL 9.x (x ≤ 6) 5.14.0-570.17.1 11.5.0 2.35 -2-63
RHEL 8.x (x ≤ 10) 4.18.0-553 8.5.0 2.28
Ubuntu 22.04.x LTS (x ≤ 5) 6.5.0-1019 11.4.0 2.35
Ubuntu 24.04.x LTS (x ≤ 3) 6.8.0-83-generic 13.3.0 2.39
SUSE SLES 15.x (x = 6/7) 6.4.0-150700.51 7.5.0 2.38
KylinOS V10 SP3 V10 SP3 2403 4.19.90-52 7.3.0 2.28
GRACE only arm64 systems (sbsa)
Amazon Linux 2023 AL2023 6.12.16-18 11.4.1 2.34
MSFT Azure Linux 3.0 6.6.64.2-9.azl3 13.2.0 2.38-8
Ubuntu 22.04.x LTS (x ≤ 5) 6.8.0-1030-nvidia-64k 11.4.0 2.35
Ubuntu 24.04.x LTS (x ≤ 3) 6.8.0-1031-nvidia-64k 13.2.0 2.39
RHEL 10.x (x = 0) 6.12.0-55.9.1.el10_0 14.2.1 2.39
RHEL 9.x (x = 4/5/6) 5.14.0-570.28.1.el9_6.aarch64+64k 11.5.0 2.34
SUSE SLES 15.x (x = 6/7) 6.4.0-150700.51 7.5.0 2.38
arm64 sbsa Jetson (dGPU + iGPU with OpenRM)
Ubuntu 24.04.x LTS Rel37 (JP7.x) native 6.8.12-tegra 13.3.0 2.39
Ubuntu 24.04.x LTS Rel37 (JP7.x) cross 6.11.0-28-generic 13.3.0 2.39

OS Support Policy

Each operating system is supported until its officially defined EOSS/EOL date.

Refer to the support lifecycle of each distribution for the relevant timeline and plan upgrades accordingly.

Host Compiler Support Policy

To compile the CPU-side “host” code in CUDA source files, the CUDA compiler NVCC requires a compatible host compiler.

NVCC checks the major version of the host compiler.

Newer minor versions generally work, but major versions outside the supported range are not supported.

Supported Compilers

Distribution GCC Clang NVHPC XLC ArmC/C++
x86_64 6.x – 15.x 7.x – 20.x 24.9–25.5 No No
Arm64 sbsa 6.x – 15.x 7.x – 20.x 24.9–25.5 No 24.04–24.10

Additional notes:

  • For GCC and Clang, the table above shows the minimum version and the latest supported version. If your distribution’s default compiler version is lower than required, upgrading the toolchain is recommended, such as using the Developer Toolset on RHEL.
  • Platforms whose default GCC version is earlier than GCC 6xx do not support linking against the static or dynamic libraries provided by the CUDA Toolkit.
  • Only libstdc++, the GCC implementation of the C++ standard library, is supported.

Host Compiler Compatibility Packages

Very new Linux distributions may ship with compiler versions newer than those listed in the supported compiler table.

Such distributions usually provide GCC compatibility packages that can be used by NVCC.

The exact implementation varies by distribution, but the general idea is the same: the NVCC_BIN environment variable is ultimately configured.

For details, refer to the NVCC documentation.

Supported C++ Dialects

NVCC and NVRTC (CUDA Runtime Compilation) support C++11, C++14, C++17, and C++20 when used with supported host compilers.

The default C++ dialect used by NVCC is determined by the default dialect of the host compiler.

Host compiler requirements for C++20 support, applying to both host and device code:

GCC Clang NVHPC Arm C/C++
>=10.x >=11.x >=22.x >=22.x

Installation

Notes

There is one important thing to explain here.

CUDA must be used with a compatible NVIDIA driver, but one NVIDIA driver can support multiple CUDA Toolkit versions.

Before CUDA 13.0, the CUDA package also included an NVIDIA display driver for convenience.

However, this bundled driver was intended for development purposes only.

NVIDIA does not recommend using the bundled driver in production environments, especially with Tesla GPUs.

During CUDA Toolkit installation, users can also choose to skip driver installation:

  • On Windows: through interactive or silent installation options.
  • On Linux: by using a meta package that excludes the driver.

In simple terms, installing the complete CUDA package includes both:

NVIDIA Driver + CUDA Toolkit

However, since we have already installed the NVIDIA driver separately, we only need to install the CUDA Toolkit here.

ⓘ Important

Please note: It is recommended to install the NVIDIA driver and CUDA Toolkit separately instead of using the bundled package.

Alright, here is how it works.

First, run:

nvidia-smi

You should see output similar to:

+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 581.15                 Driver Version: 581.15         CUDA Version: 13.0     |
+-----------------------------------------+------------------------+----------------------+

You can see both Driver Version and CUDA Version.

The CUDA Version shown here indicates the highest CUDA Toolkit version supported by the currently installed driver.

Refer to Table 1 for details.

In other words, if your driver version is between 525 and 580, you can use CUDA Toolkit 12.x.

In addition, CUDA drivers are backward compatible. This means that applications compiled for a particular CUDA version can continue to run on later, newer driver versions.

In other words, you can also use CUDA Toolkit 11.x.

However, this compatibility does not work in the other direction, so you cannot install CUDA Toolkit 13.x with such a driver.

Table 2 shows the driver version bundled with each complete CUDA package.

We can also use this table as a more detailed reference for matching driver versions to CUDA Toolkit versions.

For example, if your driver version is:

560.35.03

then you can install:

CUDA 12.6 Update 2

or another compatible CUDA 12.x version.

That is roughly how the version relationship works.

Table 1: Minimum Driver Versions Required for CUDA Toolkit Minor Version Compatibility

CTK Version Driver Range for Minor Version Compatibility
Minimum (Min) Maximum (Max)
13.x >= 580 N/A
12.x >= 525 < 580
11.x >= 450 < 525

Table 2: CUDA Toolkit and Corresponding Driver Versions

CUDA Toolkit Linux x86_64 Driver Version Windows x86_64 Driver Version
CUDA 13.0 Update 2 >=580.95.05 N/A
CUDA 13.0 Update 1 >=580.82.07 N/A
CUDA 13.0 GA >=580.65.06 N/A
CUDA 12.9 Update 1 >=575.57.08 >=576.57
CUDA 12.9 GA >=575.51.03 >=576.02
CUDA 12.8 Update 1 >=570.124.06 >=572.61
CUDA 12.8 GA >=570.26 >=570.65
CUDA 12.6 Update 3 >=560.35.05 >=561.17
CUDA 12.6 Update 2 >=560.35.03 >=560.94
CUDA 12.6 Update 1 >=560.35.03 >=560.94
CUDA 12.6 GA >=560.28.03 >=560.76
CUDA 12.5 Update 1 >=555.42.06 >=555.85
CUDA 12.5 GA >=555.42.02 >=555.85
CUDA 12.4 Update 1 >=550.54.15 >=551.78
CUDA 12.4 GA >=550.54.14 >=551.61
CUDA 12.3 Update 1 >=545.23.08 >=546.12
CUDA 12.3 GA >=545.23.06 >=545.84
CUDA 12.2 Update 2 >=535.104.05 >=537.13
CUDA 12.2 Update 1 >=535.86.09 >=536.67
CUDA 12.2 GA >=535.54.03 >=536.25
CUDA 12.1 Update 1 >=530.30.02 >=531.14
CUDA 12.1 GA >=530.30.02 >=531.14
CUDA 12.0 Update 1 >=525.85.12 >=528.33
CUDA 12.0 GA >=525.60.13 >=527.41
CUDA 11.8 GA >=520.61.05 >=520.06
CUDA 11.7 Update 1 >=515.48.07 >=516.31
CUDA 11.7 GA >=515.43.04 >=516.01
CUDA 11.6 Update 2 >=510.47.03 >=511.65
CUDA 11.6 Update 1 >=510.47.03 >=511.65
CUDA 11.6 GA >=510.39.01 >=511.23
CUDA 11.5 Update 2 >=495.29.05 >=496.13
CUDA 11.5 Update 1 >=495.29.05 >=496.13
CUDA 11.5 GA >=495.29.05 >=496.04
CUDA 11.4 Update 4 >=470.82.01 >=472.50
CUDA 11.4 Update 3 >=470.82.01 >=472.50
CUDA 11.4 Update 2 >=470.57.02 >=471.41
CUDA 11.4 Update 1 >=470.57.02 >=471.41
CUDA 11.4.0 GA >=470.42.01 >=471.11
CUDA 11.3.1 Update 1 >=465.19.01 >=465.89
CUDA 11.3.0 GA >=465.19.01 >=465.89
CUDA 11.2.2 Update 2 >=460.32.03 >=461.33
CUDA 11.2.1 Update 1 >=460.32.03 >=461.09
CUDA 11.2.0 GA >=460.27.03 >=460.82
CUDA 11.1.1 Update 1 >=455.32 >=456.81
CUDA 11.1 GA >=455.23 >=456.38
CUDA 11.0.3 Update 1 >= 450.51.06 >= 451.82
CUDA 11.0.2 GA >= 450.51.05 >= 451.48
CUDA 11.0.1 RC >= 450.36.06 >= 451.22
CUDA 10.2.89 >= 440.33 >= 441.22
CUDA 10.1 (10.1.105 general release, and updates) >= 418.39 >= 418.96
CUDA 10.0.130 >= 410.48 >= 411.31
CUDA 9.2 (9.2.148 Update 1) >= 396.37 >= 398.26
CUDA 9.2 (9.2.88) >= 396.26 >= 397.44
CUDA 9.1 (9.1.85) >= 390.46 >= 391.29
CUDA 9.0 (9.0.76) >= 384.81 >= 385.54
CUDA 8.0 (8.0.61 GA2) >= 375.26 >= 376.51
CUDA 8.0 (8.0.44) >= 367.48 >= 369.30
CUDA 7.5 (7.5.16) >= 352.31 >= 353.66
CUDA 7.0 (7.0.28) >= 346.46 >= 347.62

Pre-installation Preparation

Before installing the CUDA Toolkit on Linux, complete the following steps:

  1. Verify that the GPU is CUDA-capable.
  2. Verify that the operating system version is supported.
  3. Verify that GCC is installed.
  4. Download the NVIDIA CUDA Toolkit.
  5. Resolve any potentially conflicting installation methods.

Verify CUDA-Capable GPU

You can check the GPU through the system information panel in your desktop environment, or run:

lspci | grep -i nvidia

If the GPU is not detected, update the PCI hardware database maintained by Linux and try again:

sudo update-pciids
lspci | grep -i nvidia

Verify Supported Linux

CUDA development tools only support specific Linux distributions.

To check the currently installed distribution and version:

hostnamectl

Verify GCC

Compiling CUDA applications requires GCC.

Simply running CUDA applications does not necessarily require GCC.

For most supported distributions, the default GCC version is sufficient.

Check the installed GCC version with:

gcc --version

Choose an Installation Method

The CUDA Toolkit provides two main installation mechanisms:

  • Distribution-specific packages: RPM / DEB, integrated with the system package manager
  • Distribution-independent runfile: a standalone installer that is not managed by the system package manager

Whenever possible, using distribution-specific packages is recommended.

Install the CUDA Toolkit

In this guide, we will use network repository installation.

Run the following commands:

# Add the repository
sudo dnf config-manager addrepo --from-repofile https://developer.download.nvidia.com/compute/cuda/repos/fedora42/x86_64/cuda-fedora42.repo

# Clear the cache
sudo dnf clean all

# Install the CUDA Toolkit
sudo dnf -y install cuda-toolkit-13-0

# Reboot
reboot

The CUDA Toolkit installation is now complete.

Post-installation Actions

Several actions must be performed manually after installation.

These actions are divided into three categories:

  • Mandatory
  • Recommended
  • Optional

Mandatory Actions

Before the CUDA Toolkit can be used, the following post-installation steps must be completed.

Environment Setup

The CUDA bin directory must be added to the PATH environment variable.

First, check whether the symbolic links have been created:

ls -l /usr/local/ | grep cuda

If they have not been created:

sudo ln -s /usr/local/cuda-<version> /usr/local/cuda

Then create a script:

sudo nano /etc/profile.d/cuda.sh

Add the following content to configure PATH:

if [ -d "/usr/local/cuda/bin" ]; then
    export PATH=/usr/local/cuda/bin:${PATH:+:$PATH}
fi

Save the file.

Optional Actions

The following features are not required for using the CUDA Toolkit, but they can provide additional functionality.

Install Third-party Libraries

Some CUDA samples use third-party libraries that may not be installed by default.

During the build process, the samples attempt to detect the required libraries.

If a required library cannot be found, the corresponding sample will be skipped automatically and the missing package will be reported.

To build and run these samples, install the missing libraries first.

Fedora:

sudo dnf install freeglut-devel libX11-devel libXi-devel libXmu-devel make mesa-libGLU-devel freeimage-devel libglfw3-devel
Select the Active Version of CUDA

For applications that depend on the /usr/local/cuda and /usr/local/cuda-MAJOR symlinks, the alternatives mechanism can be used to switch between multiple installed CUDA versions.

Display the currently active CUDA version and all available versions:

update-alternatives --display cuda

Display the active minor version for a specific major version, such as CUDA 12:

update-alternatives --display cuda-12

Interactively select the active CUDA version:

sudo update-alternatives --config cuda

At this point, all installation and configuration steps are complete.