How to Install NVIDIA Drivers on Fedora (Complete Guide)

Install NVIDIA drivers on Fedora by enabling RPM Fusion and running the dnf install command for akmod-nvidia.

You installed Fedora and the performance is terrible

You just finished a fresh install of Fedora Workstation. The desktop loads, but the menu animations stutter. You open a terminal and run glxinfo | grep renderer. The output says llvmpipe instead of your GPU name. Your system is falling back to software rendering because the proprietary NVIDIA kernel modules are missing. Or perhaps you updated the kernel with dnf upgrade --refresh and now the login screen is a black void with a blinking cursor. The display manager can't start because the old NVIDIA module no longer matches the new kernel version.

Run glxinfo before you panic. Software rendering is the default state until you add the repository.

What is actually happening

Fedora ships with the open-source nouveau driver by default. This driver works out of the box and supports basic display output. It does not provide full hardware acceleration for modern NVIDIA GPUs. To get performance, you need the proprietary driver from NVIDIA. Fedora cannot include proprietary software in its official repositories due to licensing restrictions. You must add a third-party repository called RPM Fusion to access these packages.

Think of the kernel as the engine and the driver as a specialized tool. The nouveau driver is a generic wrench that can tighten most bolts but struggles with high-torque tasks. The NVIDIA driver is a calibrated torque wrench built specifically for your hardware. Fedora gives you the wrench. RPM Fusion gives you the torque wrench.

The package name akmod-nvidia contains the source code and build scripts. When you install it, the akmod service compiles the kernel module against your current kernel version. This is different from a pre-compiled kmod package. Fedora updates the kernel frequently. Using akmod ensures the driver rebuilds automatically when you update the kernel, preventing the black screen issue after a system upgrade.

dnf upgrade --refresh is the normal weekly maintenance command. Run this to keep the kernel and driver in sync. The akmod service will rebuild the driver automatically after the kernel updates.

Install the driver stack

Here is the standard procedure to enable RPM Fusion and install the driver stack.

# Add RPM Fusion repositories to access proprietary drivers.
# Fedora does not ship NVIDIA drivers due to licensing.
# The non-free repo contains the akmod-nvidia package.
sudo dnf install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm

Here is how to install the driver and CUDA components.

# Install the kernel module builder and the X11 driver with CUDA support.
# akmod-nvidia builds the driver for your current kernel.
# xorg-x11-drv-nvidia-cuda provides the display driver and CUDA libraries.
sudo dnf install akmod-nvidia xorg-x11-drv-nvidia-cuda

Reboot the system to load the new kernel modules.

# Reboot to apply the new kernel modules and display driver.
# The akmod service will compile the driver during boot if needed.
sudo reboot

Reboot immediately. The driver won't load until the kernel module is active.

Handle Secure Boot and MOK enrollment

If you have Secure Boot enabled in your UEFI firmware, the kernel will refuse to load unsigned modules. The NVIDIA driver is third-party and unsigned. You must enroll a Machine Owner Key (MOK) to allow the driver to load. The akmod installation process usually triggers the MOK enrollment screen. If you missed it, or if the screen flashes too fast, you need to enroll the key manually.

Here is how to check if the module loaded.

# Check if the NVIDIA module is loaded.
# If Secure Boot is blocking it, this command returns nothing.
lsmod | grep nvidia

If lsmod returns nothing, check the journal for verification errors. You may see kernel: nvidia: module verification failed: signature and/or required key missing - tainting kernel. This confirms Secure Boot is blocking the driver.

Here is how to trigger the enrollment process manually.

# Trigger the MOK enrollment process manually.
# This is needed if the automatic enrollment screen was missed.
# You will be prompted to set a password for the key.
sudo /usr/libexec/akmods/akmods-enroll

After running the command, reboot the system. You will see a blue UEFI screen asking to enroll the key. Select "Enroll MOK", enter the password you just set, and confirm.

Enroll the key once. The system remembers the signature across reboots.

Configure kernel parameters for Wayland

For best compatibility with Wayland and to avoid flickering, add the nvidia-drm.modeset=1 kernel parameter. This enables DRM kernel mode setting for the NVIDIA driver. Fedora defaults to Wayland. Without this parameter, you may experience screen tearing or black screens when switching workspaces.

Here is how to edit the GRUB configuration.

# Edit the GRUB configuration to add kernel parameters.
# This file is the user-modified source for GRUB settings.
# Never edit /boot/grub2/grub.cfg directly.
sudo nano /etc/default/grub

Add nvidia-drm.modeset=1 to the GRUB_CMDLINE_LINUX line. The line should look like GRUB_CMDLINE_LINUX="... nvidia-drm.modeset=1". Save the file.

Here is how to apply the changes.

# Regenerate GRUB configuration for BIOS systems.
# On UEFI systems, the output path is /boot/efi/EFI/fedora/grub.cfg.
sudo grub2-mkconfig -o /boot/grub2/grub.cfg

Regenerate GRUB before rebooting. The parameters won't apply otherwise.

Verify the installation

Here is how to confirm the driver is active.

# Verify the driver is active and the GPU is detected.
# This command queries the NVIDIA management interface.
nvidia-smi

The output should show a table with your GPU name, driver version, and memory usage. If you see NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver, the module is not loaded. Check journalctl -t akmods for build errors.

Trust nvidia-smi. If it shows the GPU, the stack is working.

Common pitfalls and errors

The akmod service can fail to build if the kernel headers are missing or if the compiler environment is broken. If the driver fails to load after a kernel update, check the service status.

# Check the akmod service status and recent logs.
# This shows if the build succeeded or failed.
systemctl status akmods

If the build failed, you may see Failed to build module nvidia. Ensure kernel-devel and kernel-headers match your running kernel. Run sudo dnf install kernel-devel kernel-headers to fix missing development files.

The nouveau driver must be blacklisted. The akmod-nvidia package usually handles this via dracut configuration. If you see conflicts, ensure nouveau is not loaded. You may encounter modprobe: ERROR: could not insert 'nvidia': File exists. This indicates nouveau is still holding the device. Reboot after installing akmod-nvidia to let dracut regenerate the initramfs with the blacklist.

Wayland flickering can occur on older GPUs or specific driver versions. If you encounter flickering, switch to X11 at the login screen. Click the gear icon and select "GNOME on Xorg".

Check journalctl -t akmods. The build log tells you exactly why the module failed.

When to use this versus alternatives

Use akmod-nvidia when you need full hardware acceleration and CUDA support on a standard Fedora Workstation. Use nouveau when you require a fully open-source stack and can tolerate reduced performance on modern GPUs. Use the NVIDIA runfile installer only when you need a specific driver version not available in RPM Fusion and you accept manual maintenance overhead. Use kmod-nvidia only when you cannot compile kernel modules and need a pre-built binary for a specific kernel version.

Stick to RPM Fusion. Manual installers drift and break on kernel updates.

Where to go next