Skip to content

Installing NVIDIA GPU Drivers

Introduction

NVIDIA® is one of the most popular GPU manufacturers. You can install NVIDIA GPU drivers in more than one way. This guide uses NVIDIA's official repository to install their drivers. Therefore, NVIDIA Driver Installation Guide is heavily referenced here.

Some other alternative ways to install NVIDIA drivers include:

  • NVIDIA's .run installer
  • Third-party RPMFusion repository
  • Third-party ELRepo driver

In most cases, installing NVIDIA drivers from the official source is best. RPMFusion and ELRepo are available for those who prefer a community-based repository. For older hardware, RPMFusion works best. It is advisable to avoid using the .run installer. While convenient, using the .run installer is notorious for overwriting system files, and having incompatibility issues.

Assumptions

For this guide, you need the following:

  • Rocky Linux Workstation
  • sudo privileges

Install necessary utilities and dependencies

Enable the Extra Packages for Enterprise Linux (EPEL) repository:

sudo dnf install epel-release -y

Enable the CodeReady Builder (CRB) repository:

sudo dnf config-manager --enable crb

Installing development tools ensures necessary build dependencies:

sudo dnf groupinstall "Development Tools" -y

The kernel-devel package provides the necessary headers and tools to build kernel modules:

sudo dnf install kernel-devel-matched kernel-headers -y

Install NVIDIA drivers

After installing the necessary prerequisites, it is time to install the NVIDIA drivers.

Add the official NVIDIA repository with the following command:

sudo dnf config-manager --add-repo http://developer.download.nvidia.com/compute/cuda/repos/rhel10/$(uname -m)/cuda-rhel10.repo

Next, clean DNF repository cache:

sudo dnf clean expire-cache

Finally, install the latest NVIDIA driver for your system. For open kernel modules, run:

sudo dnf install nvidia-open -y

While for proprietary kernel modules, run:

sudo dnf install cuda-drivers -y

Older GPUs

Release 590 of the NVIDIA driver dropped support for Maxwell-, Pascal-, and Volta- based GPUs. On such systems, the above instructions will install the driver without an error, but on reboot will fail to load the module, since it can't find any GPUs it supports. However, if you have such a GPU, you can still install the older driver:

sudo dnf install cuda-drivers-580 -y

You will then need to protect the cuda-drivers package from future updates via dnf's versionlock plugin.

Disable Nouveau

Nouveau is an open-source NVIDIA driver that provides limited functionality compared to NVIDIA's proprietary drivers. It is best to disable it to avoid driver conflicts:

sudo grubby --args="nouveau.modeset=0 rd.driver.blacklist=nouveau" --update-kernel=ALL

Note

For systems with secure boot enabled you need to perform this step:

sudo mokutil --import /var/lib/dkms/mok.pub

The mokutil command will prompt for you to make up a password, which will be used during reboot.

After the reboot, your system should ask you if you want to enroll a key or something like that, say "yes" and it asks for the password you gave in the mokutil command.

Reboot:

sudo reboot now

Conclusion

You have successfully installed NVIDIA GPU drivers on your system using NVIDIA's official repository. Enjoy the enhanced capabilities of your NVIDIA GPU that the default Nouveau drivers can not provide.

Author: Joseph Brinkman

Contributors: Steven Spencer, Ganna Zhyrnova