How to install the NVIDIA drivers on AlmaLinux 8

In this article we will be perform an installation of the NVIDIA Driver on AlmaLinux. Nvidia driver is needed by your NVIDIA Graphics GPU to function with better performance. To do this we are first going to identify your NVIDIA graphic card, download an appropriate NVIDIA driver , disable the default nouveau driver by modifying the GRUB boot menu and finally install a official NVIDIA driver.

To install Nvidia driver on other Linux distributions, follow our Nvidia Linux Driver guide.

In this NVIDIA Drivers installation guide you will learn:

  • How to identify your NVIDIA graphic card model on your operating system.
  • Where to download the NVIDIA driver package for AlmaLinux 8.
  • How to install prerequisites for a successful Nvidia Driver compilation and installation on AlmaLinux 8.
  • How to disable the nouveau driver.
  • How to successfully install NVIDIA Drivers on your AlmaLinux 8 Linux operating system.
How to install the NVIDIA drivers on AlmaLinux 8

How to install the NVIDIA drivers on AlmaLinux 8

Software Requirements and Conventions Used

Software Requirements and Linux Command Line Conventions
Criteria Requirements
System AlmaLinux 8
Software Existing Desktop installation such as GNOME.
Other Privileged access to your Linux system as root or via the sudo command.
Conventions # – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
$ – requires given linux commands to be executed as a regular non-privileged user

How to install the NVIDIA drivers on CentOS 8 Workstation step by step instructions



  1. Open up the terminal and identify your Nvidia graphic card model by executing to following command:
    $ lspci -vnn | grep VGA
    01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GP106 [GeForce GTX 1060 6GB] [10de:1c03] (rev a1) (prog-if 00 [VGA controller])
    
  2. Download the Nvidia driver package from nvidia.com using search criteria based on your Nvidia card model and the Linux operating system.
    Download an appropriate Nvidia driver for your VGA card.

    Download an appropriate Nvidia driver for your VGA card.

    Alternatively, if you know what you are doing you can download the driver directly from the Nvidia Linux driver list. Once ready you should end up with a file similar to the one shown below:

    $ ls NVIDIA-Linux-x86_64-*
    NVIDIA-Linux-x86_64-460.39.run
    
  3. Next, install package prerequisites to be able successfully compile and install Nvidia driver on you AlmaLinux system.
    # dnf groupinstall "Development Tools"
    # dnf install libglvnd-devel elfutils-libelf-devel
    
  4. Permanently disable the nouveau driver by modifying the GRUB boot menu:
    # grub2-editenv - set "$(grub2-editenv - list | grep kernelopts) nouveau.modeset=0"
    

    After execution of the above grub2-editenv command the GRUB boot line should look similar to the one below:

    # grub2-editenv - list | grep kernelopts
    kernelopts=root=/dev/mapper/almalinux-root ro crashkernel=auto resume=/dev/mapper/almalinux-swap rd.lvm.lv=almalinux/root rd.lvm.lv=almalinux/swap  nouveau.modeset=0
    
  5. Reboot your AlmaLinux 8 Desktop:
    WARNING
    Depending on your Nvidia VGA model your system might misbehave. At this stage be ready to get your hands dirty. After the reboot you may end up without GUI at all. Be sure that you have the SSH enabled on your system to be able login remotely or use CTRL+ALT+F2 to switch TTY console and continue with the installation.
    # reboot
    
  6. The Nvidia drivers must be installed while the Xorg server is stopped. Switch to the text mode by:
    #  systemctl isolate multi-user.target
    
  7. Install the Nvidia driver by executing the following command via TTY console or remote SSH login:
  8. NOTE
    ERROR: Unable to find the kernel source tree for the currently running kernel
    In case you receive the above error message during the execution of the below command, follow the kernel source instructions on how to install kernel source on CentOS / RHEL / AlmaLinux Linux system.
    # bash NVIDIA-Linux-x86_64-*
    
    When prompted answer YES to installation of NVIDIA's 32-bit compatibility libraries

    When prompted answer YES to installation of NVIDIA’s 32-bit compatibility libraries
    Allow automatically update of your X configuration file.

    Allow automatically update of your X configuration file.
    You should see the following message after successful NVIDIA driver installation.

    You should see the following message after successful NVIDIA driver installation.
  9. Reboot your system one more time.
    All done. Reboot your system. The Nvidia driver should now be installed on your AlamLinux 8 Desktop. Login and run nvidia-settings to further configure your Nvidia graphic card settings.

    # reboot


Troubleshooting

GDM on Xorg server does not start after user login and user ends up with black screen. The Xorg log contains the following or similar error messages:

[  3515.464] (II) systemd-logind: got pause for 13:68
[  3515.738] (II) systemd-logind: got resume for 13:64
[  3515.757] (II) NVIDIA(0): Setting mode "DFP-1:nvidia-auto-select"
[  3515.793] (II) NVIDIA(0): ACPI: failed to connect to the ACPI event daemon; the daemon
[  3515.793] (II) NVIDIA(0):     may not be running or the "AcpidSocketPath" X
[  3515.793] (II) NVIDIA(0):     configuration option may not be set correctly.  When the
[  3515.793] (II) NVIDIA(0):     ACPI event daemon is available, the NVIDIA X driver will
[  3515.793] (II) NVIDIA(0):     try to use it to receive ACPI event notifications.  For
[  3515.793] (II) NVIDIA(0):     details, please see the "ConnectToAcpid" and
[  3515.793] (II) NVIDIA(0):     "AcpidSocketPath" X configuration options in Appendix B: X
[  3515.793] (II) NVIDIA(0):     Config Options in the README.
[  3515.793] [dix] couldn't enable device 8
[  3515.793] (II) systemd-logind: got resume for 13:66
[  3515.793] [dix] couldn't enable device 6
[  3515.794] (II) systemd-logind: got resume for 13:65
[  3515.794] [dix] couldn't enable device 7
[  3515.794] (II) systemd-logind: got resume for 13:72
[  3515.794] [dix] couldn't enable device 14
[  3515.794] [dix] couldn't enable device 17
[  3515.794] (II) systemd-logind: got resume for 13:71
[  3515.794] [dix] couldn't enable device 13
[  3515.794] (II) systemd-logind: got resume for 13:67
[  3515.794] [dix] couldn't enable device 9
[  3515.794] (II) systemd-logind: got resume for 13:73
[  3515.794] [dix] couldn't enable device 15
[  3515.794] (II) systemd-logind: got resume for 13:69
[  3515.794] [dix] couldn't enable device 11
[  3515.794] [dix] couldn't enable device 16
[  3515.794] (II) systemd-logind: got resume for 13:70
[  3515.794] [dix] couldn't enable device 12
[  3515.794] (II) systemd-logind: got resume for 13:68
[  3515.794] [dix] couldn't enable device 10

Try restart the systemd’s systemd-logind service:

# systemctl restart systemd-logind


Comments and Discussions
Linux Forum