You may know that by default Fedora Linux distribution comes with an open-source Nouveau driver, but in case you want to disable it and switch to the proprietary NVIDIA driver, you need to manually set it up.
So, if you’re looking to get rid of the Nouveau driver on Fedora Linux to enhance your gaming or professional user experience and get the most out of your GPU, let me show you how to do it in various ways.
Install NVIDIA Drivers on Fedora Linux
In this article, I’ll be installing the NVIDIA driver on Fedora 37 workstation using both graphical and command line methods. You can follow the same process for other Fedora versions as well.
Before getting to the main topic, let’s see how you can also check installed GPUs and used driver information on your system.
Check GPU Driver Info On Fedora Linux
For checking, we can use the pre-installed lspci Linux utility that lists all devices connected to the system.
Run the following command to check your installed GPU driver only:
$ lspci | grep -E "VGA"
As you can see, I have Virtio GPU installed on my Fedora as I’m running it on a virtual machine.
You can also check whether the NVIDIA driver is installed on Fedora or not using the below command:
$ lspci | grep -E “Nvidia”
If you don’t get any result, it means NVIDIA drivers are not used on Fedora Linux. After installing, you can run the same command to recheck.
Install NVIDIA Drivers on Fedora Using Graphical
Let’s start with the easiest step for those who prefer hovering the mouse over entering the dark room of the command line.
1. Launch the Software Centre application of Fedora and go to Software Repositories from the top right selection box.
2. Clicking on Software Repositories will open a window. Inside the window, scroll a bit and turn on “Enable third-party repositories”.
3. Now close the Software Repository window and switch to the Updates section of the Software Centre app. It will take time to refresh the gnome-software cache.
4. Once the refresh is done, close the application, relaunch, and search for “NVIDIA” in Explore section.
5. Select the NVIDIA Linux Graphics Driver and click on the Install button.
6. Once installation is completed, search for the NVIDIA application in the Application menu. If you see any result i.e. NVIDIA X Server Settings app, it means NVIDIA drivers are running now.
In case, you wish to uninstall it, go to Software Centre –> Installed and look for NVIDIA Linux Graphics Driver. Open it and you will be able to manually uninstall it with a click of a button.
Install NVIDIA Drivers on Fedora Using Command Line
Let’s come to the command line method where all you need is to type and run the command inside the terminal. For installing the NVIDIA driver on Fedora using the terminal, we will use RPM Fusion Repositories.
Before anything else, the first thing you should do is update the DNF package repository cache and all existing packages on your Fedora to avoid any further intermittent issues using the following command:
$ sudo dnf makecache $ sudo dnf upgrade --refresh -y
Now let’s add the RPM Fusion free and non-free repositories both on the system to retrieve all required NVIDIA driver packages on Fedora Linux.
To install the RPM Fusion Free repository, execute the following command:
$ sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
Likewise, to install the RPM Fusion Non-Free repository, execute the following command:
$ sudo dnf install https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
As usual, if you install anything, we need to verify whether it is installed or not. So for the RPM Fusion repository what we need to do for confirming it is search for the akmod-nvidia package using the dnf utility.
$ sudo dnf search akmod-nvidia
If you are able to see any results that means you are good to go for the next and final step of installing NVIDIA Drivers on Fedora Linux using the terminal.
So, run the below command to install the most recent version of the NVIDIA driver:
$ sudo dnf install akmod-nvidia
For Legacy GeForce 400/500 models, you can run:
$ sudo dnf install xorg-x11-drv-nvidia-390xx akmod-nvidia-390xx
For Legacy GeForce 8/9/200/300, you can run:
$ sudo dnf install xorg-x11-drv-nvidia-340xx akmod-nvidia-340xx
While installing, if you get any prompt, type Y
and press Enter to confirm the installation.
Once installation successfully completes, you also need to reboot your system to make your changes come into effect.
$ sudo reboot
Finally, it’s time to open the NVIDIA X Server Settings app by simply running the following command in the terminal:
$ nvidia-settings
In any scenario, if you wish to remove the NVIDIA driver on Fedora, just execute a single line of script to uninstall the akmod-nvidia package:
$ sudo dnf remove akmod-nvidia
Conclusion
Coming to the end, we learned how to install NVIDIA drivers on Fedora Linux applicable for all recent desktop versions using two methods: graphical way via Software Centre and command line via RPM Fusion repositories.
As per your level of competencies, you can go for any of the two methods as both will help you to install your required NVIDIA drivers.