Skip to main content
  1. Posts/

Guide: How to Install NVIDIA Drivers on Fedora

·708 words·4 mins·
NVIDIA Driver Fedora
Nofal Briansah
Author
Nofal Briansah
Holaaa :)
Table of Contents

TL;DR
#

You can install NVIDIA drivers on Fedora via RPM Fusion for easy setup or manually with the NVIDIA package.


Introduction
#

Some Linux distributions, like Pop!_OS, come with NVIDIA drivers included by default in their ISO images. Unfortunately, Fedora does not provide NVIDIA drivers out-of-the-box, so you’ll need to install them manually. This guide provides instructions on how to install NVIDIA drivers on Fedora.

nvdia

Note: Make sure to read through the entire guide first before performing the installation to ensure a smooth process. This guide is based on Fedora 41 and NVIDIA GeForce 940MX.

fastfetch

To begin, determine your GPU model by running:

/sbin/lspci | grep -Ei 'VGA|3D'

determine gpu

Once you know your GPU model, you can proceed with installing the appropriate NVIDIA drivers.

Install NVIDIA Driver
#

There are two main methods for installing NVIDIA drivers:

  1. Using RPM Fusion (Recommended)
  2. Installing manually from the official NVIDIA package

Using RPM Fusion (Recommended)#

RPM Fusion is a third-party repository that provides free and non-free software for Fedora, including NVIDIA drivers. This method simplifies the installation process and integrates better with Fedora’s package management system.

Prerequisites
#

  1. Update Your System
    First, ensure your system is up to date:

    sudo dnf update
    

    If you’re not using the latest kernel, reboot your system.

  2. Enable RPM Fusion Repositories
    Add free and nonfree RPM Fusion repositories:

    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
    

Installation
#

  1. Determine Which Driver to Install
    First, identify your GPU model to select the appropriate NVIDIA driver. You can install the latest driver or choose a legacy version depending on your hardware.

    • Latest Driver (Recommended for most users)

      To install the latest NVIDIA driver:

      sudo dnf install akmod-nvidia
      
    • For Legacy Drivers
      To install a specific version, replace Version with the version you need:

      sudo dnf install akmod-nvidia-Versionxx  # Example: akmod-nvidia-470xx
      

      Additional Packages (Optional)

    • CUDA (for CUDA development)

      sudo dnf install xorg-x11-drv-nvidia-cuda
      
    • NVENC/NVDEC (Hardware Encoding/Decoding)

      sudo dnf install xorg-x11-drv-nvidia-cuda-libs
      
    • VDPAU/VAAPI (Video Decoding Acceleration)

      sudo dnf install nvidia-vaapi-driver libva-utils vdpauinfo
      
  2. Install the Driver
    Example: Install the latest driver with CUDA support for encoding/decoding and video acceleration:

    sudo dnf install akmod-nvidia xorg-x11-drv-nvidia-cuda xorg-x11-drv-nvidia-cuda-libs nvidia-vaapi-driver libva-utils vdpauinfo
    

    install

  3. Wait for Kernel Module Compilation
    The kernel module will be built, which can take a few minutes. After that, reboot your system.

    sudo reboot
    
  4. Verify the Installation
    Once rebooted, verify that the NVIDIA driver is installed correctly:

    nvidia-smi
    

    nvdia-smi

Install Manually from NVIDIA’s Official Website
#

This method involves manually downloading the official NVIDIA drivers from the NVIDIA website. This gives you more control over which driver version you install.

Prerequisites
#

  1. Download the NVIDIA Driver
    Visit the NVIDIA Driver Download page and download the driver package for your GPU.

    nvdia-web

  2. Disable Nouveau Driver
    Disable the Nouveau open-source driver to avoid conflicts with the NVIDIA driver:

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

    nouveau

  3. Regenerate Initramfs
    Regenerate the initramfs to apply the changes:

    sudo dracut --force
    
  4. Switch to Text Mode (Multi-User Mode)
    To avoid conflicts with the graphical interface, switch to a text-based login:

    sudo systemctl set-default multi-user.target
    
  5. Reboot the System
    Reboot your system into multi-user mode:

    sudo reboot
    

    After rebooting, the system will enter CLI (Command Line Interface) mode without a graphical interface. Don’t panic this is expected because we temporarily disabled the GUI as part of the installation process.

Installation
#

  1. Log in to your account

    • Enter your username and press Enter.
    • Enter your password (it won’t be visible as you type), then press Enter.
  2. Set Execution Permissions
    The downloaded NVIDIA driver file is usually located in the Downloads folder. First, navigate to the folder and make the file executable:

    cd ~/Downloads
    chmod +x NVIDIA-Linux-*.run
    
  3. Install the Driver
    Run the installer:

    sudo ./NVIDIA-Linux-*.run
    

    During installation:

    • Enable 32-bit compatibility libraries (if prompted)

    nvdia-smi

    • Enable DKMS kernel module support (for automatic updates)

    nvdia-smi

    nvdia-smi

  4. Re-enable the GUI
    Since we switched to text mode (CLI) earlier, we now need to restore the graphical interface (GUI). This will allow you to boot back into your desktop environment.

    To switch back to GUI mode, run:

    sudo systemctl set-default graphical.target
    
  5. Reboot Your System
    Once the installation is complete, reboot your system:

    sudo reboot
    
  6. Verify the Installation
    After rebooting, verify that the NVIDIA driver is installed and working:

    nvidia-smi
    

    nvdia-smi

References
#