June 18, 2025

Fedora 42 -- CUDA toolkit from Nvidia

This site offers the 12.9 Update 1 downloads. I'll note up front that they only offer this for Fedora 41 and I have already read that it will want to use an older version of gcc (14 rather than 15). More on this below. I go there and select: Linux, x86_64, Fedora, 41 and "rpm local". This displays instructions.
To get the toolkit:
su
dnf update
cd Projects/Nvidia/Toolkit
wget https://developer.download.nvidia.com/compute/cuda/12.9.1/local_installers/cuda-repo-fedora41-12-9-local-12.9.1_575.57.08-1.x86_64.rpm
rpm -i cuda-repo-fedora41-12-9-local-12.9.1_575.57.08-1.x86_64.rpm
dnf clean all
dnf -y install cuda-toolkit-12-9
The first download is BIG, apparently 6G or so. I had expected just the files to add to dnf to allow subsequent downloads. I yields this:
-rw-r--r-- 1 root root 6763596418 May 31 15:09 cuda-repo-fedora41-12-9-local-12.9.1_575.57.08-1.x86_64.rpm
Perhaps it would be wiser to install it with dnf instead of rpm, but I just follow instructions. And I should have done a "dnf update" before all this, because the "clean all" tossed out some pending updates. I added that to the commands above. The toolkit install pulls in 66 packages:
[ 1/66] cuda-toolkit-12-9-0:12.9.1-1.x86_64                                                               100% | 884.8 KiB/s |   8.8 KiB |  00m00s
[ 2/66] cuda-compiler-12-9-0:12.9.1-1.x86_64                                                              100% | 460.8 KiB/s |   7.4 KiB |  00m00s
[ 3/66] cuda-documentation-12-9-0:12.9.88-1.x86_64                                                        100% |   5.1 MiB/s | 131.2 KiB |  00m00s
[ 4/66] cuda-libraries-12-9-0:12.9.1-1.x86_64                                                             100% | 765.4 KiB/s |   7.7 KiB |  00m00s
[ 5/66] cuda-libraries-devel-12-9-0:12.9.1-1.x86_64                                                       100% | 494.0 KiB/s |   7.9 KiB |  00m00s
[ 6/66] cuda-nvml-devel-12-9-0:12.9.79-1.x86_64                                                           100% |   7.9 MiB/s | 201.2 KiB |  00m00s
[ 7/66] cuda-tools-12-9-0:12.9.1-1.x86_64                                                                 100% | 607.9 KiB/s |   7.3 KiB |  00m00s
[ 8/66] cuda-cuobjdump-12-9-0:12.9.82-1.x86_64                                                            100% |  13.6 MiB/s | 277.9 KiB |  00m00s
[ 9/66] cuda-cuxxfilt-12-9-0:12.9.82-1.x86_64                                                             100% |  10.2 MiB/s | 282.8 KiB |  00m00s
[10/66] cuda-nvcc-12-9-0:12.9.86-1.x86_64                                                                 100% |  80.3 MiB/s | 111.3 MiB |  00m01s
[11/66] cuda-nvprune-12-9-0:12.9.82-1.x86_64                                                              100% |  83.6 KiB/s |  76.0 KiB |  00m01s
[12/66] cuda-cudart-12-9-0:12.9.79-1.x86_64                                                               100% | 246.2 KiB/s | 236.8 KiB |  00m01s
[13/66] cuda-nvrtc-12-9-0:12.9.86-1.x86_64                                                                100% |  22.4 MiB/s |  84.8 MiB |  00m04s
[14/66] cuda-opencl-12-9-0:12.9.19-1.x86_64                                                               100% |  10.1 KiB/s |  34.2 KiB |  00m03s
[15/66] libcublas-12-9-0:12.9.1.4-1.x86_64                                                                100% |  75.0 MiB/s | 555.4 MiB |  00m07s
[16/66] libcufft-12-9-0:11.4.1.4-1.x86_64                                                                 100% |  68.3 MiB/s | 191.7 MiB |  00m03s
[17/66] libcufile-12-9-0:1.14.1.1-1.x86_64                                                                100% | 632.2 KiB/s |   1.2 MiB |  00m02s
[18/66] libcurand-12-9-0:10.3.10.19-1.x86_64                                                              100% |  26.2 MiB/s |  63.9 MiB |  00m02s
[19/66] libcusolver-12-9-0:11.7.5.82-1.x86_64                                                             100% |  37.8 MiB/s | 324.9 MiB |  00m09s
[20/66] libcusparse-12-9-0:12.5.10.65-1.x86_64                                                            100% |  37.6 MiB/s | 351.7 MiB |  00m09s
[21/66] libnpp-12-9-0:12.4.1.87-1.x86_64                                                                  100% |  28.8 MiB/s | 271.1 MiB |  00m09s
[22/66] libnvfatbin-12-9-0:12.9.82-1.x86_64                                                               100% |   3.8 MiB/s | 940.1 KiB |  00m00s
[23/66] libnvjitlink-12-9-0:12.9.86-1.x86_64                                                              100% |  68.7 MiB/s |  37.6 MiB |  00m01s
[24/66] libnvjpeg-12-9-0:12.4.0.76-1.x86_64                                                               100% |  11.7 MiB/s |   5.1 MiB |  00m00s
[25/66] cuda-cccl-12-9-0:12.9.27-1.x86_64                                                                 100% |  34.2 MiB/s |   1.7 MiB |  00m00s
[26/66] cuda-cudart-devel-12-9-0:12.9.79-1.x86_64                                                         100% |  28.0 MiB/s |   3.0 MiB |  00m00s
[27/66] cuda-driver-devel-12-9-0:12.9.79-1.x86_64                                                         100% | 426.5 KiB/s |  43.1 KiB |  00m00s
[28/66] cuda-nvrtc-devel-12-9-0:12.9.86-1.x86_64                                                          100% |  80.8 MiB/s |  74.2 MiB |  00m01s
[29/66] cuda-opencl-devel-12-9-0:12.9.19-1.x86_64                                                         100% | 213.7 KiB/s | 119.4 KiB |  00m01s
[30/66] cuda-profiler-api-12-9-0:12.9.79-1.x86_64                                                         100% |  46.3 KiB/s |  26.2 KiB |  00m01s
[31/66] cuda-sandbox-devel-12-9-0:12.9.19-1.x86_64                                                        100% |   6.8 KiB/s |  44.2 KiB |  00m06s
[32/66] libcublas-devel-12-9-0:12.9.1.4-1.x86_64                                                          100% |  56.7 MiB/s | 630.3 MiB |  00m11s
[33/66] libcufft-devel-12-9-0:11.4.1.4-1.x86_64                                                           100% |  37.5 MiB/s | 385.6 MiB |  00m10s
[34/66] libcufile-devel-12-9-0:1.14.1.1-1.x86_64                                                          100% |   3.5 MiB/s |   5.2 MiB |  00m01s
[35/66] libcurand-devel-12-9-0:10.3.10.19-1.x86_64                                                        100% |  32.7 MiB/s |  64.2 MiB |  00m02s
[36/66] libcusolver-devel-12-9-0:11.7.5.82-1.x86_64                                                       100% |  61.2 MiB/s | 213.1 MiB |  00m03s
[37/66] libcusparse-devel-12-9-0:12.5.10.65-1.x86_64                                                      100% |  64.2 MiB/s | 710.9 MiB |  00m11s
[38/66] libnpp-devel-12-9-0:12.4.1.87-1.x86_64                                                            100% |  29.9 MiB/s | 268.0 MiB |  00m09s
[39/66] libnvfatbin-devel-12-9-0:12.9.82-1.x86_64                                                         100% | 135.9 KiB/s | 863.8 KiB |  00m06s
[40/66] libnvjitlink-devel-12-9-0:12.9.86-1.x86_64                                                        100% |  70.1 MiB/s |  36.1 MiB |  00m01s
[41/66] libnvjpeg-devel-12-9-0:12.4.0.76-1.x86_64                                                         100% |  12.4 MiB/s |   4.9 MiB |  00m00s
[42/66] cuda-command-line-tools-12-9-0:12.9.1-1.x86_64                                                    100% |  17.8 KiB/s |   7.5 KiB |  00m00s
[43/66] cuda-visual-tools-12-9-0:12.9.1-1.x86_64                                                          100% |  29.3 KiB/s |   7.5 KiB |  00m00s
[44/66] gds-tools-12-9-0:1.14.1.1-1.x86_64                                                                100% |  71.5 MiB/s |  42.0 MiB |  00m01s
[45/66] cuda-crt-12-9-0:12.9.86-1.x86_64                                                                  100% | 279.6 KiB/s | 119.7 KiB |  00m00s
[46/66] cuda-nvvm-12-9-0:12.9.86-1.x86_64                                                                 100% |  76.9 MiB/s |  57.6 MiB |  00m01s
[47/66] cuda-toolkit-12-9-config-common-0:12.9.79-1.noarch                                                100% |  15.9 KiB/s |   7.8 KiB |  00m00s
[48/66] cuda-toolkit-12-config-common-0:12.9.79-1.noarch                                                  100% |  14.7 KiB/s |   8.0 KiB |  00m01s
[49/66] cuda-toolkit-config-common-0:12.9.79-1.noarch                                                     100% |  21.3 KiB/s |   8.0 KiB |  00m00s
[50/66] cuda-cupti-12-9-0:12.9.79-1.x86_64                                                                100% |  48.5 MiB/s |  30.3 MiB |  00m01s
[51/66] cuda-gdb-12-9-0:12.9.79-1.x86_64                                                                  100% |  43.0 MiB/s |  33.4 MiB |  00m01s
[52/66] cuda-nvdisasm-12-9-0:12.9.88-1.x86_64                                                             100% |  36.0 MiB/s |   5.4 MiB |  00m00s
[53/66] cuda-nvprof-12-9-0:12.9.79-1.x86_64                                                               100% |  25.9 MiB/s |   4.9 MiB |  00m00s
[54/66] cuda-nvtx-12-9-0:12.9.79-1.x86_64                                                                 100% | 428.8 KiB/s |  91.8 KiB |  00m00s
[55/66] cuda-sanitizer-12-9-0:12.9.79-1.x86_64                                                            100% |  18.2 MiB/s |  14.3 MiB |  00m01s
[56/66] cuda-nsight-12-9-0:12.9.79-1.x86_64                                                               100% |  73.9 MiB/s | 113.2 MiB |  00m02s
[57/66] cuda-nsight-compute-12-9-0:12.9.1-1.x86_64                                                        100% |   9.7 KiB/s |   9.9 KiB |  00m01s
[58/66] cuda-nsight-systems-12-9-0:12.9.1-1.x86_64                                                        100% |   3.4 KiB/s |   9.2 KiB |  00m03s
[59/66] cuda-nvvp-12-9-0:12.9.79-1.x86_64                                                                 100% |  32.2 MiB/s | 115.0 MiB |  00m04s
[60/66] nsight-compute-2025.2.1-0:2025.2.1.3-1.x86_64                                                     100% |  65.5 MiB/s | 416.5 MiB |  00m06s
[61/66] nsight-systems-2025.1.3-0:2025.1.3.140_251335620677v0-0.x86_64                                    100% |  77.1 MiB/s | 381.9 MiB |  00m05s
[62/66] ttmkfdir-0:3.0.9-72.fc42.x86_64                                                                   100% | 158.4 KiB/s |  56.2 KiB |  00m00s
[63/66] java-21-openjdk-1:21.0.7.0.6-2.fc42.x86_64                                                        100% | 115.4 KiB/s | 415.2 KiB |  00m04s
[64/66] xorg-x11-fonts-Type1-0:7.5-40.fc42.noarch                                                         100% | 137.2 KiB/s | 506.3 KiB |  00m04s
[65/66] libstdc++-devel-0:15.1.1-2.fc42.x86_64                                                            100% |   5.4 MiB/s |   2.9 MiB |  00m01s
[66/66] gcc-c++-0:15.1.1-2.fc42.x86_64

