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

    • 5 Compelling Reasons to Choose Linux Over Windows
      by Kasimba



      by George Whittaker


      Introduction

      In the world of operating systems, Windows has long held the lion’s share of the market. Its user-friendly interface and wide compatibility have made it the default choice for many. However, in recent years, Linux has steadily gained traction, challenging the status quo with its unique offerings. What was once considered the domain of tech enthusiasts and developers is now...
      Yesterday, 06:52 AM
    • NGINX vs Apache; Web Server Comparison
      by Kasimba
      Overview of NGINX and Apache

      NGINX and Apache are leading web server solutions utilized for hosting websites and web applications. Apache, developed by the Apache Software Foundation, offers robust configuration options and extensibility. NGINX, created by Igor Sysoev, is known for its efficiency in handling numerous concurrent connections with low resource utilization. Both servers function not only as HTTP servers but also as reverse proxies, load balancers, and more.

      What is

      ...
      Yesterday, 03:54 AM
    • Monthly News – November 2024
      by Kasimba
      Hi everyone, I hope you are enjoying the BETA so far! This release introduces new features, tools, and artwork, so we anticipate a good number of bug reports. Every single fix helps us refine and improve the final release. Your feedback during the BETA phase is extremely important to us. Linux Mint 22.1 is our […]

      More...
      12-16-2024, 11:50 AM
    • Mastering OpenSSH for Remote Access on Debian Like a Pro
      by Kasimba



      by George Whittaker


      Introduction

      Remote access is a cornerstone of modern IT infrastructure, enabling administrators and users to manage systems, applications, and data from virtually anywhere. However, with great power comes great responsibility—ensuring that remote access remains secure is paramount. This is where OpenSSH steps in, providing robust, encrypted communication for secure remote management....
      12-13-2024, 10:31 PM
    • Unlocking the Full Potential of Linux's Most Versatile Search Tool
      by Kasimba



      by George Whittaker


      Introduction

      The grep command, short for "global regular expression print," is one of the most powerful and frequently used tools in Unix and Linux environments. From sifting through log files to finding patterns in text, grep is a Swiss Army knife for system administrators, developers, and data analysts alike. However, many users limit themselves to its basic functionality, unaware...
      12-13-2024, 09:24 PM
    • Linux Mint 22.1 “Xia” – BETA Release
      by Kasimba
      This is the BETA release for Linux Mint 22.1 “Xia”. Linux Mint 22.1 is a long term support release which will be supported until 2029. It comes with updated software and brings refinements and many new features to make your desktop even more comfortable to use. New features: This new version of Linux Mint contains […]

      More...
      12-12-2024, 09:31 AM
    Working...
    X