Fedora systems often default to the open-source Nouveau graphics driver, which can limit GPU performance and compatibility with demanding applications. Switching to the official NVIDIA driver unlocks advanced features for gaming, 3D rendering, and GPU-accelerated tasks. However, installing NVIDIA drivers on Fedora requires careful attention to repository setup, driver selection, and compatibility with Secure Boot and kernel updates.

Step 1: Update your Fedora system to ensure all packages are current. This reduces the chance of conflicts during driver installation and ensures kernel headers match your running kernel.

sudo dnf update

Step 2: Add the RPM Fusion repositories, which provide access to proprietary NVIDIA drivers tested for Fedora. Both the free and nonfree repositories are required.

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

Step 3: Determine your NVIDIA GPU model. This helps you identify which driver series is appropriate, as legacy cards may require older driver branches.

lspci | grep VGA

Compare your card model with the supported driver series listed on the RPM Fusion NVIDIA Howto page. For most current GPUs, the standard driver (akmod-nvidia) is suitable. Legacy cards (such as GeForce 400/500 or earlier) require specific packages (e.g., akmod-nvidia-390xx).

Step 4: Install the correct NVIDIA driver package. For modern GPUs, use:

sudo dnf install akmod-nvidia

For legacy GPUs, substitute the package name as needed (e.g., akmod-nvidia-470xx for certain older models).

This process will also install dependencies such as kernel modules and CUDA libraries if available. The akmod system automatically builds kernel modules for your running kernel version, reducing the risk of breakage after kernel updates.

Step 5: Reboot your system. This step is essential, as it loads the new NVIDIA kernel modules and switches your system from Nouveau to the proprietary driver.

sudo reboot

After reboot, verify the driver is active by running:

nvidia-smi

This command should display your GPU information and driver version. If you see an error or fallback to Nouveau, double-check that the correct driver version matches your hardware and that Secure Boot is not blocking kernel module loading.

Step 6 (If Using Secure Boot): Secure Boot can prevent unsigned kernel modules, including NVIDIA drivers, from loading. To maintain Secure Boot, you must enroll a Machine Owner Key (MOK) during installation. The RPM Fusion Secure Boot Howto provides detailed instructions. Typically, after installing the driver, you'll be prompted to create and enroll a key, then reboot and complete the process via the MOK manager interface.

Step 7 (Optional): If you have an Optimus laptop (integrated Intel/AMD GPU + discrete NVIDIA GPU), Fedora supports GPU switching using switcheroo-control. You can select which GPU to use for each application via right-click menus in GNOME or KDE, or with environment variables such as __NV_PRIME_RENDER_OFFLOAD=1 for command-line launches.


Install NVIDIA Drivers Using the Official NVIDIA Repository (Advanced)

Fedora 41 and newer support direct installation of NVIDIA drivers from the official NVIDIA repository, which offers both open and proprietary kernel modules. This method is best for users needing the absolute latest drivers or specific kernel module flavors.

Step 1: Install kernel development tools and headers to ensure the driver can build kernel modules for your running kernel.

sudo dnf install kernel-devel-matched kernel-headers

Step 2: Enable the NVIDIA CUDA repository for Fedora:

sudo dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/fedora41/x86_64/cuda-fedora41.repo
sudo dnf clean expire-cache

Step 3: Decide whether you want the open kernel modules (for Turing and newer GPUs) or proprietary modules (required for Maxwell, Pascal, and Volta GPUs). Open modules are the default for supported hardware.

  • To install the open kernel module flavor:
sudo dnf install nvidia-open
  • To install the proprietary kernel module flavor:
sudo dnf install cuda-drivers

Step 4: Reboot to activate the new drivers.

sudo reboot

Switching between open and proprietary modules is possible with the --allowerasing flag:

sudo dnf install --allowerasing nvidia-open

or

sudo dnf install --allowerasing cuda-drivers

Step 5: For systems with Secure Boot enabled, follow the on-screen prompts or refer to Fedora's documentation to enroll the necessary MOK keys. Failure to do so will block the NVIDIA kernel modules from loading.

Step 6: Confirm installation using nvidia-smi and check for errors in dmesg or journalctl -k if the driver does not load.


Direct installation using the .run installer from NVIDIA’s website is discouraged on Fedora. This method bypasses the package manager, often causes conflicts with system updates, and complicates future maintenance. Only use this approach if you have a unique requirement and are comfortable troubleshooting issues.

Step 1: Download the appropriate driver for your GPU from NVIDIA’s official website and move it to your home directory.

Step 2: Make the installer executable:

chmod +x NVIDIA-Linux-x86_64-*.run

Step 3: Install required build tools and kernel headers:

sudo dnf install kernel-devel kernel-headers gcc make dkms acpid libglvnd-glx libglvnd-opengl libglvnd-devel pkgconfig

Step 4: Disable the Nouveau driver by creating a blacklist file and updating the kernel initramfs:

echo -e "blacklist nouveau\noptions nouveau modeset=0" | sudo tee /etc/modprobe.d/blacklist-nouveau.conf
sudo dracut --force

Step 5: Switch to multi-user (text) mode to prevent conflicts with the running X server:

sudo systemctl set-default multi-user.target
sudo reboot

Step 6: Log in at the text console and run the installer:

sudo ./NVIDIA-Linux-x86_64-*.run

Follow the prompts to build and install the driver. Accept DKMS and 32-bit libraries if you need Steam or legacy applications. If you see errors related to Secure Boot, you must disable it or sign the kernel modules yourself.

Step 7: Restore graphical mode and reboot:

sudo systemctl set-default graphical.target
sudo reboot

Manual installations are prone to breakage after kernel or Xorg updates. If you encounter issues, consider reverting to the RPM Fusion or official repository method for easier maintenance.


Troubleshooting and Maintenance Tips

After installing the NVIDIA driver, monitor system updates closely. Kernel updates may require rebuilding the NVIDIA kernel module (handled automatically by akmods or DKMS in most cases). If you experience a black screen or fallback to Nouveau after an update, verify that the kernel headers for your running kernel are installed and, if necessary, manually trigger a rebuild:

sudo akmods --force
sudo dracut --force
sudo reboot

For Secure Boot systems, ensure your MOK key remains valid after major changes. If you reinstall Windows or Fedora, you may need to re-enroll keys. Dual-boot users should be cautious with bootloader and Secure Boot configurations, as missteps can prevent access to Windows or Fedora.

To uninstall the NVIDIA driver (RPM Fusion method):

sudo dnf remove akmod-nvidia xorg-x11-drv-nvidia\*

This command reverts your system to the open-source Nouveau driver.


Switching to the official NVIDIA driver on Fedora unlocks improved graphics performance and better compatibility for demanding workloads. Sticking with the RPM Fusion or NVIDIA repository methods ensures smoother updates and easier troubleshooting in the long term.