Install NVIDIA Drivers on Fedora Linux 34/35


Most modern Linux Desktop systems such as Fedora come with an NVIDIA driver pre-installed in the Nouveau open-source graphics device driver for Nvidia video cards. For the most part, this is acceptable; however, if you are using your Linux system for graphical design or gaming, you may get better drivers.

Historically, the Nouveau proprietary drivers are slower than Nvidia’s, which lacks the latest graphics card hardware’s latest features, software technology, and support. In most situations, upgrading your Nvidia Drivers with proper NVIDIA drivers is more beneficial than not. In some cases, you may see some substantial improvements overall.

In the following tutorial, you will learn how to install the Nvidia Graphic Drivers from the Nvidia Proprietary Repository RPM Fusion, giving you the latest software available on Fedora 35 Workstation.

Prerequisites

  • Recommended OS: Fedora Linux 35.
  • User account: A user account with sudo or root access.
  • Internet Access
  • NVIDIA Graphic Cards

The tutorial will utilize the terminal, which can be found in your show applications menu.

Example:

Update Operating System

Update your Fedora operating system to make sure all existing packages are up to date:

sudo dnf upgrade --refresh -y

The tutorial will be using the sudo command and assuming you have sudo status.

To verify sudo status on your account:

sudo whoami

Example output showing sudo status:

[joshua@fedora ~]$ sudo whoami
root

To set up an existing or new sudo account, visit our tutorial on Adding a User to Sudoers on Fedora.

Use the following command with the root password to log in to use the root account.

su

Install Dependency Required

Before you proceed to the installation of Nvidia Drivers, run the following command to install or check that the package dnf-plugins-core is installed on your Fedora desktop.

sudo dnf install dnf-plugins-core -y

Import RPM Fusion Repository

By default, like most Linux distributions, Fedora does not come with NVIDIA proprietary drivers. The best method to install these on Fedora 35 is to use the RPM fusion repository.

First, open your terminal and add the following repositories

Import RPM Fusion Free:

sudo dnf install \
  https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm

Import RPM Fusion Nonfree:

sudo dnf install \
  https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm

Once done, refresh your repository list.

sudo dnf update --refresh

Install NVIDIA Drivers on Fedora

Now that you have imported the RPM Fusion repository execute the following command to install the latest Nvidia drivers on your Fedora system.

sudo dnf install akmod-nvidia

Example output:

Type Y, then press the ENTER KEY to proceed.

Next, install the CUDA drivers support. This should be installed and, if skipped, may lead to issues.

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

Example output:

Type Y, then press the ENTER KEY to proceed.

Once everything has been installed, you must restart your Fedora system. By default, this will also disable Nouveau drivers automatically.

reboot

Verify NVIDIA Drivers Installation

Once you have logged back into your system, you should now have at the time of this tutorial Nvidia Drivers package 470.74 installed. You can test this in various ways; in your terminal, type the following command:

nvidia-smi

Example output:

Alternatively, you can load the Nvidia GUI by navigating to Activities > Show Applications > Nvidia X Server or typing the following command in your terminal.

nvidia-settings

Example if installation successful:

Optional Method – Enable RPM Fusion TESTING Branch

RPM Fusion has a testing branch that contains mostly incoming new release NVIDIA driver series packages or beta packages. This can be useful for those who want to install bleeding-edge NVIDIA drivers.

See also
How to Install Nomacs on Fedora Linux

First, enable the RPM Fusion Testing repository using the following command.

Enable the Free repository, use:

sudo dnf config-manager --set-enabled rpmfusion-free-updates-testing

Enable the Non-Free repository:

sudo dnf config-manager --set-enabled rpmfusion-nonfree-updates-testing

Disable the Free repository, use:

sudo dnf config-manager --set-disabled rpmfusion-free-updates-testing

Disable the Non-Free repository:

sudo dnf config-manager --set-disabled rpmfusion-nonfree-updates-testing

Once enabled, proceed to install the drivers or run an update.

Optional Method – Install NVIDIA Legacy Drivers

For those that have upgraded Fedora and require older drivers as their graphics card is not supported any more in the newest release driver packages by Nvidia. Below are some option installation drivers, do note these are often not updated as much, and security flaws could exist.

