Install NVIDIA Drivers on Red Hat Enterprise Linux 9.x

I am a software engineer. Documenting my DevOps journey
Search for a command to run...

I am a software engineer. Documenting my DevOps journey
No comments yet. Be the first to comment.
Introduction SSH is method of securely connect to remote server and execute command on that server. To provide user access to remote server either password or SSH key needs to be shared. But this becomes cumbersome when there are many users as well a...

Introduction In this article, we ran a Python application in AWS Lambda using Docker. Now we want to add some licencing mechanism by keeping the access key or any secret key to another service or application to restrict the use of this application. H...

Introduction I have been using Ubuntu for a long time on Intel Core i5 system. The daily routine was to pull the code from the Git repositories, build docker images, push it to Dockerhub and run docker containers with those images in the production U...

Introduction In the last article, we discovered how to monitor a NodeJs application with Prometheus and Grafana. In that, we learned to collect metrics from the application like the rate of requests in the last 5 minutes, the rate of 5xx responses, b...

Introduction Application monitoring is essential in the production environment. Once the application is deployed, the traffic to the application starts increasing, after some time the application starts responding slowly or sometimes it gets failed. ...

In this article, I'll tell you how to install the NVIDIA GPU drivers on Red Hat Enterprise Linux (RHEL) 9.x
You can check whether your system has an NVIDIA GPU installed with the following command
lspci | egrep 'VGA|3D'

You can see NVIDIA Tesla T4 GPU installed in the system.
We will have to install the required build tools and the required dependency libraries for compiling the NVIDIA kernel modules. Some of these are available in the RHEL 9 EPEL repository.
First, update the DNF package repository cache with the following command
sudo dnf makecache

Enable the official RHEL 9 CodeReady Builder package repository and install it.
Following are the commands to enable and install respectively
sudo subscription-manager repos --enable codeready-builder-for-rhel-9-$(uname -i)-rpms
sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
To confirm the installation, press Y and then press <Enter>
The epel-release package should be installed, and the EPEL repository should be enabled.

For the changes to take effect, update the DNF package repository cache with the following command
sudo dnf makecache

To install the required build tools and dependency libraries for compiling the NVIDIA kernel modules on RHEL 9, run the following command
sudo dnf install kernel-devel-$(uname -r) kernel-headers-$(uname -r) gcc make dkms acpid libglvnd-glx libglvnd-opengl libglvnd-devel pkgconfig

To confirm the installation, press Y and then press <Enter>.

The required packages are being downloaded from the internet. It will take a while to complete.
Once the packages are downloaded, you will be asked to confirm the GPG key of the EPEL repository.
To confirm the GPG key, press Y and then press <Enter>.

The required dependency libraries and build tools for compiling the NVIDIA kernel module should be installed at this point.
To add the official NVIDIA CUDA package repository on RHEL 9, run the following command
sudo dnf config-manager --add-repo http://developer.download.nvidia.com/compute/cuda/repos/rhel9/$(uname -i)/cuda-rhel9.repo

For the changes to take effect, update the DNF package repository cache with the following command
sudo dnf makecache

To install the latest version of the NVIDIA GPU drivers on RHEL 9, run the following command
sudo dnf module install nvidia-driver:latest-dkms
To confirm the installation, press Y and then press <Enter>.

NVIDIA GPU drivers packages and the required dependency packages are being downloaded from the internet. It will take a while to complete.
Once the packages are downloaded, you will be asked to confirm the GPG key of the official NVIDIA package repository. Press Y and then press <Enter> to confirm the GPG key.

NVIDIA GPU drivers should be installed at this point.

For the changes to take effect, restart the system with the following command
sudo reboot
Once the system boots, you should see that the proprietary NVIDIA GPU drivers are used with the following command
lsmod | grep nvidia

You should also be able to run the NVIDIA command-line programs like nvidia-smi.
nvidia-smi

In this article, We have seen how to add the official NVIDIA CUDA repository on RHEL 9.x I have also shown you how to install the latest version of the proprietary NVIDIA GPU drivers on RHEL 9.x