Announcement

Collapse
No announcement yet.

How to Install NVIDIA GPU Driver on Fedora 40+ KDE 6 Spin on Wayland

Collapse
X
Collapse
  •  

  • How to Install NVIDIA GPU Driver on Fedora 40+ KDE 6 Spin on Wayland


    Installing the NVIDIA GPU driver is the first thing you will want to do after installing Fedora 40 on your computer. Fedora 40 comes with different spins (desktop environments) and the latest software. Wayland display server (which will replace the X11/Xorg display server completely one day) is the default on some of the Fedora 40 spins. One of the most awaited Fedora 40 spin is the KDE spin. Fedora 40 KDE spin comes with the KDE Plasma 6 desktop environment which supports only the Wayland display server. As the traditional X display server is gone, getting the NVIDIA GPU driver to work on Wayland might be a little bit tricky.

    In this article, I will show you how to install the latest version of the NVIDIA GPU driver on Fedora 40 KDE 6 Spin on Wayland display server. This article should work without any changes on other Fedora 40 spins that replaced the X display server with Wayland display server.








    Table of Contents

    1. Checking the UEFI Secure Boot Status
    2. Checking if an NVIDIA GPU is Available on Your System
    3. Downloading the NVIDIA Drivers for Fedora Linux
    4. Updating the Fedora 40 System Packages
    5. Installing Required Libraries and Tools for Building NVIDIA Kernel Modules
    6. Blacklisting Nouveau Drivers on Fedora 40
    7. Switching to Text-Based User Interface on Fedora 40
    8. Installing NVIDIA GPU Driver on Fedora 40
    9. Switching Back to Graphical Desktop Environment on Fedora 40
    10. Checking if NVIDIA Driver is Working on Fedora 40
    11. Solution to nvidia-installer was forced to guess the X library path and X module path
    12. Conclusion



    Checking the UEFI Secure Boot Status

    To get the NVIDIA GPU driver to work on UEFI secure boot enabled systems, you will have to sign the NVIDIA kernel modules manually, which is a bit complex. Without signed NVIDIA kernel modules, the NVIDIA GPU driver won’t work even if you’ve done all the installation steps correctly.

    In this article, I assume you’re trying to install the NVIDIA GPU driver on a system with UEFI secure boot disabled. If you have UEFI secure boot enabled on your system, make sure to disable it from the BIOS/UEFI firmware of your computer for the NVIDIA GPU driver to work.

    You can check the UEFI secure boot status from Fedora 40 with the following command:

    $ mokutil --sb-state




    As you can see, UEFI Secure Boot is disabled on my Fedora 40 system.



    Checking if an NVIDIA GPU is Available on Your System

    To check if an NVIDIA GPU is installed on your Fedora 40 system, run the following command:

    $ lspci | egrep -i 'VGA|3D'




    As you can see, I have an NVIDIA GeForce RTX 4070 GPU installed on my computer. You will most likely have a different GPU installed on your computer. So, you will see a different output.





    Downloading the NVIDIA Drivers for Fedora Linux

    The official NVIDIA driver is not included in the official package repository of Fedora 40. So, you will have to download the NVIDIA driver from the official NVIDIA website.

    Once the NVIDIA drivers download page loads on your web browser, select your NVIDIA GPU from the Product Type, Product Series, and Product dropdown menu respectively[1], select Linux 64-bit from the Operating System dropdown menu[2], select Production Branch from the Download Type dropdown menu[3], and click on Search[4].



    Click on Download.



    Click on Agree & Download.



    Your web browser should start downloading the NVIDIA GPU driver installer file. It will take a while to complete.



    At this point, the NVIDIA GPU driver installer file should be downloaded.



    Once the NVIDIA GPU driver installer file is downloaded, you will find it in the ~/Downloads directory of your Fedora 40 system.

    $ ls -lh ~/Downloads






    Updating the Fedora 40 System Packages

    Before attempting to install the NVIDIA GPU driver on your Fedora 40 system, it’s a good idea to update all the installed packages of your Fedora 40 system.

    First, update the Fedora 40 package database cache:

    $ sudo dnf makecache




    To update all the installed Fedora 40 packages, run the following command:

    $ sudo dnf update




    To confirm the update operation, press Y and then press .





    All the updates are being downloaded and installed on the Fedora 40 system. It will take a while to complete.





    At this point, all the updates should be installed on your Fedora 40 system.





    For the changes to take effect, reboot your Fedora 40 system with the following command:

    $ sudo reboot









    Installing Required Libraries and Tools for Building NVIDIA Kernel Modules

    To install all the required libraries and tools for building the NVIDIA kernel modules, run the following command:

    $ sudo dnf install kernel-devel kernel-headers gcc make dkms acpid libglvnd-glx

    libglvnd-opengl libglvnd-devel libxcb egl-wayland pkgconf-pkg-config xorg-x11-server-Xwayland xorg-x11-server-Xwayland-devel xorg-x11-server-Xorg xorg-x11-server-devel




    To confirm the installation, press Y and then press .





    All the required packages are being downloaded and installed. It will take a while to complete.





    At this point, all the required packages should be installed.










    Blacklisting Nouveau Drivers on Fedora 40

    If you have an NVIDIA GPU installed on your Fedora 40 system, it’s very likely that you will have the open-source Nouveau driver installed and enabled by default. But for the official NVIDIA driver to work, you must blacklist/disable the Nouveau driver on Fedora 40.

    You can verify whether the Nouveau driver is enabled on your Fedora system with the following command:

    $ lsmod | grep nouveau




    If the Nouveau driver is enabled, you will see that the nouveau kernel modules are loaded on your Fedora system.





    To blacklist the Nouveau driver on Fedora 40 system, create a new file blacklist-nouveau.conf in the /etc/modprobe.d/ directory and open it with the nano text editor as follows:

    $ sudo nano /etc/modprobe.d/blacklist-nouveau.conf




    Type in the following lines in the blacklist-nouveau.conf file.

    blacklist nouveau

    options nouveau modeset=0




    Once you’re done, press + X followed by Y and to save the blacklist-nouveau.conf file.





    Open the GRUB bootloader configuration file with the nano text editor as follows:

    $ sudo nano /etc/default/grub




    Blacklist the Nouveau driver using the kernel boot parameter rd.driver.blacklist=nouveau and force the official NVIDIA driver to load (once installed) using the kernel boot parameter nvidia-drm.modeset=1.

    Once you’ve added the required kernel boot parameters on GRUB_CMDLINE_LINUX environment variable in the /etc/default/grub file, press + X followed by Y and to save the file.





    Update the initramfs of your Fedora 40 system with the following command:

    $ sudo dracut --force




    Also, update the GRUB bootloader of your Fedora 40 system with the following command:

    $ sudo grub2-mkconfig -o /boot/grub2/grub.cfg











    Switching to Text-Based User Interface on Fedora 40

    You must install the official NVIDIA GPU driver on Fedora 40 from the text-based user interface.

    To enable the text-based user interface on Fedora 40, run the following command:

    $ sudo systemctl set-default multi-user.target






    For the changes to take effect, reboot your Fedora 40 system:

    $ sudo reboot




    You will see a text-based user interface on your Fedora 40 system instead of the graphical desktop environment on the next boot.

    Use your login username and password to log in to the text-based UI of your Fedora 40 system.










    Installing NVIDIA GPU Driver on Fedora 40

    The downloaded NVIDIA GPU driver installer file NVIDIA-Linux-x86_64-550.78.run should be in the ~/Downloads directory of your Fedora 40 system. Before running the NVIDIA GPU driver installer file, you must make it executable.

    You can make the NVIDIA GPU driver installer file executable with the following command:

    $ chmod +x NVIDIA-Linux-x86_64-550.78.run






    You can run the NVIDIA GPU driver installer file NVIDIA-Linux-x86_64-550.78.run as follows:

    $ sudo ./NVIDIA-Linux-x86_64-550.78.run




    The NVIDIA GPU driver installer should start building the NVIDIA kernel modules for Fedora 40. It will take a few seconds to complete.





    Once you see the following prompt, select Yes and press to install the NVIDIA GPU driver 32-bit compatibility libraries.





    When you upgrade the kernel on your Fedora system, you may need to rebuild the NVIDIA kernel module. To allow this, select Yes and press to register the NVIDIA kernel module sources with DKMS.





    Select Rebuild initramfs and press .





    The initramfs of your Fedora 40 system is being rebuilt. It will take a few seconds to complete.





    Select Yes and press to allow nvidia-xconfig utility to automatically update the X server configuration files on your Fedora 40 system





    The NVIDIA GPU driver installation should be complete. Press to close the NVIDIA GPU driver installer.








    Switching Back to Graphical Desktop Environment on Fedora 40

    To switch from text-based user interface back to the default graphical desktop environment, run the following command:

    $ sudo systemctl set-default graphical.target




    For the changes to take effect, reboot your Fedora 40 system with the following command:

    $ sudo reboot









    Checking if NVIDIA Driver is Working on Fedora 40

    Once your Fedora 40 system boots, you should see that the nvidia kernel modules are loaded. This is an indication that the NVIDIA GPU driver installation was successful.

    $ lsmod | grep nvidia






    If the NVIDIA GPU driver installation was successful, the nvidia-smi command will report information on the NVIDIA GPU you have installed on your Fedora 40 machine.

    In my case, the nvidia-smi command reports the following information about my NVIDIA GeForce RTX 4070:
    • Installed NVIDIA driver version
    • The maximum CUDA version the currently installed NVIDIA GPU driver version supports
    • GPU power limit and used power (in Watt unit)
    • GPU temperature (in degree centigrade unit)
    • Processes utilizing the GPU and per process memory usage (in MiB unit)
    • Total available memory and total memory usage (in MiB unit), etc.

    $ sudo nvidia-smi






    If the NVIDIA GPU driver was installed correctly, the NVIDIA Settings app will also show relevant information on the NVIDIA GPU you have installed on your Fedora 40 machine.





    As you can see, my NVIDIA GeForce RTX 4070 GPU is working just fine on Fedora 40 KDE Plasma 6 desktop environment on Wayland display server.










    Solution to nvidia-installer was forced to guess the X library path and X module path

    If you see one of the following errors/warnings while installing the NVIDIA GPU driver on your Fedora 40 system, it means that the required X server development libraries are missing on your system.
    • WARNING: nvidia-instalelr was force to guess the X library path ‘/usr/lib64’ and X module path ‘/usr/lib64/xorg/modules’: these paths were not queryable from this system. If X fails to find the NVIDIA X driver module, please install the ‘pkg-config’ utility and the X.org SDK/development package for your distribution and reinstall the driver.

    • WARNING: You appear to be using a modular X.Org release, but the X module installation path, ‘/usr/lib64/xorg/modules’, reported by ‘/usr/bin/pkg-config –variable=moduledir xorg-server’ does not exist. Please check your X.Org installation.



    At times the NVIDIA GPU driver will work just fine without the X server development libraries, at times it won’t.

    In this article, I have included the X server development packages and the pkg-config utility in the installation of the required libraries and tools for building NVIDIA kernel modules section. So, you probably did not run into those errors/warnings. But if you have encountered those errors/warnings and you’re looking for a solution, then just install the required X development libraries on your Fedora 40 system with the commands below and try to reinstall the NVIDIA GPU drivers.

    $ sudo dnf makecache

    $ sudo dnf install pkgconf-pkg-config xorg-x11-server-Xwayland-devel xorg-x11-server-Xorg xorg-x11-server-devel









    Conclusion

    In this article, I have demonstrated the methods of installing the official NVIDIA GPU drivers on Fedora 40 KDE Plasma 6 desktop environment running on the Wayland display server. The same procedures should work on any Fedora desktop environment running on the Wayland display server. With a little tweak, you should also be able to get the NVIDIA GPU driver installed and working on Fedora 40 desktop environments/spins that still haven’t switched to Wayland.





    More...
      Posting comments is disabled.

    Categories

    Collapse

    Article Tags

    Collapse

    There are no tags yet.

    Latest Articles

    Collapse

    • Providing a license for package sources
      by Kasimba
      Arch Linux hasn't had a license for any package sources (such as PKGBUILD files) in the past, which is potentially problematic. Providing a license will preempt that uncertainty.

      In RFC 40 we agreed to change all package sources to be licensed under the very liberal 0BSD license. This change will not limit what you can do with package sources. Check out the RFC for more on the rationale and prior discussion.

      Before we make this change, we will provide contributors with...
      11-19-2024, 09:21 AM
    • Linux Binary Analysis for Reverse Engineering and Vulnerability Discovery
      by Kasimba



      by George Whittaker


      Introduction

      In the world of cybersecurity and software development, binary analysis holds a unique place. It is the art of examining compiled programs to understand their functionality, identify vulnerabilities, or debug issues—without access to the original source code. For Linux, which dominates servers, embedded systems, and even personal computing, the skill of binary analysis is...
      11-18-2024, 07:10 PM
    • Ubuntu vs Debian: Linux Distributions Compared Deep Dive
      by Kasimba
      Debian and Ubuntu are two popular Linux distributions. In this deep dive we will guide you on the key differences between them from perspective of both corporate enterprise and personal productivity or pleasure usage. After reading this blog post you should be in a better position to decide to select Ubuntu or Debian.
      Stewardship, Licensing, Community and Cost

      Where as Debian is 100% fully committed to free software as defined by the Debian Free Software Guidelines, Ubuntu is created...
      11-17-2024, 08:30 PM
    • Debian Backup and Recovery Solutions: Safeguard Your Data with Confidence
      by Kasimba



      by George Whittaker


      Introduction

      In the digital age, data loss is a critical concern, and effective backup and recovery systems are vital for any Debian system administrator or user. Debian, known for its stability and suitability in enterprise, server, and personal computing environments, offers a multitude of tools for creating robust backup and recovery solutions. This guide will explore these solutions,...
      11-13-2024, 05:30 PM
    • Installing Development Tools on Debian: Setting Up Compilers, Libraries, and IDEs for a Robust Development Environment
      by Kasimba



      by George Whittaker


      Introduction

      Debian is one of the most trusted and stable Linux distributions, making it a top choice among developers and system administrators. Setting up a powerful development environment on Debian involves installing the right tools, compilers, libraries, and Integrated Development Environments (IDEs) that can support various programming languages and workflows. This guide provides...
      11-07-2024, 11:22 PM
    • Building Your Own Ubuntu Personal Cloud: A Step-by-Step Guide to Creating a Secure Data Haven
      by Kasimba



      by George Whittaker


      In today’s digital world, data is more than just information; it’s a part of our lives. From photos and documents to sensitive personal information, our data represents our memories, work, and interests. While cloud storage services are widely available, they often come with privacy concerns, subscription fees, and limitations on customization. This is where building a personal cloud on Ubuntu comes...
      11-07-2024, 04:30 PM
    Working...
    X