Operating Systems Azure

Ubuntu 24.04 LTS GPU on Azure User Guide

| Product: Ubuntu 24.04 LTS GPU on Azure

Overview

This guide covers the deployment and use of Ubuntu 24.04 LTS GPU on Microsoft Azure, using cloudimg's preconfigured virtual machine image from the Azure Marketplace.

Ubuntu Server 24.04 LTS (Noble Numbat) is a long term support release of Ubuntu, with standard security maintenance to May 2029. This image prepares it for Azure GPU virtual machine sizes: the NVIDIA data center driver from the R620 long term support branch is installed exactly as the Ubuntu archive publishes it, so a new machine sees its GPU and can run CUDA work from the first boot. The operating system and its GPU driver are the product: there is no application layered on top.

What's included:

  • Ubuntu Server 24.04 LTS on the Azure tuned kernel (the 7.0 series), fully patched at build time, with only the running kernel installed
  • NVIDIA's open GPU kernel modules (linux-modules-nvidia-620-server-open-azure), prebuilt for the Azure kernel and signed by Canonical. There is no DKMS and no compiler on the machine: nothing is built at boot or at update time
  • The headless NVIDIA driver userspace (nvidia-headless-no-dkms-620-server-open, nvidia-utils-620-server): nvidia-smi, the CUDA driver library libcuda.so and the persistence daemon
  • The in-box nouveau driver blacklisted, so the NVIDIA driver owns the GPU
  • cloudimg-gpu-check: lists each GPU and runs a small CUDA kernel on it, checking the results, so you can prove a new machine in one command
  • Unattended security updates armed. The module metapackage tracks the kernel metapackage, so a kernel update brings the matching GPU modules with it
  • Gen2 Hyper-V virtual machine support
  • cloudimg's support team on hand 24 hours a day by email (support@cloudimg.co.uk), with a guaranteed response within 24 hours

Supported GPUs: the open kernel modules support NVIDIA Turing and newer data center GPUs: T4, A10, A100, H100 and later. On Azure that means sizes such as the NCasT4_v3 family (NVIDIA T4) and other Turing or newer GPU sizes. Older GPU generations (for example the K80, P100 or V100) are not supported by the open modules.

Platform: Microsoft Azure (Gen2 Hyper-V, x64) Default user: azureuser

Security posture

The image ships with no known credential. There is no default password and no baked-in SSH key:

  • Access is by the SSH key you supply at launch; password authentication is disabled in the SSH daemon.
  • The root account password is locked.
  • The machine identity and SSH host keys are regenerated uniquely on every virtual machine.
  • Exactly one port is needed for administration: TCP 22 for SSH. Open it only to your own administration network.

Prerequisites

  • An Azure subscription with GPU quota for the size you want, in the region you deploy to. GPU families have their own vCPU quota, often 0 by default: check it under Subscriptions > Usage + quotas (for the NC4as_T4_v3 size the family is Standard NCASv3_T4 Family) and request more there if needed.
  • An SSH key pair.
  • A virtual network, or let the portal create one.

Step 1: Deploy the virtual machine

From the Azure portal

  1. Find Ubuntu 24.04 LTS GPU by cloudimg in the Azure Marketplace and select Create.
  2. On Basics, choose your subscription, resource group and a region where your GPU size is offered.
  3. For Size, select a GPU size, for example Standard_NC4as_T4_v3 (4 vCPUs, 28 GiB memory, one NVIDIA T4 with 16 GB).
  4. Set Authentication type to SSH public key, the username to azureuser, and supply your key.
  5. Under Inbound port rules, allow SSH (22) and, on the Networking tab, restrict the source to your own IP address or administration network.
  6. Select Review + create, then Create.

From the Azure CLI

az vm create \
  --resource-group <your-resource-group> \
  --name ubuntu-gpu-1 \
  --image <the image URN shown on the Marketplace listing> \
  --size Standard_NC4as_T4_v3 \
  --admin-username azureuser \
  --ssh-key-values ~/.ssh/id_ed25519.pub \
  --public-ip-sku Standard
az vm open-port --resource-group <your-resource-group> --name ubuntu-gpu-1 --port 22

Restrict the SSH rule to your own address afterwards in the network security group.

Step 2: Connect over SSH

ssh azureuser@<public-ip-of-your-vm>

Step 3: Check the operating system and kernel

. /etc/os-release; echo "$PRETTY_NAME"; uname -r

Output:

Ubuntu 24.04.5 LTS
7.0.0-1020-azure

The kernel is Ubuntu's Azure tuned kernel. It is the only kernel installed, and the GPU modules below are built for it.

Step 4: See the driver packages