Fedora 42 details

This fellow was kind enough to share lots of details: The following is the general (and official) guide for installing on Linux.

Driver

You need the driver along with the toolkit. You pick one of the following. The best choice seems to be the "open" surprisingly. The fellow who wrote the Fedora 42 guide says: "I would advise you to use the open kernel module as the closed source kernel module will eventually be deprecated."
The comment in the following reflects that advice.
dnf -y install nvidia-open
#dnf -y install cuda-drivers
They have notes about switching, but it looks like this:
dnf install --allowerasing nvidia-open
dnf install --allowerasing cuda-drivers
The allowerasing switch lets it shove a prior driver out of the way
  • Switching driver module flavors
  • Follow the Fedora 42 post instructions

    This is all because Nvidia is not yet providing files for F42, all this will probably be unnecessary soon.
    First he lists these:
    #dnf install akmod-nvidia
    #dnf install xorg-x11-drv-nvidia
    dnf install xorg-x11-drv-nvidia-cuda 
    #dnf install xorg-x11-drv-nvidia-cuda-libs
    
    Only the 3rd command above actually pulled anything in. The others were already in place.
    [1/3] nvidia-persistenced-3:575.57.08-1.fc42.x86_64                                                       100% |  92.9 KiB/s |  35.8 KiB |  00m00s
    [2/3] opencl-filesystem-0:1.0-22.fc42.noarch                                                              100% |  17.6 KiB/s |   7.6 KiB |  00m00s
    [3/3] xorg-x11-drv-nvidia-cuda-3:575.57.08-1.fc42.x86_64                                                  100% |   2.1 MiB/s |   2.3 MiB |  00m01s
    
    Now I try this:
    dnf -y install nvidia-open
    Updating and loading repositories:
    Repositories loaded.
    Failed to resolve the transaction:
    Problem: problem with installed package
      - installed package xorg-x11-drv-nvidia-cuda-3:575.57.08-1.fc42.x86_64 conflicts with cuda-drivers provided by nvidia-open-3:575.57.08-1.fc41.noarch from cuda-fedora41-12-9-local
      - package nvidia-open-3:575.57.08-1.fc41.noarch from cuda-fedora41-12-9-local conflicts with cuda-drivers provided by xorg-x11-drv-nvidia-cuda-3:575.57.08-1.fc42.x86_64 from rpmfusion-nonfree-updates
      - package nvidia-open-3:575.57.08-1.fc41.noarch from cuda-fedora41-12-9-local conflicts with cuda-drivers provided by xorg-x11-drv-nvidia-cuda-3:570.133.07-1.fc42.x86_64 from rpmfusion-nonfree
      - conflicting requests
    You can try to add to command line:
      --allowerasing to allow removing of installed packages to resolve problems
      --skip-broken to skip uninstallable packages
    
    I don't know what to say about this, but notice that these are conflicts between F41 and F42 versions of things. I am going to ignore this and press on.

    Now to install gcc 14. Surprisingly Fedora makes these previous versions of the compiler available:

    dnf -y install gcc14
    dnf -y install gcc14-c++
    
    I do this, but it is already installed:
    dnf -y install cuda-nvcc-12-9
    

    Try some things

    Typing nvcc at the command line indicates it is not on my path. Running updatedb then locate finds it in /usr/local/cuda-12.9/bin/nvcc
    /usr/local/cuda-12.9/bin/nvcc --version
    nvcc: NVIDIA (R) Cuda compiler driver
    Copyright (c) 2005-2025 NVIDIA Corporation
    Built on Tue_May_27_02:21:03_PDT_2025
    Cuda compilation tools, release 12.9, V12.9.86
    Build cuda_12.9.r12.9/compiler.36037853_0
    
    It looks like things got installed into /usr/local/cuda:
    cd /usr/local ; ls -l cuda*
    drwxr-xr-x  15 root root 4096 Jun 18 12:47 cuda-12.9
    lrwxrwxrwx   1 root root   22 Jun 18 12:47 cuda -> /etc/alternatives/cuda
    lrwxrwxrwx   1 root root   25 Jun 18 12:47 cuda-12 -> /etc/alternatives/cuda-12
    

    How do we use this?

    I start putting this to use in my pages on CUDA programming:
    Have any comments? Questions? Drop me a line!

    Adventures in Computing / tom@mmto.org