How to Install NVIDIA Drivers on Fedora 37 or 36

For individuals looking to enhance their gaming or graphic design experience, it is crucial to have the fastest drivers possible. By default, most modern Linux distributions come with open-source Nouveau drivers installed. However, these drivers are often outdated and lack support for the latest hardware features and software technology. In contrast, NVIDIA drivers provide a much better performance and experience, often with substantial improvements in speed and performance.

This guide will walk you through installing NVIDIA drivers on Fedora Linux from either the RPM Fusion repository or the NVIDIA CUDA repository using the command line terminal.

Features and Benefits of using NVIDIA drivers on Fedora over the default:

  1. Improved Performance: NVIDIA drivers are known for superior performance compared to the default open-source Nouveau drivers.
  2. Latest Hardware Support: NVIDIA drivers are updated regularly to support the latest hardware and software technology, providing a seamless experience.
  3. Stable Release Cycles: NVIDIA drivers follow stable release cycles, ensuring a consistent and reliable experience for users.
  4. Optimal Gaming Experience: NVIDIA drivers provide an optimal gaming experience with improved graphics, faster frame rates, and better overall performance.
  5. Better Graphic Design Performance: NVIDIA drivers enhance graphic design applications’ performance, making work smoother and faster.

With these benefits in mind, let’s dive into installing NVIDIA drivers on Fedora Linux.

Update Fedora

Before beginning the installation process, it is essential to update your system to ensure all existing packages are up-to-date. This will help avoid conflicts during the installation of drivers such as graphic card drivers and kernels. To update your Fedora system, run the following command in the terminal:

sudo dnf upgrade --refresh

Remove Previous Nvidia Installations

Installing NVIDIA drivers over the standard packages can result in unexpected issues, especially if you install the NVIDIA drivers from the default repository and then import the NVIDIA CUDA repository and try to reinstall or upgrade directly over those packages. To avoid conflicts, it is recommended to stick to one installation method and remove previous installations before switching to a different method.

To remove traces of previous NVIDIA installations, run the following command:

sudo dnf autoremove nvidia* --purge

If you installed the NVIDIA drivers using the “.run” file, use the following command to remove the installation:

sudo /usr/bin/nvidia-uninstall

To remove the CUDA toolkit runfile installation, use the following command:

sudo /usr/local/cuda-X.Y/bin/cuda-uninstall

Method 1: Install Nvidia Drivers from Nvidia CUDA Repository

The first method for installing NVIDIA drivers on Fedora Linux is directly from the NVIDIA CUDA repository. This method is recommended as it is built specifically for each version of Fedora by the NVIDIA team.

To import the CUDA repository for your Fedora system, ensure you get the correct repository that matches your Fedora version.

Import Nvidia CUDA Repository for Fedora 37:

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

Import Nvidia CUDA Repository for Fedora 36:

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

Next, install the required dependencies.

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

You can also list the NVIDIA RPM modules using the following command:

sudo dnf module install nvidia-driver:latest-dkms

Example output:

You can also list the NVIDIA RPM modules using the following command:

sudo dnf module list nvidia-driver

Example output:

Alternatively, you can install the recently released NVIDIA open-source branch. However, users have reported issues with the open-source drivers on Fedora and Ubuntu and recommend using the proprietary version.

sudo dnf module install nvidia-driver:open-dkms

It is always recommended to use a branch with “-dkms” added to avoid potential issues in the future when upgrading your system.

Additionally, it has been reported that some users have experienced issues when using the NVIDIA open-source drivers on Fedora and Ubuntu but were able to resolve these issues by switching back to the proprietary NVIDIA drivers. For individuals who do not prioritize using open-source drivers, utilizing the proprietary version of NVIDIA drivers is recommended.

Install Nvidia Drivers – RPM Fusion Method

The second method for installing NVIDIA drivers on Fedora Linux is through the RPM Fusion repository, which has been the primary method for Fedora users for a long time. However, as a third-party repository, updates may not be as prompt as the NVIDIA CUDA repository.

To install NVIDIA drivers through the RPM Fusion repository, first import 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

After importing the RPM Fusion repository, run the following command to install the latest NVIDIA drivers on your Fedora system:

sudo dnf install akmod-nvidia

You can also install the CUDA driver’s support if required.

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

Once everything is installed, restart your Fedora system. By default, this will also disable the Nouveau drivers automatically.

reboot

Install NVIDIA Legacy Drivers

For individuals who upgraded Fedora and require older drivers as their graphics card is no longer supported in NVIDIA’s newest driver packages, the following options are available for installing legacy drivers. Please note that these drivers are often not updated as frequently and may have security flaws.

For 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

For 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

Verify NVIDIA Drivers Installation

To verify the NVIDIA driver installation, go to “Activities > Show Applications > NVIDIA X Server” or run the following command in the terminal:

nvidia-settings

Example if installation successful:

You can also use the following CLI command to verify the installation:

nvidia-smi

Example if installation successful:

Additional Commands & Tips

Update Nvidia Drivers

