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.
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.
…
To begin, determine your GPU model by running:
/sbin/lspci | grep -Ei 'VGA|3D'
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:
- Using RPM Fusion (Recommended)
- 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#
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.
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#
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, replaceVersion
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
Install the Driver
Example: Install the latest driver with CUDA support for encoding/decoding and video acceleration:```bash sudo dnf install akmod-nvidia xorg-x11-drv-nvidia-cuda xorg-x11-drv-nvidia-cuda-libs nvidia-vaapi-driver libva-utils vdpauinfo ```
Wait for Kernel Module Compilation
The kernel module will be built, which can take a few minutes. After that, reboot your system.sudo reboot
Verify the Installation
Once rebooted, verify that the NVIDIA driver is installed correctly:nvidia-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#
Download the NVIDIA Driver
Visit the NVIDIA Driver Download page and download the driver package for your GPU.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
Regenerate Initramfs
Regenerate the initramfs to apply the changes:sudo dracut --force
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
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#
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
.
- Enter your username and press
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
Install the Driver
Run the installer:sudo ./NVIDIA-Linux-*.run
During installation: - Enable 32-bit compatibility libraries (if prompted)
- Enable **DKMS kernel module** support (for automatic updates)
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
Reboot Your System
Once the installation is complete, reboot your system:sudo reboot
Verify the Installation
After rebooting, verify that the NVIDIA driver is installed and working:nvidia-smi