This guide will help you to install the proprietary NVIDIA drivers replacing the open source Nouveau drivers for both Fedora Workstation (Gnome, KDE and Cosmic spins) and Atomic desktops (Silverblue, Kinoite and Sway).
The hardest part is getting the drivers to load with Secure Boot. Secure Boot blocks the driver's modules from loading unless we sign them.
Run the following command in the terminal to check Secure Boot status:
mokutil --sb-stateIf enabled, you will need to follow some extra (but simple) steps. Don't disable Secure Boot if it was already enabled to improve your security. However, if you followed the steps and the driver modules failed to load, disable secure boot to fix the problem.
All you need to do is follow the guide and hopefully everything works smoothly!
Please check if your Desktop Environment is compatible with the Nvidia drivers since there are more steps needed for some that may not be listed here. This is not a problem for KDE, Gnome, Sway and Cosmic but may be a problem for some of the spins. If you find any, please create an issue with the details.
You will mostly need to just copy and paste commands into the terminal. But, make sure to read everything carefully!
If you find any mistake or want to add some missing information, create a pull request with the changes or just create an issue. All help is appreciated!
At the end you will find a quick survey, taking it will help me maintain this guide. Thanks!
Consult the official documentation (Sources listed below) if more information is needed.
This guide is made STRICTLY for Fedora Workstation and all it's spins (KDE and Cosmic) and Fedora Atomic (Silverblue, Kinoite and Sway).
For users with encrypted drives using LUKS, you will follow some extra steps after installation to avoid issues after rebooting (steps listed below appropriately). Please note that there are reports that these steps get overridden after kernel updates. Please read issue: #5 for potential solution and report in survey how it went. Otherwise for a better experience you can disable LUKS.
- Sway Users
For users of Sway and Sway Atomic (Sericea), you will need to open
/etc/sway/environmentand uncomment or add the following two lines:
SWAY_EXTRA_ARGS="$SWAY_EXTRA_ARGS --unsupported-gpu"
WLR_NO_HARDWARE_CURSORS=1Please scroll down to the relevant section related to your Fedora installation or choose from table of contents:
If you have Secure Boot disabled, Skip step 2. Otherwise, it's still easy to get the drivers with Secure Boot.
If your drive is encrypted with LUKS. You will need to follow some extra steps before final reboot to avoid a black screen on startup.
If you have an older 600/700 series GPU (Kepler, Quadro), you will need to use the X11 session alongside the older 470 Nvidia driver (Setup covered in steps). Meaning Gnome 49 or later will NOT be an option and you must use KDE or any other Window Manager supporting X11. [THIS NEEDS ADDITIONAL RESEARCH SO IF IT IS INCORRECT PLEASE INFORM ME BY CREATING AN ISSUE IN THE REPOSITORY].
- Update your system: Ensure your installation is up-to-date:
sudo dnf update- Enable RPM Fusion: This provides access to the NVIDIA drivers.
sudo dnf install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm- Install these packages:
sudo dnf install kmodtool akmods mokutil openssl- Generate a default key:
sudo kmodgenca -aNote: If you get the message: "WARNING: EXISTING KEY PAIR.", add --force to the end of the command and run it again.
- Enroll the key in MOK:
After running the command, you will be asked for a password. Create a short password (ex: 0000) and remember it for a later step!
sudo mokutil --import /etc/pki/akmods/certs/public_key.der- Reboot to enroll:
On the next boot MOK Management is launched and you have to choose "Enroll MOK" (MOK management is a blue screen on startup)
Choose "Continue" to enroll the key.
Enroll by selecting "Yes".
You will need to enter the password you created earlier.
systemctl rebootYou will need to identify your GPU to choose which drivers to install. Run this command to find your GPU if you need to confirm:
lspci -n -n -k | grep -A 2 -e VGA -e 3D^CAccordingly, choose which driver to download below:
sudo dnf install akmod-nvidia
sudo dnf install xorg-x11-drv-nvidia-cuda #for cuda and nvidia-smisudo dnf install xorg-x11-drv-nvidia-470xx akmod-nvidia-470xx
sudo dnf install xorg-x11-drv-nvidia-470xx-cuda #cuda supportAdditionally, for this driver (DRIVER v470 ONLY) you need to install X11 session on KDE:
KDE:
sudo dnf install plasma-workspace-x11 xorg-x11-drivers xorg-x11-xinitAfter the final reboot, Make sure to use the X11 session when logging into KDE (Found bottom left)
Now that we installed the driver, confirm that it's built or not by running:
modinfo -F version nvidiaIn the output you should see the driver version number. If you see an error then it's still being built. Wait for a minute and try running the command again.
When the output is correct then you are finally done with the installation!
-
IMPORTANT If your drive is encrypted, go to the following section to perform some extra required steps before rebooting: LUKS Encrypted drives
-
Reboot Finally, reboot your system.
If you see "Nvidia modules failed to load" on startup, then the secure boot step was unsuccessful. You can try and disable secure boot to solve this problem.
After booting, run the following in the terminal to check your GPU's status:
nvidia-smiNOTE: If it failed then you didn't install Nvidia Cuda from the steps above.
Please take this quick survey to help me know if the guide worked or didn't work for you: https://forms.gle/J44beNvnPh5x9fHs5
If you have any problems, check the Common Problems section or create an issue in this repository and I will try to help.
//------------------------------------------------------------------------------------------//
Due to Fedora Atomic's immutable nature, we will need to use a "trick" to get the drivers correctly working with Secure Boot. Thanks to CheariX for providing the fix to everyone: https://github.com/CheariX/silverblue-akmods-keys
With Atomic, you can revert easily if anything gets messed up! Please check the official Fedora documentation to learn how you can do so: https://docs.fedoraproject.org/en-US/fedora-silverblue/updates-upgrades-rollbacks/
Sway users need to perform two extra steps, one is listed in "Identify your system" above and the other is below when adding the kernel arguments. [Notes provided by shdwpunk].
If your drive is encrypted with LUKS, you will need to perform extra steps after installation before reboot.
- Update your system: Ensure your Silverblue installation is up-to-date:
sudo rpm-ostree update- Install necessary packages:
sudo rpm-ostree install rpmdevtools akmods- Enable RPM Fusion: This provides access to the NVIDIA drivers.
sudo rpm-ostree install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm- Reboot: Reboot to apply the RPM Fusion changes.
systemctl reboot- Generate a Machine Owner Key (MOK):
sudo kmodgenca -aNote: If you get the message: "WARNING: EXISTING KEY PAIR.", add --force to the end of the command and run it again.
- Import the key:
sudo mokutil --import /etc/pki/akmods/certs/public_key.der- You'll be prompted to set a password during this process; remember it! You'll need it after rebooting.
- Clone the repository:
git clone https://github.com/CheariX/silverblue-akmods-keys
cd silverblue-akmods-keys- Build and install:
sudo bash setup.sh
sudo rpm-ostree install akmods-keys-*.rpmInstall the driver and Cuda. Last command will blacklist the Nouveau driver and nova_core. For Sway users, You will need to also add an additional kernel arg listed below:
- Install the Nvidia driver with Cuda for Kinoite and Silverblue
sudo rpm-ostree install akmod-nvidia xorg-x11-drv-nvidia xorg-x11-drv-nvidia-cuda
sudo rpm-ostree kargs --append=rd.driver.blacklist=nouveau,nova_core --append=modprobe.blacklist=nouveau,nova_core --append=nvidia-drm.modeset=1 - Install the Nvidia driver with Cuda for Sway Atomic
sudo rpm-ostree install akmod-nvidia xorg-x11-drv-nvidia xorg-x11-drv-nvidia-cuda
sudo rpm-ostree kargs --append=rd.driver.blacklist=nouveau,nova_core --append=modprobe.blacklist=nouveau,nova_core --append=nvidia-drm.modeset=1 --append=initcall_blacklist=simpledrm_platform_driver_init- IMPORTANT If your drive is encrypted, go to the following section to perform some extra required steps before rebooting: LUKS Encrypted drives
- Reboot: For Secure Boot enabled. Otherwise, you will not see a MOK enrollment screen and you only need to restart!
On the next boot MOK Management is launched and you have to choose "Enroll MOK"
Choose "Continue" to enroll the key.
Confirm enrollment by selecting "Yes".
You will need to enter the password you created earlier.
systemctl rebootNow that we installed the driver, confirm that it's built by running:
modinfo -F version nvidiaIn the output you should see the driver version number.
If you see "Nvidia modules failed to load" on startup, then the secure boot step was unsuccessful. You can try and disable secure boot to solve this problem.
After booting, run the following in the terminal to check your GPU's status:
nvidia-smiNOTE: If it failed then you didn't install Nvidia Cuda from the steps above.
If you have any problems, check the Common Problems section or create an issue in this repository and I will try to help.
Please take this quick survey to help me know if the guide worked or didn't work for you: https://forms.gle/J44beNvnPh5x9fHs5
Enabling the RPM fusion repo alone will enable it in a "fixed" state. Meaning after a major Fedora update (42 -> 43) The repos won't be updated!
To optionally (recommended) "unlock", Run the following command:
sudo rpm-ostree update \
--uninstall rpmfusion-free-release \
--uninstall rpmfusion-nonfree-release \
--install rpmfusion-free-release \
--install rpmfusion-nonfree-releaseAfter that, reboot!
rebootFor more information about this, check the official documentation: https://docs.fedoraproject.org/en-US/fedora-silverblue/tips-and-tricks/#_enabling_rpm_fusion_repos
- LUKS-encrypted drives : If your drive is encrypted, you will need to perform the following steps before rebooting.:
Please note that there are reports that these steps get overridden after kernel updates. Please read issue: #5 for potential solution and report in survey how it went. Otherwise, for a smoother experience you can disable LUKS.
In your terminal, run:
sudo nano /etc/dracut.conf.d/nvidia.confAdd the following line:
add_drivers+=" nvidia nvidia_modeset nvidia_uvm nvidia_drm "
Press CTRL + X then Y then ENTER to save the changes
*For Fedora Workstation, KDE and Cosmic spins:
Run the following in terminal:
sudo dracut --forceAfter that you can reboot your system and enroll the MOK keys (Return back to final reboot step)
*For Fedora Atomic distros (Silverblue, Kinoite and Sway):
Run the following in terminal:
sudo rpm-ostree initramfs --enableAfter that you can reboot your system
If you faced issues, please create an issue and I will try to help
Please take this quick survey to help me know if the guide worked or didn't work for you: https://forms.gle/J44beNvnPh5x9fHs5
Consider taking a look at #5
If you got this message after installation, The secure boot enrollment was not done properly. Please retry the Secureboot steps mentioned for your Fedora installation. No need to reinstall the drivers themselves!
This means the installed drivers were the incorrect version for your GPU (Was kepler but installed Geforce instead and vice versa) If that happens, boot into TTY (reboot and spam CTRL+ALT+F2) and remove the Nvidia packages manually
For workstation and it's spins:
sudo dnf remove "*nvidia*" "*akmod-nvidia*" "*xorg-x11-drv-nvidia*"
sudo dracut -f --regenerate-allFor Atomic desktops:
rpm-ostree override reset "*nvidia*"This can also happen if your drive was encrypted. Try the following:
- Reboot the computer.
- When the GRUB menu appears, press e to edit.
- Find the line that starts with linux
- Remove rhgb and quiet if they are there, go to the very end of that line, and add a space, followed by the number 3.
- Press Ctrl+x to boot. This will get you to a text-based login where you can enter the LUKS password and afterwards your Fedora username and password.
After that you need to follow the steps listed here: LUKS Encrypted drives
If you installed the drivers and updated to 6.15, you need to add "nova_core" to the blacklist alongside nouveau. Ignore this if it's working properly since it's only for those who followed the steps before I added nova_core to the commands. If you ran the older command run:
sudo rpm-ostree kargs --append=rd.driver.blacklist=nouveau,nova_core --append=modprobe.blacklist=nouveau,nova_coreThis should fix the issue with the drivers.
- shdwpunk [Provided additional Sway setup commands]
- Poid-bit [Provided additional steps for encrypted drives]
Configuring RPMFusion:
RPMFusion Nvidia Documentation:
RPMFusion Secureboot Documentation:
Nvidia drivers for Sway Atomic