top of page

How to Install Nvidia Drivers Fedora: Complete Step-by-Step Guide

  • 1 day ago
  • 7 min read

Fedora uses the open-source Nouveau driver by default, which provides basic functionality but lacks the performance and features of NVIDIA's proprietary drivers. If you want to unlock your GPU's full potential for gaming, 3D rendering, or machine learning, you'll need to install NVIDIA's official drivers.


The most straightforward way to install NVIDIA drivers on Fedora is through RPM Fusion repositories, which handle dependencies and updates automatically. This method integrates seamlessly with Fedora's package management system and ensures your drivers stay current with system updates.

How to Install Nvidia Drivers Fedora

This guide walks you through the complete installation process, from preparing your system and choosing the right installation method to verifying everything works correctly. You'll learn the recommended RPM Fusion approach as well as alternative methods for advanced users who need specific driver versions or configurations.


Prerequisites and Preparing Your Fedora System


Before installing NVIDIA drivers, you need to verify your hardware compatibility, ensure your system is fully updated with the required kernel packages, and understand how Secure Boot affects driver installation.


Checking for an NVIDIA GPU and Compatibility


You can verify your NVIDIA GPU by running lspci | grep -i nvidia in the terminal. This command displays your graphics card model and confirms NVIDIA hardware is present.


Check that your system architecture is x86_64 by running uname -m. The NVIDIA drivers discussed in this guide only support 64-bit systems. If the output shows anything other than x86_64, the standard NVIDIA driver packages will not work on your system.


You should also verify your GPU is supported by checking the NVIDIA driver release notes on their official website. Newer GPUs require recent driver versions, while very old cards may only work with legacy drivers available through RPM Fusion repositories.


Updating Fedora and Installing Kernel Headers


Update your entire Fedora system before proceeding with driver installation by running sudo dnf update. This ensures you have the latest kernel version and prevents conflicts between driver and kernel versions.


After updating, you must install kernel-devel and kernel-headers packages that match your running kernel. Run sudo dnf install kernel-devel kernel-headers to install these packages. For exact version matching, use sudo dnf install kernel-devel-matched kernel-headers.


The kernel-devel package contains the kernel source files needed to compile the NVIDIA driver modules. The kernel-headers package provides header files required during the build process. Without these packages, the NVIDIA driver installation will fail.


Reboot your system after updates to ensure you're running the latest kernel version before driver installation.


Understanding Secure Boot and MOK Enrollment


Secure Boot is a UEFI firmware feature that prevents unauthorized code from running during boot. NVIDIA drivers are third-party kernel modules that Secure Boot will block unless properly signed.


When you install NVIDIA drivers from RPM Fusion with Secure Boot enabled, the system generates a Machine Owner Key (MOK) that must be enrolled. After installation, reboot your system and you'll see a MOK enrollment screen. Select "Enroll MOK," then "Continue," and enter the password provided during driver installation.


You can check if Secure Boot is enabled by running mokutil --sb-state. If you need to import a MOK manually later, use mokutil --import followed by the key file path. The MOK enrollment process authenticates the driver modules so Secure Boot allows them to load. If you prefer to avoid MOK enrollment entirely, you can disable Secure Boot in your UEFI/BIOS settings, though this reduces system security.


Installing NVIDIA Drivers on Fedora Using RPM Fusion


RPM Fusion provides the most streamlined method for installing NVIDIA drivers on Fedora, as it integrates directly with your system's package manager and handles kernel module compilation automatically. This approach uses akmod-nvidia to build drivers that remain compatible across kernel updates.


Enabling RPM Fusion Repositories


You need to enable both the free and nonfree RPM Fusion repositories before installing NVIDIA drivers. The nonfree repository specifically contains the proprietary NVIDIA driver packages.

Run the following commands to enable RPM Fusion:

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

After installation, update your package cache with sudo dnf update. You can verify the repositories are enabled by checking your dnf configuration with dnf repolist | grep rpmfusion.


Choosing the Correct Driver for Your GPU


NVIDIA maintains different driver series based on GPU generation and support status. Most modern GPUs use the standard akmod-nvidia package, which provides the latest driver version.

Your choice depends on your hardware generation:


  • akmod-nvidia: Latest driver for current GPUs (recommended for most users)

  • akmod-nvidia-470xx: Legacy driver for older GPUs discontinued from current support

  • akmod-nvidia-390xx: Older legacy driver for much older hardware


You can identify your NVIDIA GPU model with lspci | grep -i nvidia. Check NVIDIA's official supported GPU list to determine which driver series supports your card.


Installing akmod-nvidia and Dependencies


The akmod-nvidia package automatically compiles kernel modules when your kernel updates, ensuring continuous driver compatibility. This is the core package you need for basic NVIDIA driver functionality. Install the driver with:

sudo dnf install akmod-nvidia

For complete desktop support, you should also install xorg-x11-drv-nvidia, which provides the X server drivers. Additionally, install nvidia-settings for a graphical configuration tool.


The installation process will automatically blacklist nouveau, Fedora's default open-source NVIDIA driver. You must reboot after installation to load the NVIDIA modules. During the first boot, akmods will compile the kernel modules, which may take several minutes.


You can monitor the module build process with journalctl --follow --grep=akmod. If modules don't load automatically, manually trigger compilation with sudo akmods --force and regenerate initramfs using sudo dracut --force.


Enabling CUDA Support and Optional Components


CUDA support enables GPU-accelerated computing for scientific applications, machine learning, and video processing. Install xorg-x11-drv-nvidia-cuda to add CUDA libraries and runtime support.

sudo dnf install xorg-x11-drv-nvidia-cuda

