Installing NVIDIA Drivers, CUDA on Azure NVadsA10_v5 VM (Ubuntu 22.04)

This is how I got it working for Standard_NV72ads_A10_v5 :

Installing the NVIDIA Driver on an Azure VM

Prerequisites

  • This guide is specifically for Azure VMs using GRID drivers for Azure.
  • The VM must be created in Standard mode to disable Trusted Launch.

1. Connect to Your VM

  • Use SSH to connect to your Azure VM.
ssh your-username@your-vm-ip-address

2. Update the Package List

  • Before installing new packages, update the package list.
sudo apt-get update

3. Install Necessary Packages

  • Install the required packages for building the NVIDIA driver.
sudo apt-get install -y build-essential

4. Blacklist Nouveau Drivers

  • Ensure that the Nouveau drivers are blacklisted to prevent conflicts.
echo "blacklist nouveau" | sudo tee /etc/modprobe.d/blacklist-nouveau.conf
echo "options nouveau modeset=0" | sudo tee -a /etc/modprobe.d/blacklist-nouveau.conf
sudo update-initramfs -u

5. Reboot the VM

  • Reboot your VM to apply changes.
sudo reboot

6. Download Driver File and Make the Driver File Executable

  • Download the GRID driver file for Azure and change its permissions to make it executable.
wget -P /tmp https://download.microsoft.com/download/8/d/a/8da4fb8e-3a9b-4e6a-bc9a-72ff64d7a13c/NVIDIA-Linux-x86_64-535.161.08-grid-azure.run
chmod +x /tmp/NVIDIA-Linux-x86_64-535.161.08-grid-azure.run

7. Run the NVIDIA Installer

  • Execute the installer script.
sudo /tmp/NVIDIA-Linux-x86_64-535.161.08-grid-azure.run --silent

8. Verify the Installation

  • After installation, verify that the driver is installed correctly.
nvidia-smi

9. Clean Up

  • Optionally, you can remove the installer file as it is no longer needed.
rm /tmp/NVIDIA-Linux-x86_64-535.161.08-grid-azure.run

Notes

Kernel Headers

  • If the installer complains about missing kernel headers, you may need to install them using:
sudo apt-get install linux-headers-$(uname -r)

No Display Manager

  • Since your VM is headless, there’s no need to stop any display manager.
1 Like