Install GeForce 600/700 NVIDIA series drivers:

sudo dnf install xorg-x11-drv-nvidia-470xx akmod-nvidia-470xx xorg-x11-drv-nvidia-470xx-cuda

Install GeForce 400/500 NVIDIA series drivers:

sudo dnf install xorg-x11-drv-nvidia-390xx akmod-nvidia-390xx xorg-x11-drv-nvidia-390xx-cuda

Install GeForce 8/9/200/300 NVIDIA series drivers:

sudo dnf install xorg-x11-drv-nvidia-340xx akmod-nvidia-340xx xorg-x11-drv-nvidia-340xx-cuda

How to Update Nvidia Drivers

All future updates will be in the standard dnf refresh command procedure, and this will check the RPM Fusion repository for updates and the rest of your Fedora packages.

To check for updates:

sudo dnf upgrade --refresh

How to Remove Nvidia Drivers and Roll Back

If you do not want to continue to use the Nvidia official drivers, use the following command:

sudo dnf autoremove akmod-nvidia xorg-x11-drv-nvidia-cuda -y

This will remove all dependencies installed, and once removed, you must reboot.

reboot

During the reboot, the process will re-enable the Nouveau drivers. You will see a message stating Nvidia drivers not found re-enabling Nouveau drivers, making it easier to switch back and forth if needed.

Comments and Conclusion

In the tutorial, you have learned how to install the latest Nvidia drivers on your Fedora 35 Workstation using the RPM Fusion repository. Ideally, these beta drivers should only be used if you have an equivalent graphics card that would benefit from the new driver packages on a gaming system. The average desktop user should wait as these drivers could bring instability.