Additional useful packages include:


  • nvidia-settings: GUI tool for driver configuration and monitoring

  • nvidia-xconfig: Utility to generate xorg.conf files (rarely needed on modern systems)

  • xorg-x11-drv-nvidia-cuda-libs: Additional CUDA libraries for development


For systems with hybrid graphics (Intel/NVIDIA or AMD/NVIDIA), the switcheroo-control package enables GPU switching functionality. Install it with sudo dnf install switcheroo-control if you need to switch between integrated and discrete graphics.


After installing CUDA components, verify installation by checking nvidia-smi output, which displays GPU information and driver version.


Advanced Methods: Official NVIDIA Repository and Runfile Installation


Advanced users can install NVIDIA drivers through the official NVIDIA CUDA repository or by manually executing the NVIDIA .run package. These methods provide direct access to specific driver versions and kernel module configurations not always available through RPM Fusion.


Installing via NVIDIA CUDA Repository


The NVIDIA CUDA repository offers proprietary drivers directly from NVIDIA. You need to add the repository to your system before installation. Download and install the CUDA repository package for Fedora:

sudo dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/fedora39/x86_64/cuda-fedora39.repo

After adding the repository, update your package cache and install the driver:

sudo dnf clean all
sudo dnf install cuda-drivers

You can alternatively install nvidia-driver-cuda for CUDA support or target specific legacy versions like nvidia-390xx or nvidia-470xx for older hardware. The cuda-drivers package automatically selects the appropriate driver for your GPU.


This method provides access to the latest NVIDIA releases faster than third-party repositories. It also simplifies CUDA toolkit installation for machine learning and scientific computing workloads.


Manual Installation Using the NVIDIA .run Package


The runfile method gives you complete control over driver installation. Download the latest nvidia-linux-x86_64 .run file from NVIDIA's official website.


Before running the installer, you must disable the nouveau driver and exit your graphical session. Switch to a text console using Ctrl+Alt+F3 and stop the display manager:

sudo systemctl isolate multi-user.target

Make the downloaded file executable and run it:

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

The installer will prompt you to register the kernel module with DKMS. Accept this option to ensure the driver rebuilds automatically after kernel updates.


This method requires manual updates and can conflict with package managers. You'll need to re-run the installer for each driver update, making it less convenient than repository-based installations.


Open vs Proprietary Kernel Module Options


NVIDIA now offers both open-source and proprietary kernel modules. The open kernel modules, available as kmod-nvidia-open-dkms or nvidia-open, work with newer GPUs (Turing architecture and later).


The open modules provide identical performance to proprietary versions on supported hardware. They improve compatibility with newer kernel features and Wayland compositors. You can specify which module to use during installation.


To enable early KMS (Kernel Mode Setting) with either module type, add nvidia-drm.modeset=1 to your kernel parameters:

sudo grubby --update-kernel=ALL --args="nvidia-drm.modeset=1"

The nvidia-drm.modeset parameter improves boot splash display and reduces flickering. Most users should enable this setting regardless of whether they choose open or proprietary kernel modules.


Legacy GPUs require the proprietary kernel modules and don't support the open-source option. Check NVIDIA's documentation to verify which kernel module type your GPU supports.


Post-Installation Verification and Troubleshooting


After installing NVIDIA drivers on Fedora, confirming proper functionality and addressing potential issues ensures your GPU operates correctly. Key verification steps involve checking driver detection, resolving kernel module conflicts, and maintaining driver updates.


Verifying NVIDIA Driver Installation


The primary tool for verifying your installation is nvidia-smi, which displays driver information and GPU status. Run this command in your terminal to check if the driver loaded successfully:

nvidia-smi

A successful installation displays your GPU model, nvidia driver version, CUDA version, and current GPU utilization. If the command returns an error or "NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver," your driver installation encountered problems. You can also verify the loaded kernel module with:

lsmod | grep nvidia

This should return several nvidia-related modules including nvidia, nvidia_modeset, and nvidia_uvm. Additionally, check your driver version and installation details using:

modinfo nvidia

For graphical verification, check your system settings under "About" to confirm the NVIDIA GPU appears as your graphics processor rather than the default nouveau driver.


Resolving Kernel Module and Secure Boot Issues


The most common post-installation problem is nvidia kernel module missing errors, often appearing after kernel updates. When your system updates the kernel, NVIDIA drivers must rebuild their kernel modules to match. If you encounter "NVIDIA kernel module missing" errors, rebuild the modules with:

sudo akmods --force
sudo dracut --force

Secure Boot creates additional complications because it prevents unsigned kernel modules from loading. You must either disable Secure Boot in your BIOS or sign the NVIDIA kernel modules with your own Machine Owner Key (MOK). To enroll your key for signed modules, use:

sudo mokutil --import /etc/pki/akmods/certs/public_key.der

After rebooting, follow the MOK enrollment prompts. If libglvnd-devel dependency errors appear during driver installation, install the package manually:

sudo dnf install libglvnd-devel

Managing Driver Updates and Switching Modules


NVIDIA drivers update through regular system updates when installed via RPM Fusion. Monitor these updates carefully, as new kernel versions may temporarily break driver compatibility until updated packages release.


To switch between the nouveau and NVIDIA drivers, you can blacklist one or the other. If you need to revert to nouveau, remove the NVIDIA driver packages and regenerate your initramfs. Conversely, ensure nouveau remains blacklisted for NVIDIA drivers to function properly. Check for available driver updates with:

sudo dnf check-update nvidia*

After major driver updates or kernel changes, reboot your system and verify functionality with nvidia-smi again. Keep the akmod package installed, as it automatically rebuilds kernel modules when new kernels install, preventing nvidia kernel module missing issues during routine updates.

 
 
 

Comments


bottom of page