Darryl Dias

13 Dec 2021 in

This article will cover installing and setting up official Nvidia drivers on Red Hat Enterprise Linux; this method has been tried and tested on RHEL 8.

It works best on the default kernel that ships with RHEL 8. If you have a custom Kernel or modified setup, you might need extra steps. The additional steps are out of the scope of this article.

Let’s get straight into it. (The step speed may vary depending on your internet connection)

Step 1. Adding the official Nvidia drivers repository to our package managers repository list.

<pre class="wp-block-code">```
sudo dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel8/x86_64/cuda-rhel8.repo

Step 2. Installing the kernel-devel and headers used by the drivers.
```
sudo dnf install kernel-devel-$(uname -r) kernel-headers-$(uname -r)
```
```

Step 3. Installing Nvidia drivers and settings application.

The command below will download the latest stable driver available.

```
```
sudo dnf install nvidia-driver nvidia-settings
```
```

Step 4. Installing CUDA drivers. (This is optional but recommended)

```
```
sudo dnf install cuda-driver
```
```

Step 5. Reboot your system.

Step 6. Verify that it is working by running `nvidia-smi`

```
```
nvidia-smi
```
```

The nvidia-smi command should display information about your graphics card; if this command fails to show the details or throws an error after the command is entered, the driver did not install it correctly.

To remove the drivers altogether.

Run the command below.

```
```
sudo dnf remove nvidia-driver nvidia-settings cuda-driver kernel-devel-$(uname -r) kernel-headers-$(uname -r)
```
```

https://darryldias.me/2022/install-nvidia-drivers-on-rhel-9/
Running RHEL 9 follow this guide
https://darryldias.me/2021/nvidia-drivers-on-rocky-linux/