Manage GPUs via Discrete Device Assignment (preview)
Article
Applies to: Azure Local 2311.2 and later
This article describes how to manage GPU DDA with Arc virtual machines (VMs) on Azure Local. For GPU DDA management on AKS enabled by Azure Arc, see Use GPUs for compute-intensive workloads.
Discrete Device Assignment (DDA) allows you to dedicate a physical graphical processing unit (GPU) to your workload. In a DDA deployment, virtualized workloads run on the native driver and typically have full access to the GPU's functionality. DDA offers the highest level of app compatibility and potential performance.
Important
This feature is currently in PREVIEW. See the Supplemental Terms of Use for Microsoft Azure Previews for legal terms that apply to Azure features that are in beta, preview, or otherwise not yet released into general availability.
Prerequisites
Before you begin, satisfy the following prerequisites:
Follow the setup instructions found at Prepare GPUs for Azure Local to prepare your Azure Local and Arc VMs, and to ensure that your GPUs are prepared for DDA.
az stack-hci-vm create --name$vmName--resource-group$resource_group--admin-username$userName--admin-password$password--computer-name$computerName--image$imageName--location$location--authentication-type all --nics$nicName--custom-location$customLocationID--hardware-profilememory-mb="8192"processors="4"--storage-path-id$storagePathId--gpus GpuDDA
Attach a GPU after Arc VM creation
Use the following CLI command to attach the GPU:
Azure CLI
az stack-hci-vm gpu attach --resource-group"test-rg"--custom-location"test-location"--vm-name"test-vm"--gpus GpuDDA
After attaching the GPU, the output shows the full VM details. You can confirm the GPUs were attached by reviewing the hardware profile virtualMachineGPUs section - the output looks like this:
az stack-hci-vm gpu detach --resource-group"test-rg"--custom-location"test-location"--vm-name"test-vm"
After detaching the GPU, the output shows the full VM details. You can confirm the GPUs were detached by reviewing the hardware profile virtualMachineGPUs section - the output looks like this: