Nvidia driver and CUDA installation

I followed the tutorial Howto/NVIDIA - RPM Fusion for installing the Nvidia driver and CUDA, and it seemed that it was successful using the command modinfo -F version nvidia which showed the version number. I’ve also used the tutorial Howto/Secure Boot - RPM Fusion to sign the module, yet the GPU isn’t being detected by LLM applications, and the GPU acceleration settings in the applications are grayed out.

The command lspci -k | grep -i nvidia shows:

01:00.0 VGA compatible controller: NVIDIA Corporation TU106M [GeForce RTX 2070 Mobile / Max-Q Refresh] (rev a1)
	Kernel modules: nouveau, nvidia_drm, nvidia
...
	Kernel driver in use: nvidia-gpu
	Kernel modules: i2c_nvidia_gpu

The command sudo dnf repolist shows:

repo id                                          repo name
copr:copr.fedorainfracloud.org:phracek:PyCharm   Copr repo for PyCharm owned by phracek
fedora                                           Fedora 40 - x86_64
fedora-cisco-openh264                            Fedora 40 openh264 (From Cisco) - x86_64
rpmfusion-free                                   RPM Fusion for Fedora 40 - Free
rpmfusion-free-updates                           RPM Fusion for Fedora 40 - Free - Updates
rpmfusion-nonfree                                RPM Fusion for Fedora 40 - Nonfree
rpmfusion-nonfree-nvidia-driver                  RPM Fusion for Fedora 40 - Nonfree - NVIDIA Driver
rpmfusion-nonfree-steam                          RPM Fusion for Fedora 40 - Nonfree - Steam
rpmfusion-nonfree-updates                        RPM Fusion for Fedora 40 - Nonfree - Updates
updates                                          Fedora 40 - x86_64 - Updates

The command lsmod | grep nouveau shows:

nouveau              3923968  0
drm_ttm_helper         12288  1 nouveau
gpu_sched              65536  1 nouveau
drm_gpuvm              45056  1 nouveau
drm_exec               12288  2 drm_gpuvm,nouveau
i2c_algo_bit           20480  2 i915,nouveau
ttm                   114688  3 drm_ttm_helper,i915,nouveau
drm_display_helper    278528  2 i915,nouveau
mxm_wmi                12288  1 nouveau
video                  81920  3 msi_wmi,i915,nouveau
wmi                    32768  6 video,intel_wmi_thunderbolt,wmi_bmof,msi_wmi,mxm_wmi,nouveau

The command nvcc --version shows:
bash: nvcc: command not found...

The goal was to install and use the non-proprietary Nvidia drivers for Fedora as recommended, but I’ve done something incorrectly, and would like to remedy it. I don’t know how, so I’d like to seek help from the community.

Please show us the full output of dnf list installed '*nvidia*' and inxi -Fzxx as well as cat /proc/cmdline.

What you have posted seems to indicate that the nouveau driver is loaded instead of the nvidia driver.

The nvidia driver is proprietary.

My understanding is that the nouveau driver does not support hardware acceleration.

1 Like

@computersavvy Thank you for that clarification, that the nouveau driver is the open source driver and the Nvidia driver is the proprietary driver. Here are the outputs including the System and Graphics sections of the inxi -Fzxx, if any additional sections are needed, please let me know.

dnf list installed '*nvidia*'

Installed Packages
akmod-nvidia.x86_64                3:560.35.03-1.fc40 @rpmfusion-nonfree-nvidia-driver
kmod-nvidia-6.10.9-200.fc40.x86_64.x86_64
                                   3:560.35.03-1.fc40 @@commandline             
nvidia-gpu-firmware.noarch         20240909-1.fc40    @updates                  
nvidia-kmod-common.noarch          3:560.35.03-1.fc39 @cuda-fedora39-x86_64     
nvidia-modprobe.x86_64             3:560.35.03-1.fc40 @rpmfusion-nonfree-nvidia-driver
nvidia-persistenced.x86_64         3:560.35.03-1.fc40 @rpmfusion-nonfree-updates
nvidia-settings.x86_64             3:560.35.03-1.fc40 @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-cuda.x86_64    3:560.35.03-3.fc40 @rpmfusion-nonfree-updates
xorg-x11-drv-nvidia-cuda-libs.x86_64
                                   3:560.35.03-3.fc40 @rpmfusion-nonfree-updates
