Fedora

How to Install the NVIDIA Drivers on Fedora Workstation 38

Installing the NVIDIA GPU drivers is the first thing that you will want to do on your Fedora Workstation 38 operating system if you have an installed NVIDIA GPU on your computer.

In this article, we will show you how to install the NVIDIA drivers on Fedora Workstation 38 from the RPM Fusion repository. Although this article is for Fedora Workstation 38, it should work without any modifications on Fedora Workstation 37 and future versions of Fedora workstation. This article should also work on other spins of Fedora.

Topic of Contents:

Checking If NVIDIA GPU Is Installed on Your Computer

To check whether you have an installed NVIDIA GPU on your computer, run the following command:

$ lspci | grep -Ei 'VGA|3D'

As you can see, we have an installed NVIDIA GeForce GTX 1050 Ti GPU on our computer. You may have a different installed NVIDIA GPU.

By default, Fedora Workstation 38 uses the open-source nouveau GPU drivers if you have an installed NVIDIA GPU on your computer instead of the proprietary/official NVIDIA drivers.

$ lsmod | grep nouveau
$ lsmod | grep nvidia

Upgrading the Installed Packages of Fedora Workstation 38

For the proprietary/official NVIDIA GPU drivers to work on Fedora Workstation 38, you have to update all the existing/pre-installed packages of Fedora Workstation 38.

To update all the pre-installed packages of Fedora Workstation 38, run the following command:

$ sudo dnf update --refresh

The DNF package repository cache of Fedora Workstation 38 is being updated and the package update is being prepared. It takes a few seconds to complete.

The packages are to be updated and the download size of the packages should be listed. To confirm the update, press Y and then press <Enter>.

The updates are being downloaded. It takes a while to complete.

Once you see the following prompt, press Y and then press <Enter> to continue.

The updates are being installed. It takes a while to complete.

At this point, the updates should be installed.

For the changes to take effect, restart your Fedora Workstation 38 machine with the following command:

$ sudo reboot

Installing the Kernel Headers and Development Libraries on Fedora Workstation 38

For the proprietary/official NVIDIA GPU drivers to work, you also need to install the Linux kernel development tools on your Fedora Workstation 38 machine.

To install the Linux kernel development tools on Fedora Workstation 38, run the following command:

$ sudo dnf install kernel-headers kernel-devel dkms

To confirm the installation, press Y and then press <Enter>.

The Linux kernel development packages are being downloaded. It takes a while to complete.

The Linux kernel development packages are being installed. It takes a while to complete.

At this point, the Linux kernel development packages should be installed.

Enabling the RPM Fusion Repositories on Fedora

The proprietary/official NVIDIA GPU drivers packages are available in the RPM Fusion repository of Fedora Workstation 38. RPM Fusion is a third-party package repository for RPM-based Linux distributions such as Fedora Workstation 38. RPM Fusion repository is not enabled by default on Fedora Workstation 38. To enable the RPM Fusion repository on Fedora Workstation 38, read the article on How to Enable RPM Fusion Repository on Fedora.

Updating the Fedora Package Repository Cache

Once you enabled the RPM Fusion repository on Fedora Workstation 38, update the DNF package repository cache with the following command:

$ sudo dnf makecache

The DNF package repository cache of Fedora Workstation 38 should be updated.

Installing the NVIDIA Drivers on Fedora Workstation 38 from RPM Fusion Repository

To install the proprietary/official NVIDIA GPU drivers on Fedora Workstation 38 from the RPM fusion repository, run the following command:

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

To confirm the installation, press Y and then press <Enter>.

The NVIDIA GPU drivers packages and the required dependency packages are being downloaded. It takes a while to complete.

If you see the following prompt, press Y and then press <Enter> to continue.

The NVIDIA GPU drivers packages and the required dependency packages are being installed. It takes a while to complete.

At this point, proprietary/official NVIDIA drivers should be installed on your Fedora Workstation 38 machine.

For the changes to take effect, reboot your Fedora Workstation 38 machine with the following command:

$ sudo reboot

Checking Whether the NVIDIA Drivers Are Working on Fedora

To confirm whether the proprietary/official NVIDIA drivers are working on your Fedora Workstation 38 machine, run the following commands. You should see some similar outputs if the proprietary/official NVIDIA drivers are working correctly and the open-source nouveau drivers are no longer used:

$ lsmod | grep nvidia
$ lsmod | grep nouveau

You can also run the nvidia-smi program to confirm whether the proprietary/official NVIDIA drivers are working.

$ nvidia-smi

If the proprietary/official nvidia drivers are working correctly, you will see the installed NVIDIA drivers version number[1] and the processes of Fedora Workstation 38 that are using the NVIDIA GPU[2].

To confirm whether the proprietary/official NVIDIA drivers are working, you can open the NVIDIA X Server Settings app from the “Application Menu” of Fedora Workstation 38.

If the proprietary/official NVIDIA drivers are working, you will see information on the installed NVIDIA GPU of your computer in the NVIDIA X Server Settings app.

Installing the NVIDIA VAAPI/VDPAU Drivers on Fedora Workstation 38

If you want to enable the video acceleration on video players like VLC, you need to install the NVIDIA VAAPI/VDPAU drivers on Fedora Workstation 38.

To install the NVIDIA VAAPI/VDPAU drivers on Fedora Workstation 38, run the following command:

$ sudo dnf install nvidia-vaapi-driver libva-utils vdpauinfo

To confirm the installation, press Y and then press <Enter>.

The NVIDIA VAAPI/VDPAU drivers should be installed.

To check whether the NVIDIA VAAPI driver was installed correctly, run the following command:

$ sudo vainfo

To check whether the NVIDIA VDPAU driver was installed correctly, run the following command:

$ sudo vdpauinfo

Uninstalling the NVIDIA Drivers from Fedora Workstation 38

If, for any reason, you want to remove the proprietary/official NVIDIA drivers from Fedora Workstation 38, run the following command:

$ sudo dnf remove *nvidia*

To confirm the uninstall action, press Y followed by <Enter>.

The proprietary/official NVIDIA drivers are being uninstalled from Fedora Workstation 38. It takes a while to complete.

At this point, the proprietary/official NVIDIA drivers should be uninstalled.

For the changes to take effect, reboot your Fedora Workstation 38 machine.

$ sudo reboot

The NVIDIA kernel modules won’t be loaded the next time your Fedora Workstation 38 boots. This means that the proprietary/official NVIDIA drivers are uninstalled from your Fedora Workstation 38 machine.

$ lsmod | grep nvidia

Conclusion

We showed you how to install the proprietary/official NVIDIA drivers on Fedora Workstation 38 from the RPM Fusion package repository. We also showed you how to install the NVIDIA VAAPI/VDPAU drivers on Fedora Workstation 38 to enable the video playback acceleration and how to uninstall the proprietary/official NVIDIA drivers from Fedora Workstation 38 as well.

References:

About the author

Shahriar Shovon

Freelancer & Linux System Administrator. Also loves Web API development with Node.js and JavaScript. I was born in Bangladesh. I am currently studying Electronics and Communication Engineering at Khulna University of Engineering & Technology (KUET), one of the demanding public engineering universities of Bangladesh.