This article describes how to manage GPU-P with Arc virtual machines (VMs) for Azure Local. GPU Partitioning (GPU-P) allows you to share a graphical processing unit (GPU) with multiple workloads by splitting the GPU into dedicated fractional partitions.
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.
Limitations
Consider the following limitations when using the GPU-P feature:
GPU partitioning is unsupported if your configuration isn't homogeneous. Here are some examples of unsupported configurations:
Mixing GPUs from different vendors in the same system.
Using different GPU models from different product families from the same vendor in the same system.
You can't assign a physical GPU as both Discrete Device Assignment (DDA) and as partitionable GPU (GPU-P). You can either assign it as DDA or as a partitionable GPU, but not both.
You can assign only a single GPU partition to a VM.
Partitions are autoassigned to the VMs. You can't choose a specific partition for a specific VM.
Currently, GPU partitioning on Azure Local doesn't support live migration of VMs. But VMs can be automatically restarted and placed where GPU resources are available if there's a failure.
You can partition your GPU using Azure Command-Line Interface (CLI). We recommend that you use Azure CLI to configure and assign GPU partitions. You must manually ensure that the homogeneous configuration is maintained for GPUs across all the machines in your system.
Prerequisites
See Prepare GPUs for Azure Local for requirements and to prepare your Azure Local and Arc VMs, and to ensure that your GPUs are prepared and partitioned.
Attach a GPU during Arc VM creation
Follow the steps outlined in Create Arc virtual machines on Azure Local and utilize the additional hardware profile details to add GPU to your create process. Run the following:
Azure CLI
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 GpuP
az stack-hci-vm stop --name your_VM_name --resource-group your_resource_group
You can specify the partition size in the command, as shown below. Partition sizes are the same as the minPartitionVRAM found in Get-VMHostPartitionableGpu on Hyper-V. You can also use the command without specifying the partition size, as seen in the above example.
Azure CLI
az stack-hci-vm gpu attach --resource-group"test-rg"--custom-location"test-location"--vm-name"test-vm"--gpus GpuP
After attaching the GPU partition, the output will show the full VM details. You can confirm the GPUs were attached by reviewing the hardware profile virtualMachineGPUs section. The output will look as follows:
az stack-hci-vm gpu detach --resource-group"test-rg"--custom-location"test-location"--vm-name"test-vm"--gpus GpuP
After detaching the GPU partition, the output will show the full VM details. You can confirm the GPUs were detached by reviewing the hardware profile virtualMachineGPUs. The output will look as follows:
Azure HPC is a purpose-built cloud capability for HPC & AI workload, using leading-edge processors and HPC-class InfiniBand interconnect, to deliver the best application performance, scalability, and value. Azure HPC enables users to unlock innovation, productivity, and business agility, through a highly available range of HPC & AI technologies that can be dynamically allocated as your business and technical needs change. This learning path is a series of modules that help you get started on Azure HPC - you