Fixing NVIDIA driver issues on Fedora
Troubleshooting steps for Fedora systems with NVIDIA GPUs, sleep/wake problems and the nvidia kernel module is missing error.
On Fedora machines with an NVidia card, a typical problem appears after a kernel update: the system boots at low resolution, hardware acceleration stops working, and sometimes the boot ends on a black screen.
The cause is that the driver is built against a specific kernel. When the kernel is upgraded, the old driver module no longer matches it. With manually installed drivers this repeats after every update.
The lasting fix is to remove the manually installed drivers completely and install from the RPM Fusion repository: those packages rebuild the driver automatically on kernel updates, so the problem does not return. Follow the steps below in order; a reboot is required after installing the driver.
To solve the problem, we first need to open the Terminal window.
We can list the required steps as follows.
- If there are any installed nvidia drivers, we need to remove them
sudo dnf remove "*nvidia*"
- Then we should enable RPM Fusion and reinstall the drivers.
sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
sudo dnf install https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
sudo dnf install akmod-nvidia
sudo dnf install xorg-x11-drv-nvidia-cuda
- We rebuild the kernel modules with the akmod package
sudo akmods --force
sudo dracut --force
- We open the /etc/default/grub file.
sudo nano /etc/default/grub
- We find the line starting with GRUB_CMDLINE_LINUX and add this value.
GRUB_CMDLINE_LINUX="...... nvidia-drm.modeset=1"
- After saving the changes, we update Grub
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
- Finally, we restart the operating system.
Short guide
When to use it
NVIDIA driver issues on Fedora often appear after a kernel update, manual driver install or missing repository setup. Symptoms include low resolution, black screens or missing hardware acceleration.
What to watch
- Make sure the NVIDIA module matches the running kernel.
- Remove leftovers from manually installed drivers before installing again.
- Prefer package sources such as RPM Fusion that follow kernel updates.
Common mistake
Reinstalling the driver may only be temporary. The lasting fix is making sure the driver rebuilds correctly when the kernel changes.
A note for long-term fixes
When fixing an error, hiding the message is rarely enough. Version, operating system, dependencies, encoding, server settings and logs should be reviewed together. For a long-term fix, it is better to review the environment, dependencies and data flow together.