16 thoughts on “Install NVIDIA Drivers on Fedora Linux 34/35”

    • Thanks for the feedback I appreciate it.

      This method is for Xorg (X11). I know many want to use Wayland, but from what I read it still even the 470 range still has issues with compatibility from what I understand.

      It can be done also, but there are more processes involved. I should update this one day with that method.

      Reply
  1. Something is not right. After installing 35 and following your instructions everything seemed fine. Then the next day I was prompted to update NVIDIA drivers again from the non-free repo. I did that, and now Fedora says my system is running without video hardware acceleration. Output from nvidia-smi is “Failed to initialize NVML: Driver/library version mismatch”.

    Reply
  2. Ok, addendum to my last comment. First, I did reboot after the upgrade (just in case you were wondering). Also, please note that in for dnf “update” is just a deprecated alias for “upgrade”, they do exactly the same thing.

    So, I think I fixed my problem. I removed CUDA, then reinstalled, and rebooted. Now the driver version is updated and there are no error messages. NVIDIA support in Fedora is still way, way more complicated than it should be.

    Reply
    • Thanks for the message. I updated the upgrade part, forgot about that.

      As for Drivers on Fedora, given it’s a new release, bugs are not surprising compared to more seasoned distributions given the number of upgrades and changes that role into it. I appreciate the feedback, and I am sure others in the same boat will reinstall the drivers if facing similar issues. One odd thing, my test machine hasn’t had this occur even with updates, weird but o well.

      I will create a tutorial shortly on how to install Nvidia & AMD Beta drivers manually soon once Fedora 35 settles down.

      Appreciate the message once again, cheers.

      Reply
    • Thanks for the message Austin.

      I just wiped and installed a fresh Fedora 35 updated desktop build and ran the tutorial and I did not get this issue with it rolling back to Nouveau.

      I am not sure what has happened in your case, without any details.

      Also, the RPM Fusion RPM installed the new Nvidia feature branch 495.44, so it’s 100% up to date with what NVIDIA offers at this very moment.

      Reply
  3. I followed your instructions on my F35 desktop running a Geforce GTX650 and it failed. It all seemed to upgrade and install normally, however:

    NVIDIA-SMI has failed because it couldn’t communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.

    Reply
    • Hi, wmat thanks for the message.

      I am sorry it did not work, your NVIDIA graphics card is very old now sad to say, the GTX650 is like from 2011/2012 from a quick check, and it is probably not communicating since support has been dropped. I saw some forum posts recently about people rolling back to 475.xx range from 495.xx over old cards no longer working recently.

      I will need to adjust it and add how to install legacy NVIDIA drivers on Fedora. However I do not think RPM fusion would keep these, I may need to create a new method for older cards.

      Thanks for the feedback, I will think about the best way forward and update the tutorial soon.

      Reply
      • Thanks for the reply. Note that attempting to install the legacy 395xx drivers results in:

        [wmat@conan ~]$ sudo dnf install xorg-x11-drv-nvidia-390xx akmod-nvidia-390xx
        [sudo] password for wmat: 
        Last metadata expiration check: 1:39:15 ago on Thu 18 Nov 2021 08:40:07 AM EST.
        Error: 
         Problem 1: package kmod-nvidia-5.14.17-301.fc35.x86_64-3:495.44-1.fc35.x86_64 requires nvidia-kmod-common >= 3:495.44, but none of the providers can be installed
         – package xorg-x11-drv-nvidia-3:495.44-4.fc35.x86_64 conflicts with xorg-x11-drv-nvidia-390xx provided by xorg-x11-drv-nvidia-390xx-3:390.144-2.fc35.x86_64
         – package xorg-x11-drv-nvidia-390xx-3:390.144-2.fc35.x86_64 conflicts with xorg-x11-drv-nvidia provided by xorg-x11-drv-nvidia-3:495.44-4.fc35.x86_64
         – conflicting requests
         – problem with installed package kmod-nvidia-5.14.17-301.fc35.x86_64-3:495.44-1.fc35.x86_64
         Problem 2: problem with installed package xorg-x11-drv-nvidia-3:495.44-4.fc35.x86_64
         – package xorg-x11-drv-nvidia-3:495.44-4.fc35.x86_64 conflicts with xorg-x11-drv-nvidia-390xx provided by xorg-x11-drv-nvidia-390xx-3:390.144-2.fc35.x86_64
         – package xorg-x11-drv-nvidia-390xx-3:390.144-2.fc35.x86_64 conflicts with xorg-x11-drv-nvidia provided by xorg-x11-drv-nvidia-3:495.44-4.fc35.x86_64
         – package xorg-x11-drv-nvidia-390xx-3:390.144-2.fc35.x86_64 conflicts with xorg-x11-drv-nvidia provided by xorg-x11-drv-nvidia-3:470.74-1.fc35.x86_64
         – package xorg-x11-drv-nvidia-3:470.74-1.fc35.x86_64 conflicts with xorg-x11-drv-nvidia-390xx provided by xorg-x11-drv-nvidia-390xx-3:390.144-2.fc35.x86_64
         – package akmod-nvidia-390xx-3:390.144-3.fc35.x86_64 requires nvidia-390xx-kmod-common >= 3:390.144, but none of the providers can be installed
         – conflicting requests
        (try to add ‘–allowerasing’ to command line to replace conflicting packages or ‘–skip-broken’ to skip uninstallable packages)

        Reply
        • hi wmat,

          I think the 470.xx keeps your driver, 390 defiantly does however that is old and I doubt any RPM is going to be available long term for it even RPM fusion may stop support.

          Also, you need to remove the 495 packages first.

          sudo dnf remove ‘*nvidia*’

          reboot

          Try the following.

          sudo dnf install xorg-x11-drv-nvidia-470xx akmod-nvidia-470xx
          sudo dnf install xorg-x11-drv-nvidia-470xx-cuda #optional for cuda up to 11.4 support

          If this doesn’t work try the 390 methods as you first tried.

          I’d use the 470 over the 390 personally as that will be supported longer.

          Let me know how it goes.

          Thanks.

          Reply
  4. not working with fedora 35.
    GeForce GTX 1060 6GB and GeForce GTX 1060 6GB.

    “nvidia-smi” says:
    NVIDIA-SMI has failed because it couldn’t communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.

    Reply
    • Hello xrg,

      The tutorial used a GTX 1065 graphics card, so yours should work without going to legacy drivers.

      Are you running default Fedora or using an alternative desktop manager, also X11 or Wayland?

      Can you run in your terminal:

      lsmod | grep nouveau <--- This should be blank.

      Reply

Leave a Comment

Share to...