Home / How to install Nvidia CUDA on AlmaLinux 8 and CentOS

How to install Nvidia CUDA on AlmaLinux 8 and CentOS

  • Remove the currently installed driver from your AlmaLinux server if installed using CUDA toolkit runfile.

/usr/local/cuda-X.Y/bin/cuda-uninstall

  • If you have used the NVIDIA driver runfile for installation, use the following command for uninstallation.

/usr/bin/nvidia-uninstall

  • Add EPEL repository,

dnf install epel-release

  • Run the update command to let the system rebuild the repository cache. After updating, you will not face any problem while installing any package available via this repo.

dnf update

  • Check the added EPEL repo.

rpm -q epel-release

  • Add the CUDA repository. NVIDIA maintains its own repository here.

yum config-manager --add-repo http://developer.download.nvidia.com/compute/cuda/repos/rhel8/x86_64/cuda-rhel8.repo

  • Install kernel-headers so DKMS can compile the NVIDIA kernel module.

dnf install kernel-devel

  • Install CUDA.

dnf install cuda

  • Reboot the server.
  • After reboot, check available GPU with nvidia-smi.

Leave a Reply