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.


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


  • 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

  • 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