CUDA (Compute Unified Device Architecture) is a parallel computing platform and API model created by NVIDIA. It enables significant performance improvements by utilizing the power of NVIDIA GPUs for general-purpose computing. Installing CUDA on Ubuntu Cloud Servers with a cloud GPU allows you to leverage GPU acceleration for tasks such as machine learning, data processing, and scientific simulations. In this guide, we will walk you through the steps to install CUDA drivers on AlmaLinux Cloud Servers.
Update the package list and upgrade existing packages.
# sudo yum update -y
Install development tools and kernel headers necessary for building the NVIDIA driver.
# sudo yum groupinstall "Development Tools" -y
# sudo yum install kernel-devel kernel-headers -y
# sudo yum install wget dkms -y
The Nouveau driver may interfere with the NVIDIA driver. To disable it, follow these steps:
Create a file to blacklist Nouveau:
# sudo bash -c "echo 'blacklist nouveau' > /etc/modprobe.d/blacklist-nouveau.conf"
# sudo bash -c "echo 'options nouveau modeset=0' >> /etc/modprobe.d/blacklist-nouveau.conf"
Rebuild the kernel initramfs:
# sudo dracut --force
Reboot the system to apply the changes:
# sudo reboot
Go to the LayerStack CUDA Toolkit Download mirror
and download the NVIDIA CUDA to the server.
# wget hk01.layerstack.com/nvidia-linux-grid-550-550.90.07-1.x86_64.rpm
# rpm -ivh nvidia-linux-grid-550-550.90.07-1.x86_64.rpm
Install the latest NVIDIA driver (or a specific version if needed):
# sudo yum install nvidia-driver-latest-dkms -y
Download the VGPU license file.
# wget hk01.layerstack.com/nv-layerstack-alamlinux8.tok
Verify installation now, reboot the server to apply all changes.
# sudo reboot
After rebooting, check if the GPU drivers and CUDA were installed correctly by running.
# nvidia-smi
The output will be as in screenshot: