This guide will demonstrate how to install Nvidia Drivers on Fedora 39 or 38 Linux utilizing the command-line terminal with three different methods to suit various requirements for installation: Nvidia RPM, RPM Fusion, or Manual download and installation.
Upgrading your Fedora Linux with NVIDIA drivers can be a game-changer for both your system’s performance and your overall user experience. The transition from default or generic drivers to NVIDIA’s proprietary drivers means unlocking new levels of graphics performance, enjoying enhanced stability, and gaining access to the latest features and technologies tailored to your NVIDIA graphics card. Whether you’re a gamer seeking the ultimate experience, a professional in need of reliable graphics performance, or simply someone who wants to maximize the potential of their hardware, installing NVIDIA drivers is a smart move.
Key Advantages of NVIDIA Drivers on Fedora Linux:
- Tailored Performance: Designed specifically for NVIDIA GPUs, ensuring you get the best out of your system for any graphics-intensive task.
- Cutting-Edge Features: Access to the latest in gaming and multimedia technologies, including ray tracing and DLSS, for a superior experience.
- Stability and Compatibility: Direct support from NVIDIA guarantees a smooth operation with the latest GPU models, minimizing compatibility issues.
- Consistent Updates: Regular driver updates from NVIDIA improve performance, add new features, and fix bugs, keeping your system on the cutting edge.
Given these compelling advantages, opting for NVIDIA drivers on Fedora Linux is a strategic choice for anyone looking to enhance their computing experience. Let’s move forward and delve into the practical steps for installing NVIDIA drivers on Fedora, ensuring you can enjoy these benefits without delay.
Remove Previous NVIDIA Installations from Fedora
If you’ve previously installed NVIDIA drivers on your Fedora system and are considering a different installation method outlined in this guide, proceed with caution. Combining multiple NVIDIA repositories can lead to driver conflicts. It’s advisable to revert to the default drivers before initiating a new NVIDIA driver installation. If you haven’t installed any NVIDIA drivers yet, you can skip this section.
Method 1: DNF Method Removal of NVIDIA Drivers from Fedora
To remove traces of previous NVIDIA installations, run the following command:
sudo dnf remove nvidia* --allowerasing
Remember to delete the repository files, depending on the method you installed them with. For .runfile installations, this is not required.
Method 2: Removing Runfile NVIDIA Driver Installations from Fedora
If you’ve opted for the “.run” file method to install NVIDIA drivers (a method that’s less recommended due to superior alternatives like the NVIDIA CUDA repository), you’ll need a distinct removal process.
To uninstall the runfile type of installation, execute:
sudo /usr/bin/nvidia-uninstall
Method 3: Removing NVIDIA CUDA Toolkit Runfile Installations from Fedora
In instances where the CUDA toolkit was installed using the runfile approach, it’s essential to remove it. Execute the command below:
sudo /usr/local/cuda-X.Y/bin/cuda-uninstall
Select Installation Method of NVIDIA Drivers for Fedora
Method 1: Install NVIDIA Drivers via NVIDIA Cuda RPM on Fedora
Before installing, ensure your system is updated to prevent potential conflicts between graphic card drivers and kernels. To update your Fedora system, use the following command:
sudo dnf upgrade --refresh
Select the appropriate one corresponding to your Fedora version to integrate the CUDA repository into your Fedora system.
Import Nvidia CUDA Repository for Fedora 39:
sudo dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/fedora39/x86_64/cuda-fedora39.repo
Import Nvidia CUDA Repository for Fedora 38:
Note: Nvidia did not make 38 branch drivers; if you are still on Fedora 38, I would strongly urge you to upgrade to Fedora 39 and utilize the RPM repo above; if not, use the manual method below.
Proceed to install the necessary dependencies for NVIDIA Drivers:
sudo dnf install kernel-headers kernel-devel tar bzip2 make automake gcc gcc-c++ pciutils elfutils-libelf-devel libglvnd-opengl libglvnd-glx libglvnd-devel acpid pkgconfig dkms
To view the NVIDIA RPM modules, execute:
sudo dnf module list nvidia-driver
sudo dnf module install nvidia-driver:latest-dkms
To install the latest NVIDIA drivers using the DKMS method, execute:
For those interested, the latest NVIDIA open-source branch is available for installation, which can be installed with the following command:
sudo dnf module install nvidia-driver:open-dkms
Opting for a branch with the “-dkms” suffix is advisable to circumvent potential challenges during system upgrades. Moreover, many users have reverted to the proprietary NVIDIA drivers due to reported issues with the NVIDIA open-source drivers on Fedora and Ubuntu. If open-source isn’t a priority, the proprietary NVIDIA drivers are recommended.
Method 2: Install NVIDIA Drivers via RPM Fusion on Fedora
RPM Fusion has long been a favored repository for Fedora users to install NVIDIA drivers. However, being a third-party repository, it might not offer updates as swiftly as the NVIDIA CUDA repository.
To leverage the RPM Fusion repository for NVIDIA driver installation, initiate by integrating the following 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
With the RPM Fusion repository in place, execute the following to install the latest NVIDIA drivers:
sudo dnf install akmod-nvidia
For those needing CUDA driver support, it can be installed with:
sudo dnf install xorg-x11-drv-nvidia-cuda
Upon completing the installation, reboot your Fedora system. This action will also auto-disable the Nouveau drivers:
sudo reboot
Install NVIDIA Legacy Drivers on Fedora (Situational for Old NVIDIA Cards only)
Legacy drivers are available for users with older NVIDIA cards no longer supported by the latest driver packages. It’s worth noting that these legacy drivers might not receive frequent updates and could have vulnerabilities.
If you have GeForce 600/700 NVIDIA series drivers, run the following command:
sudo dnf install xorg-x11-drv-nvidia-470xx akmod-nvidia-470xx xorg-x11-drv-nvidia-470xx-cuda
The GeForce 400/500 NVIDIA series drivers, run the following command:
sudo dnf install xorg-x11-drv-nvidia-390xx akmod-nvidia-390xx xorg-x11-drv-nvidia-390xx-cuda
For GeForce 8/9/200/300 NVIDIA series drivers, run the following command:
sudo dnf install xorg-x11-drv-nvidia-340xx akmod-nvidia-340xx xorg-x11-drv-nvidia-340xx-cuda
Method 3: Install NVIDIA Drivers via Runfile on Fedora
The Runfile method offers a manual approach to installing NVIDIA drivers on Fedora Linux. It provides flexibility, allowing you to select any driver version directly from NVIDIA’s official website.
Download the NVIDIA Driver on Fedora
Begin by navigating to the NVIDIA website to download the appropriate driver version for your graphics card. This method’s advantage is the ability to handpick any version, ensuring compatibility with specific needs or applications.
After downloading, the file will typically reside in the ~/Downloads
directory, unless you’ve chosen a different download location.
Disable the Nouveau Drivers
To ensure a smooth installation, you need to disable the Nouveau drivers. Execute the following command in your terminal:
echo -e "blacklist nouveau\noptions nouveau modeset=0" | sudo tee /etc/modprobe.d/blacklist-nouveau.conf
This command performs two primary actions:
blacklist nouveau
: Prevents the system from auto-loading the Nouveau driver module.options nouveau modeset=0
: Disables kernel mode-setting, a method used to set the console’s video mode. This step is crucial when installing proprietary NVIDIA drivers.
Regenerate initramfs and Reboot
Before the changes take effect, regenerate the initramfs:
sudo dracut --force
Switch to CLI mode by disabling the GUI mode:
sudo systemctl set-default multi-user.target
Now reboot using the following command:
sudo reboot
Note: If you miss this step, you can temporarily switch to CLI mode using:
sudo systemctl isolate multi-user.target
Install the NVIDIA Driver
After rebooting, you’ll be in CLI mode. Navigate to the directory containing the downloaded NVIDIA Runfile:
cd ~/Downloads
Initiate the installation process:
sudo bash NVIDIA-Linux-x86_64-*
Adjust the command if you’ve downloaded a different version for Fedora.
During the installation, you’ll encounter several prompts:
32-bit Compatibility Libraries: Decide whether to install NVIDIA’s 32-bit Compatibility Libraries. While this is a user choice, installing them can benefit specific applications.
Kernel Module Sources with DKMS: This prompt inquires if you’d like the kernel module sources to register with DKMS. Opting for ‘YES’ ensures that DKMS will auto-build a new module if your kernel updates.
NVIDIA X Driver Configuration: NVIDIA will ask if it should auto-run the nvidia-xconfig
utility. This action updates your X configuration file, ensuring the NVIDIA X driver is utilized upon restarting. It also backs up any existing X configuration files. It’s advisable to select ‘YES’ for a seamless experience.
Upon completing these steps, you’ve successfully installed the NVIDIA drivers via the Runfile method on Fedora Linux.
Re-enable GUI and Reboot
Before concluding, switch back to the GUI login:
sudo systemctl set-default graphical.target
Finally, reboot your system:
sudo reboot
Confirming NVIDIA Drivers Installation on Fedora
After installing the NVIDIA drivers on your Fedora system, it’s crucial to ensure that the installation was successful and that the drivers function as expected. This verification step provides confidence in the system’s graphics performance and stability.
Accessing NVIDIA X Server Settings
One of the straightforward methods to verify the NVIDIA driver installation is by accessing the NVIDIA X Server settings. This graphical interface provides detailed information about the NVIDIA GPU and allows you to adjust various parameters.
To access the NVIDIA X Server settings:
- Navigate to “Activities” on your Fedora desktop.
- Proceed to “Show Applications.”
- Locate and click on “NVIDIA X Server.”
Alternatively, if you prefer using the terminal, you can launch the NVIDIA X Server settings with the following command:
nvidia-settings
Using the Command-Line Interface (CLI)
For those who are more comfortable with the command line or are working on a headless server, the NVIDIA System Management Interface (nvidia-smi
) provides a concise overview of the GPU status, driver version, and other pertinent details.
Execute the following command in your terminal:
nvidia-smi
Conclusion
If you are looking for better graphics drivers or your system is not working well with the Nouveau driver, I suggest installing the NVIDIA proprietary drivers. It may take some extra work to get them set up and running correctly, but in my experience, it is worth it.
It took a few days, but it looks like there’s an inherent incompatibility between the latest Nvidia drivers (545.23.08-1.fc37) and Linux kernel 6.7.3 on Fedora 39. However, I was just able to install kernel 6.7.4 on FC39 and reinstall the nvidia drivers and that seems to have fixed whatever was broken. Hope this helps others.
Not sure when you added the repo for Fedora 39, but as of 6 Feb 24, there’s nothing in there (https://developer.download.nvidia.com/compute/cuda/repos/fedora39/x86_64/). Compare with the repo for Fedora 37 (https://developer.download.nvidia.com/compute/cuda/repos/fedora37/x86_64/). Bottom line, I can install drivers from the Fedora 37 repo, but they don’t seem to work with version 6.7 of the Linux Kernel. I can’t install anything from the Fedora 39 repo.
Method 1 worked for me
Rtx 3050
great work
thanks a lot