Fedora + Nvidia

RPM fusion

Organization

Setup

1
2
3
sudo dnf install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
sudo dnf install https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
sudo dnf config-manager --enable fedora-cisco-openh264

Repos

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
rpmfusion-nonfree-release
    akmod-nvidia-535.129.03-1.fc39
    kmod-nvidia-535.129.03-1.fc39
    xorg-x11-drv-nvidia-535.129.03-2.fc39
    xorg-x11-drv-nvidia-cuda-535.129.03-2.fc39
rpmfusion-nonfree-updates
    akmod-nvidia-550.90.07-1.fc39
    kmod-nvidia-550.90.07-1.fc39
    xorg-x11-drv-nvidia-550.90.07-1.fc39
    xorg-x11-drv-nvidia-cuda-550.90.07-1.fc39
rpmfusion-nonfree-release-tainted
    kmod-nvidia-open-550.90.07-1.fc39
    akmod-nvidia-open-550.90.07-1.fc39

rpmfusion-nonfree-nvidia-driver
    akmod-nvidia-550.90.07-1.fc39
    kmod-nvidia-550.90.07-1.fc39
    xorg-x11-drv-nvidia-550.90.07-1.fc39
    xorg-x11-drv-nvidia-cuda-550.90.07-1.fc39

Fedora third-party repos (Gnome Software)
    rpmfusion-nonfree-nvidia-driver
    rpmfusion-nonfree-steam

    subset of rpmfusion-nonfree-updates

Nvidia drivers

types:

sources:

CUDA toolkit

1
2
3
4
5
sudo dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/fedora39/x86_64/cuda-fedora39.repo
sudo dnf clean all

sudo dnf module disable nvidia-driver
sudo dnf install cuda-toolkit-12-4

drivers from RPM fusion + cuda toolkit from NV repo use drivers from RPM fusion because it updates at the same time as Fedora while NV might be much later... but the cuda toolkit is only available in the NV repo

1
2
cuda packages from rpmfusion are mostly not compatible with cuda packages from NV official
how to know if they are compatible?

Install Nvidia drivers

install:

1
2
3
4
sudo dnf update -y
reboot
sudo dnf install akmod-nvidia
sudo dnf install xorg-x11-drv-nvidia-cuda

validate:

1
2
3
lspci -k | grep nvidia  # gpu
nvidia-smi              # gpu driver version
echo $XDG_SESSION_TYPE  # wayland enabled

Install CUDA toolkit

1
2
3
4
sudo dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/fedora39/x86_64/cuda-fedora39.repo
sudo dnf clean all
sudo dnf module disable nvidia-driver # disable nvidia drivers from NV repo
sudo dnf install cuda-toolkit-12-4

add toolkit to path:

1
export PATH=/usr/local/cuda-12.4/bin${PATH:+:${PATH}}

avoid updating cuda toolkit:

1
2
3
dnf config-manager --set-disabled cuda-fedora39-x86_64 # avoid updating cuda toolkit, conflicts w RPM fusion
dnf clean all
reboot

validate:

1
nvcc --version # can call cuda compiler

Debug

"modular filtering" : nvidia-driver module in cuda-fedora39.repo conflicts with RPM fusion.

Nvidia open source kernel drivers

https://download.nvidia.com/XFree86/Linux-x86_64/555.42.02/README/kernel_open.html

Open source drivers (nouveau)

nvidia nvidia_modeset nvidia_drm nvidia_uvm nvidia-peermem

blacklist nvidia_modeset nvidia_drm w modprobe.blacklist rd.driver.blacklist

add RUN+="/usr/libexec/gdm-runtime-config set daemon WaylandEnable true to end of /usr/lib/udev/rules.d/61-gdm.rules

Manual install

https://www.if-not-true-then-false.com/2015/fedora-nvidia-guide/ https://www.if-not-true-then-false.com/2018/install-nvidia-cuda-toolkit-on-fedora/