Skip to content

Install Nvidia CUDA on RHEL

Tested on RHEL8.

Master doc: https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html

Verify You Have a CUDA-Capable GPU:

lspci | grep -i nvidia

Verify You Have a Supported Version of Linux:

uname -m && cat /etc/*release

Verify the System Has gcc Installed:

gcc --version

Verify the System has the Correct Kernel Headers and Development Packages Installed:

sudo dnf install kernel-devel-$(uname -r) kernel-headers-$(uname -r)

Network Repo Installation for RHEL 8:

export distro=rhel8
export arch=x86_64
sudo dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/$distro/$arch/cuda-$distro.repo
sudo dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/$distro/$arch/cuda-$distro.repo
sudo dnf clean expire-cache

Install CUDA SDK:

sudo dnf module install nvidia-driver:latest-dkms
sudo dnf install cuda

Try it:

nvidia-smi