To update the NVIDIA drivers, use the standard `dnf upgrade –refresh` command. This will check for updates in the RPM Fusion repository and other Fedora packages.

sudo dnf upgrade --refresh

Remove Nvidia Drivers and RollBack

If you no longer want to use the NVIDIA official drivers, use the following command:

For the RPM Fusion Removal method:

sudo dnf remove akmod-nvidia xorg-x11-drv-nvidia-cuda

For the NVIDIA RPM Removal method:

sudo dnf module remove nvidia-driver:latest-dkms

This will remove all dependencies installed, and after removal, you must restart your system. During the restart, the process will re-enable the Nouveau drivers, allowing for an easy switch back and forth if needed.

reboot

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 a bit extra work to get them set up and running correctly, but in my experience, it is worth it.

Frequently Asked Questions

Q: What are the benefits of using NVIDIA drivers on Fedora over the default?

A: The NVIDIA drivers provide a better performance, improved speed, and support for the latest hardware features and software technology compared to the default Nouveau drivers.

Q: What is the difference between the NVIDIA CUDA repository and RPM Fusion method for installing NVIDIA drivers?

A: The NVIDIA CUDA repository is built for each version of Fedora by the NVIDIA team and is updated more promptly, while the RPM Fusion method is a third-party repository with less frequent updates. The NVIDIA CUDA repository also allows for the installation of proprietary and open-source NVIDIA drivers, while the RPM Fusion method focuses on proprietary drivers.

Q: What are the NVIDIA legacy drivers, and when should they be used?

A: The NVIDIA legacy drivers are older drivers for graphics cards that are no longer supported in the newest NVIDIA driver packages. After upgrading Fedora, they should be used if the individual’s graphics card is no longer supported in the most recent NVIDIA drivers.

Q: How do I verify the NVIDIA driver installation on Fedora?

A: You can verify the NVIDIA driver installation by going to “Activities > Show Applications > NVIDIA X Server” or using the “nvidia-settings” or “nvidia-smi” command in the terminal.

Q: Can I switch between the NVIDIA drivers and the default Nouveau drivers on Fedora?

A: Yes, you can switch between the NVIDIA drivers and the default Nouveau drivers by removing the NVIDIA drivers and restarting the system. The process will automatically re-enable the Nouveau drivers.

Q: Is it necessary to install both the NVIDIA drivers and CUDA support on Fedora?

A: No, it is not necessary to install both the NVIDIA drivers and CUDA support. However, if you are experiencing issues, installing the CUDA support can sometimes solve problems.

Q: What is the difference between the proprietary NVIDIA drivers and the open-source NVIDIA drivers?

A: The proprietary NVIDIA drivers are closed-source and developed and supported by NVIDIA, while the open-source NVIDIA drivers are developed and maintained by the community. The proprietary NVIDIA drivers offer better performance and support for the latest hardware features and software technology compared to the open-source drivers.

Q: Is it necessary to remove previous NVIDIA installations before installing new drivers?

A: Yes, it is necessary to remove previous NVIDIA installations to avoid conflicts and unexpected issues when installing new drivers.

Q: What is the “nvidia-smi” command, and what does it do?

A: The “nvidia-smi” command is a command line tool that displays information about the NVIDIA GPU installed on the system, including the driver version, GPU utilization, and temperature.

Q: Can I use Fedora’s NVIDIA drivers for gaming and graphic design?

A: Yes, you can use NVIDIA drivers for both gaming and graphic design on Fedora. Having the fastest drivers is essential for gaming and graphic design, and upgrading to proper NVIDIA drivers will provide a better experience.

Q: What is RPM Fusion on Fedora?

A: RPM Fusion is a third-party repository for Fedora that provides additional software packages not included in the official Fedora repositories.

Q: What is the difference between RPM Fusion Free and Non-Free on Fedora?

A: RPM Fusion Free provides open-source software packages, while RPM Fusion Non-Free provides proprietary software packages that are not open-source.

Q: Does RPM Fusion contain any other software besides NVIDIA drivers?

A: Yes, RPM Fusion contains other software packages in addition to NVIDIA drivers, including multimedia codecs, proprietary software, and other packages not included in the official Fedora repositories.

Q: What is the “dnf module list” command on Fedora Linux, and how does it relate to listing the NVIDIA drivers from the NVIDIA CUDA repository?

A: The “dnf module list” command on Fedora Linux is used to list all available modules and their packages. When used with the “nvidia-driver” argument, this command will list the available NVIDIA drivers from the NVIDIA CUDA repository. This can be useful for checking which version of the NVIDIA drivers are currently installed or for listing the available versions to install.

Q: What are the GPG key import prompts when importing and installing the NVIDIA drivers from the CUDA or RPM Fusion in my command terminal?

A: The GPG key import prompts are security measures to verify the authenticity of the software repository you are importing and installing. When importing the NVIDIA CUDA repository or the RPM Fusion repository, you may be prompted to import the GPG key for the repository, which is used to verify the integrity and authenticity of the software packages in the repository. By importing the GPG key, you are ensuring that the packages you are installing have not been tampered with and come from a trusted source.

Share to...