xorg-x11-drv-nvidia-kmodsrc.x86_64 3:560.35.03-3.fc40 @rpmfusion-nonfree-updates
xorg-x11-drv-nvidia-libs.x86_64    3:560.35.03-3.fc40 @rpmfusion-nonfree-updates

inxi -Fzxx

System:
  Kernel: 6.10.9-200.fc40.x86_64 arch: x86_64 bits: 64 compiler: gcc v: 2.41-37.fc40
  Desktop: GNOME v: 46.5 tk: GTK v: 3.24.43 wm: gnome-shell dm: GDM
  Distro: Fedora Linux 40 (Workstation Edition)

Graphics:
  Device-1: Intel CometLake-H GT2 [UHD Graphics] vendor: Micro-Star MSI
    driver: i915 v: kernel arch: Gen-9.5 ports: active: eDP-1 empty: none
    bus-ID: 00:02.0 chip-ID: [CHIP ID]
  Device-2: NVIDIA TU106M [GeForce RTX 2070 Mobile / Max-Q Refresh]
    vendor: Micro-Star MSI driver: nouveau v: kernel arch: Turing pcie:
    speed: 8 GT/s lanes: 16 ports: active: none empty: DP-1, DP-2, HDMI-A-1,
    eDP-2 bus-ID: 01:00.0 chip-ID: [CHIP ID]
  Device-3: Bison HD Camera driver: uvcvideo type: USB rev: 2.0
    speed: 480 Mb/s lanes: 1 bus-ID: 1-11:5 chip-ID: [CHIP ID]
  Display: wayland server: X.org v: 1.20.14 with: Xwayland v: 24.1.2
    compositor: gnome-shell driver: gpu: i915 display-ID: 0
  Monitor-1: eDP-1 model: Sharp LQ156M1JW03 res: 1920x1080 dpi: 142
    diag: 395mm (15.5")
  API: OpenGL v: 4.6 vendor: intel mesa v: 24.1.7 glx-v: 1.4 es-v: 3.2
    direct-render: yes renderer: Mesa Intel UHD Graphics (CML GT2)
    device-ID: [CHIP ID] display-ID: :0.0
  API: EGL Message: EGL data requires eglinfo. Check --recommends.

cat /proc/cmdline
BOOT_IMAGE=(hd1,gpt2)/vmlinuz-6.10.9-200.fc40.x86_64 root=UUID=[UUID] ro rootflags=subvol=root rd.luks.uuid=[LUKS UUID] rhgb quiet

These quite probably conflict and cause this (the nvidia driver not loading)

I would suggest that you remove the ‘nvidia-kmod-common’ package, disable the ‘cuda-fedora39-x86_64’ repo, then rebuild the nvidia driver from rpmfusion.

  1. sudo dnf remove nvidia-kmod-common
  2. sudo dnf config-manager --set-disabled cuda-fedora39-x86_64
  3. sudo akmods --force --rebuild
  4. After step 3 completes then reboot and verify the nvidia drivers are loaded with lsmod | grep nvidia

Please, also after performing those steps, if the nvidia driver still does not load (step 4 will return nothing) then post the output of sudo dmesg | grep -iE "nouveau|nvidia|secure"

1 Like

The first command was able to be executed, and then the second as well. But the third command sudo akmods --force --rebuild gave the error sudo: akmods: command not found.

This is the output after running the first command sudo dnf remove nvidia-kmod-common:

Dependencies resolved.
================================================================================
 Package                        Arch   Version             Repository      Size
================================================================================
Removing:
 nvidia-kmod-common             noarch 3:560.35.03-1.fc39  @cuda-fedora39-x86_64
                                                                           66 M
Removing dependent packages:
 akmod-nvidia                   x86_64 3:560.35.03-1.fc40  @rpmfusion-nonfree-nvidia-driver
                                                                           92 k
 kmod-nvidia-6.10.9-200.fc40.x86_64
                                x86_64 3:560.35.03-1.fc40  @@commandline   50 M
 nvidia-settings                x86_64 3:560.35.03-1.fc40  @rpmfusion-nonfree-nvidia-driver
                                                                          4.3 M
 xorg-x11-drv-nvidia-cuda       x86_64 3:560.35.03-3.fc40  @rpmfusion-nonfree-updates
                                                                          6.1 M
Removing unused dependencies:
 akmods                         noarch 0.5.8-8.fc40        @fedora         48 k
 fakeroot                       x86_64 1.36-1.fc40         @updates       163 k
 fakeroot-libs                  x86_64 1.36-1.fc40         @updates       125 k
 kmodtool                       noarch 1.1-10.fc40         @fedora         28 k
 libgit2                        x86_64 1.7.2-4.fc40        @updates       1.2 M
 llhttp                         x86_64 9.2.1-1.fc40        @updates        73 k
 nvidia-modprobe                x86_64 3:560.35.03-1.fc40  @rpmfusion-nonfree-nvidia-driver
                                                                           51 k
 nvidia-persistenced            x86_64 3:560.35.03-1.fc40  @rpmfusion-nonfree-updates
                                                                           58 k
 opencl-filesystem              noarch 1.0-20.fc40         @fedora          0  
 python3-babel                  noarch 2.16.0-1.fc40       @updates        28 M
 python3-click-plugins          noarch 1.1.1-19.fc40       @fedora         24 k
 python3-progressbar2           noarch 3.53.2-11.fc40      @fedora        257 k
 python3-pygit2                 x86_64 1.14.0-1.fc40       @fedora        1.2 M
 python3-rpmautospec            noarch 0.7.2-1.fc40        @updates       149 k
 python3-rpmautospec-core       noarch 0.1.5-1.fc40        @updates        11 k
 python3-typing-extensions      noarch 4.12.2-2.fc40       @updates       458 k
 python3-utils                  noarch 3.7.0-3.fc40        @fedora        173 k
 rpmdevtools                    noarch 9.6-7.fc40          @fedora        214 k
 xorg-x11-drv-nvidia-cuda-libs  x86_64 3:560.35.03-3.fc40  @rpmfusion-nonfree-updates
                                                                          194 M
 xorg-x11-drv-nvidia-kmodsrc    x86_64 3:560.35.03-3.fc40  @rpmfusion-nonfree-updates
                                                                           54 M

Haven’t done anything after getting the sudo: akmods: command not foundmessage, but thought that I should run the commandsudo dnf install akmod-nvidia, but I haven’t.

Reinstalling akmod-nvidia is exactly what should be done now. The fact that the file from the cuda repo caused that clearly shows the conflicts I expected.

I would do that as sudo dnf install akmod-nvidia xorg-x11-drv-nvidia-cuda and verify that it is installing only from the rpmfusion-nonfree-updates repo and fedora repos before accepting it.

1 Like

Ran the command sudo dnf install akmod-nvidia xorg-x11-drv-nvidia-cuda, then sudo akmods --force --rebuild, then restarted, and then ran the command lsmod | grep nvidia which shows:

nvidia_drm            135168  5
nvidia_modeset       1650688  3 nvidia_drm
nvidia_uvm           6844416  0
nvidia              72577024  32 nvidia_uvm,nvidia_modeset
i2c_nvidia_gpu         12288  0
video                  81920  3 msi_wmi,i915,nvidia_modeset

After performing all the steps you recommended, the LLM application now recognizes the GPU and the GPU acceleration can be enabled, as shown in the screenshot.

@computersavvy :pray: I am now able to proceed with a course and its hands on exercises.

1 Like

@computersavvy I’d like to ask you, what does the time displayed on the clock in your profile photo signify?

Simply an image of a clock on the wall of my computer room. The animals are Elk.

1 Like

It’s a nice clock, evokes peace and calmness, and thoughts of the beauty of nature.

1 Like

I’d like to note here that after implementing the solution, videos no longer freeze for a couple seconds whenever they are forwarded.

Before the solution was implemented, whenever a video was playing, if it was forwarded via dragging the time icon or clicking some future time point in the video, the audio would continue working properly, but the video would remain frozen for a couple seconds.