Fedora and NVIDIA
In my previous article “Fedora 42 Configuration”, I outlined the software and dependencies I install as part of my standard configuration for Fedora Linux.
The focus of that article was a laptop installation (Framework Laptop 13), which includes an AMD processor with integrated AMD graphics.
As it stands today, an all-AMD system continues to be the simplest way to get Linux up and running, thanks to the open source drivers supported by AMD.
Although I favour AMD processors, I still prefer NVIDIA when it comes to dedicated graphics. The reason is simple, NVIDIA offer the best performance, with the most innovative features, especially when it comes to advanced graphics rendering such as Ray Tracing, as well as their parallel computing platform and programming model, known as CUDA.
Therefore, this article will document the process to install NVIDIA drivers, which can be slightly convoluted, especially if Secure Boot is enabled.
Outlined below is the specification of my custom-built PC, which includes an NVIDIA GeForce RTX 5090.
- MSI MAG X870 Tomahawk WiFi
- AMD Ryzen 9 9950X 4.3GHz Base / 5.7GHz Boost (16C/32T)
- Noctua NH-D15 G2 LBC CPU Cooler
- 64GB Corsair Vengeance EXPO DDR5 PC5-48000C30 6000MHz RAM
- 2TB Crucial T705 M.2 PCI-e Gen5 NVM-e SSD
- 2TB Samsung 990 EVO Plus M.2 PCI-e Gen5 NVM-e SSD
- NVIDIA GeForce RTX 5090 Founders Edition 32GB GDDR7
- Corsair HX1200i 1200W ‘80 Plus Platinum’ ATX PSU
- Fractal Torrent Compact
The process described in this article should work for any system running a modern NVIDIA graphics processing unit (GPU), such as the 20/30/40/50 series.
It should also work for Fedora 42+, where Secure Boot is enabled. As a reminder, Secure Boot is a security feature in a system’s firmware that verifies the digital signatures of software components during the startup process.
As a result, to use Secure Boot with Fedora and an NVIDIA GPU, you must generate and import a key. Without this key, the drivers will fail to initialise correctly.
The following command can be used to confirm your graphics card is being detected. It also provides details regarding the make/model.
/sbin/lspci | grep -e VGA
Prior to any installation, ensure Fedora is up to date.
sudo dnf upgrade --refresh -y
Ensure the RPM Fusion repositories are installed.
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
sudo dnf upgrade --refresh -y
If Secure Boot is enabled, you must install the signing modules and generate and import a key. As part of this process, you will be asked to provide a password.
sudo dnf install kmodtool akmods mokutil openssl -y
sudo kmodgenca -a
sudo mokutil --import /etc/pki/akmods/certs/public_key.der
Upon completion, restart the system, which will prompt the MOK enrollment.
Select “Enrol MOK” > “Continue” > “Yes” and enter the password. You can then select “Reboot”.
Install the NVIDIA driver and cuda/nvdec/nvenc support, ensuring the use of the open kernel space driver.
sudo sh -c 'echo "%_with_kmod_nvidia_open 1" > /etc/rpm/macros.nvidia-kmod'
sudo dnf install akmod-nvidia
sudo dnf install xorg-x11-drv-nvidia-cuda
The installation is complete once the following command returns the driver version as a response (For example, 580.95.05).
modinfo -F version nvidia
This process may take several minutes. If you receive any other response, simply wait and retry the command.
Restart the system to finalise the installation.
To see more information about the drivers and graphics card installed, use the following command.
nvidia-smi
The following two commands can be useful if you encounter issues. Specifically, recompiling the installed kernel modules (akmods) and rebuilding the initial RAM file system image (dracut).
sudo akmods --force
sudo dracut --force
Finally, if you ever need to uninstall the NVIDIA drivers, use the following command.
dnf remove xorg-x11-drv-nvidia\*
The NVIDIA drivers are now installed and running.