dpkg-query -W -f='${db:Status-Abbrev} ${Package} ${Version}\n' 'linux-modules-nvidia-620-server-open-*' nvidia-headless-no-dkms-620-server-open nvidia-utils-620-server libnvidia-compute-620-server
dpkg-query -W dkms 2>&1 || echo "dkms: not installed"
command -v gcc cc make || echo 'no compiler installed'

Output:

ii  libnvidia-compute-620-server 620.70.06-0ubuntu0.24.04.1
ii  linux-modules-nvidia-620-server-open-7.0.0-1020-azure 7.0.0-1020.21~24.04.2+1
ii  linux-modules-nvidia-620-server-open-azure 7.0.0-1020.21~24.04.2+1
ii  nvidia-headless-no-dkms-620-server-open 620.70.06-0ubuntu0.24.04.1
ii  nvidia-utils-620-server 620.70.06-0ubuntu0.24.04.1
dpkg-query: no packages found matching dkms
dkms: not installed
no compiler installed

The kernel modules come prebuilt from the Ubuntu archive for this exact kernel, so the machine never compiles a driver: no DKMS, no kernel headers, no compiler.

The terminal shows dpkg-query listing the installed NVIDIA R620 packages: libnvidia-compute-620-server, the open kernel modules for the 7.0.0-1020-azure kernel and their azure metapackage, nvidia-headless-no-dkms-620-server-open and nvidia-utils-620-server at 620.70.06, then no dkms package and no compiler installed

Step 5: Confirm the signed kernel module

uname -r
modinfo -F version nvidia; modinfo -F signer nvidia; modinfo -n nvidia
cat /etc/modprobe.d/cloudimg-nvidia-blacklist-nouveau.conf
lsmod | grep -c nouveau || true

Output:

7.0.0-1020-azure
620.70.06
Canonical Ltd. Kernel Module Signing
/lib/modules/7.0.0-1020-azure/kernel/nvidia-620srv-open/nvidia.ko
# cloudimg Ubuntu 24.04 LTS GPU: the NVIDIA driver drives the GPU, so the in-kernel nouveau driver never loads.
blacklist nouveau
options nouveau modeset=0
0

The nvidia module for the running kernel is driver version 620.70.06 and carries Canonical's kernel module signature. nouveau is blacklisted and not loaded.

The terminal shows uname reporting the 7.0.0-1020-azure kernel, modinfo reporting the nvidia module at version 620.70.06 signed by Canonical Ltd. Kernel Module Signing under the running kernel's module tree, the nouveau blacklist file, and a nouveau count of 0 in lsmod

Step 6: See your GPU

On a GPU size, nvidia-smi shows each GPU, the driver version and the highest CUDA version the driver supports:

nvidia-smi

On a Standard_NC4as_T4_v3 machine the table lists one Tesla T4 with about 15 GB of memory, Driver Version: 620.70.06, and no running processes. For a short machine-readable summary:

nvidia-smi --query-gpu=index,name,driver_version,memory.total --format=csv

This prints a header line and one line per GPU: its index, its name (Tesla T4 on the NC T4 sizes), the driver version 620.70.06 and its memory in MiB.

Step 7: Prove the GPU runs CUDA work

cloudimg-gpu-check checks the whole path from the driver to the GPU: it lists each GPU with nvidia-smi, then, through the CUDA driver API, has the driver compile a small CUDA kernel and runs it on every GPU, checking each result. It needs no CUDA toolkit.

cloudimg-gpu-check

On a healthy GPU machine its last line reads GPU_CHECK_OK 1 GPU(s), driver 620.70.06, CUDA <version> and it exits 0. It exits 2 with the line No NVIDIA GPU on this VM: this image needs a GPU size, such as Standard_NC4as_T4_v3. on a size without a GPU, and 1 on any other problem, so you can use it in your own provisioning checks. With --symbols it only confirms that the CUDA driver library loads and offers every call it uses, which works on any size:

cloudimg-gpu-check --symbols
libcuda.so.1 loads and has all 20 driver API calls this check makes

The terminal shows cloudimg-gpu-check --symbols reporting that libcuda.so.1 loads with all 20 driver API calls the check makes, the nvidia-smi and nvidia-persistenced binaries with libcuda.so.1 linked to libcuda.so.620.70.06, the tool's usage line, and apt-cache policy showing linux-modules-nvidia-620-server-open-azure installed at 7.0.0-1020.21~24.04.2+1

Step 8: Put your GPU stack on top

The image deliberately stops at the driver, so you choose the toolkit and framework versions. Common next steps (run these on your own machine):

  • Persistence mode keeps the driver initialised between jobs, which shortens the start of short GPU jobs. It lasts until the next reboot:

text sudo nvidia-smi -pm 1

  • The CUDA toolkit (compiler and libraries) for building CUDA code. The Ubuntu archive packages it as nvidia-cuda-toolkit (CUDA 12.0 in Ubuntu 24.04, which the R620 driver runs); NVIDIA also publishes newer toolkits in its own repository for Ubuntu. Installing a toolkit adds a compiler to the machine:

text sudo apt-get update sudo apt-get install -y nvidia-cuda-toolkit

  • Python frameworks such as PyTorch ship their own CUDA runtime libraries in their wheels and need only the driver this image provides:

text sudo apt-get install -y python3-venv python3 -m venv ~/venv && . ~/venv/bin/activate pip install torch python -c "import torch; print(torch.cuda.is_available(), torch.cuda.get_device_name(0))"

  • Containers: install Docker or another runtime and NVIDIA's Container Toolkit from NVIDIA's repository, then run GPU containers with --gpus all.

Do not install another NVIDIA driver (from a .run installer or a DKMS package) on top: it would replace the signed modules this image keeps in step with the kernel.

Step 9: Updates

Unattended upgrades are on, so security updates install by themselves:

apt-config dump | grep -E "^APT::Periodic::(Update-Package-Lists|Unattended-Upgrade) "
systemctl is-enabled apt-daily-upgrade.timer

Output:

APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";
enabled

When Ubuntu publishes a new Azure kernel, the linux-modules-nvidia-620-server-open-azure metapackage moves with it, so the new kernel arrives with its own signed NVIDIA modules. A kernel update takes effect at the next reboot; schedule one after kernel updates (cat /var/run/reboot-required shows when one is due).

On Ubuntu 24.04 the R620 driver packages are published in the noble-updates pocket:

apt-cache policy nvidia-headless-no-dkms-620-server-open | sed -n 1,6p

Output:

nvidia-headless-no-dkms-620-server-open:
  Installed: 620.70.06-0ubuntu0.24.04.1
  Candidate: 620.70.06-0ubuntu0.24.04.1
  Version table:
 *** 620.70.06-0ubuntu0.24.04.1 500
        500 http://azure.archive.ubuntu.com/ubuntu noble-updates/multiverse amd64 Packages

Ubuntu's unattended upgrades install from noble-security by default, so also run a full upgrade on your own schedule, and before you reboot into a new kernel, so the kernel, its NVIDIA modules and the driver userspace always move together:

sudo apt-get update && sudo apt-get upgrade -y

The terminal shows the release Ubuntu 24.04.5 LTS on the 7.0.0-1020-azure kernel, apt-config reporting Update-Package-Lists and Unattended-Upgrade both set to 1, apt-daily-upgrade.timer enabled, and the opening lines of the NVIDIA licence in /usr/share/doc/nvidia-kernel-common-620-server/copyright

Licensing

Ubuntu is free and open source: a collection of independently packaged components, each under its own licence (GPL, LGPL, MIT, BSD, Apache-2.0, MPL and more), listed in /usr/share/doc/<package>/copyright. The NVIDIA driver comes unmodified from the Ubuntu archive under the NVIDIA Driver License Agreement, which ships on the image; NVIDIA's open kernel modules are MIT/GPL-2.0:

ls /usr/share/doc/nvidia-kernel-common-620-server/copyright /usr/share/doc/nvidia-kernel-source-620-server-open/copyright
sed -n 1,3p /usr/share/doc/cloudimg-ubuntu-gpu/README

Output:

/usr/share/doc/nvidia-kernel-common-620-server/copyright
/usr/share/doc/nvidia-kernel-source-620-server-open/copyright
Ubuntu 24.04 LTS GPU (cloudimg Azure Marketplace image)

The NVIDIA data center driver 620.70.06 (branch 620-server) from the Ubuntu archive, installed without DKMS:

No subscription, licence key or support contract is required. Ubuntu Pro is optional and not attached. The cloudimg charge covers packaging, security patching, GPU validation, image maintenance and support, not the driver.

Troubleshooting

  • cloudimg-gpu-check says there is no NVIDIA GPU: the machine is on a size without a GPU. Resize it to a GPU size such as Standard_NC4as_T4_v3 (stop it, change the size, start it).
  • nvidia-smi says it couldn't communicate with the NVIDIA driver: on a GPU size, check that the module loaded (lsmod | grep nvidia) and that you are running the kernel the modules are for (uname -r against modinfo -n nvidia). After a kernel update, reboot so the new kernel and its modules load together.
  • Secure Boot: this image does not use Trusted Launch, so deploy it as a standard security type virtual machine. The modules are signed by Canonical regardless.
  • The GPU size is not offered or the deployment fails on quota: request GPU quota for the size's family in that region under Usage + quotas, or choose another region.

Support

cloudimg's support team is on hand 24 hours a day by email at support@cloudimg.co.uk, with a guaranteed response within 24 hours.

NVIDIA, CUDA and Tesla are trademarks of NVIDIA Corporation. Ubuntu is a trademark of Canonical Ltd. cloudimg is not affiliated with or endorsed by NVIDIA or Canonical.