There are some steps that is not documented in the RPMFusion's installation guide. Here's how I install NVIDIA driver on Fedora 41.
- Update all packages and reboot
- Install
akmod-nvidia
from RPMFusion, optionally with packages for CUDA or NVENC. - For some reason, after akmod installation, I didn't see modeset=1 on kernel option, so:
#!/bin/bash
sudo grubby --update-kernel=ALL --args='nvidia-drm.modeset=1'
- Create file
/etc/dracut.conf.d/nvidia.conf
with the following content:
add_drivers+=" nvidia nvidia_modeset nvidia_uvm nvidia_drm "
install_items+=" /etc/modprobe.d/nvidia.conf "
- Create file
/etc/modprobe.d/nvidia.conf
with the following content:
options nvidia_drm modeset=1
- Wait until akmod done building the drivers.
- Rebuild initramfs
sudo dracut --regenerate-all --force
- The system is ready to reboot.
The script has not been tested.
#!/bin/bash
sudo dnf install akmod-nvidia \
xorg-x11-drv-nvidia-cuda xorg-x11-drv-nvidia-cuda-libs \
xorg-x11-drv-nvidia-power \
nvidia-vaapi-driver libva-utils vdpauinfo
sudo grubby --update-kernel=ALL --args='nvidia-drm.modeset=1'
cat << EOF | sudo tee /etc/dracut.conf.d/nvidia.conf
add_drivers+=" nvidia nvidia_modeset nvidia_uvm nvidia_drm "
install_items+=" /etc/modprobe.d/nvidia.conf "
EOF
cat << EOF | sudo tee /etc/modprobe.d/nvidia.conf
options nvidia_drm modeset=1
EOF
while pgrep akmod; do
sleep 5
done
sudo dracut --regenerate-all --force
With driver series 570, DRM is enabled by default, no need for kernel parameter
nvidia-drm.modeset=1
.This means followers of the guide above can skip steps 3 and 5. Additionally, the second line of the file created in step 4 (
install_items+=
) can also be ignored.In step 7, if you have already rebooted after a kernel update,
dracut
may get an error because it can't find the NVIDIA kernel modules for the old kernel. Instead of running the command as given, you can generate a newinitramfs
for only the current running kernel withsudo dracut --force --kver $(uname -r) -M
. I'm not sure if dracut will still replace theinitramfs
after it encounters an error, but probably not.Updated Guide:
Don't skip any steps below!
xorg-x11-drv-nvidia-cuda xorg-x11-drv-nvidia-cuda-libs
xorg-x11-drv-nvidia-power
nvidia-vaapi-driver libva-utils vdpauinfo
akmod
to finish building nvidia driver kernel modules.top
and see if akmods user/cc1 process is in the listcc1
processes should match the number of threads your CPU hasakmod
process runs faster on CPUs with more threads, on a 2012 quad core, the process takes about 5 minutes*** If you're superstitious, you can manually trigger akmod build process with
sudo akmods --rebuild
sudo dracut --force --kver $(uname -r) -M