Running hardware-accelerated workloads, 3D rendering engines, AI inferencing pipelines, or fluid graphical desktops inside virtual machines requires direct GPU resource sharing. While Discrete Device Assignment (DDA) dedicates an entire physical graphics card exclusively to a single virtual machine (VM), Hyper-V GPU Partitioning (GPU-P) leverages DirectX 12 Paravirtualisation to slice a single host GPU across multiple guest VMs simultaneously. In Windows 11, administrators can configure GPU-P on desktop and workstation systems using native PowerShell cmdlets and targeted graphics driver file provisioning.
Understanding Hyper-V GPU-P Paravirtualisation
GPU Partitioning operates by exposing a virtual GPU adapter (Microsoft Remote Display Adapter with DirectX paravirtualised compute pipelines) inside the guest operating system. The guest kernel forwards API rendering calls directly to the host kernel graphics subsystem (dxgkrnl.sys), achieving near-bare-metal compute and 3D rendering throughput without the overhead of software rasterisation.
Implementing GPU-P requires three distinct steps:
- Host GPU Partition Adapter Attachment: Allocating a virtual GPU partition adapter to the target virtual machine using the
Add-VMGpuPartitionAdaptercmdlet. - Resource Throttling and Memory Limits: Defining optimal compute, encode, decode, and VRAM memory reservation limits.
- Guest Driver Infrastructure Mirroring: Copying the specific host graphics driver binaries and DirectX user-mode runtime libraries into the guest VM’s
System32hierarchy.
Prerequisites and Environment Preparation
Before configuring GPU-P, ensure your host environment satisfies the virtualization and driver requirements:
- Windows 11 Pro, Enterprise, or Education (Version 22H2 or later).
- Hyper-V Virtualisation Feature enabled with SLAT (Second Level Address Translation).
- A modern dedicated or integrated GPU supporting WDDM 2.5 or higher (NVIDIA GeForce/RTX, AMD Radeon, or Intel Arc).
- The target VM must be configured as a Generation 2 virtual machine running a 64-bit Windows guest OS.
Configuring the Virtual Machine for GPU Partitioning
Open an elevated PowerShell session (Run as Administrator) on the Windows 11 host. First, shut down the target virtual machine and configure guest memory and checkpoint settings to support hardware pass-through:
# Define the target VM name
$VMName = "Win11-Dev-VM"
# Stop the VM if running
Stop-VM -Name $VMName -Force -Confirm:$false
# Disable dynamic memory (GPU-P requires static memory allocation)
Set-VMMemory -VMName $VMName -DynamicMemoryEnabled $false
# Configure automatic stop action to ShutDown
Set-VM -Name $VMName -AutomaticStopAction ShutDown
# Set checkpoint type to Standard or Disabled (Production checkpoints can interfere with hardware states)
Set-VM -Name $VMName -CheckpointType Standard
Attaching and Allocating the GPU Partition Adapter
Assign a virtual GPU partition to the VM using Add-VMGpuPartitionAdapter. By default, the cmdlet assigns a partition across the default primary graphics adapter:
# Attach the GPU partition adapter
Add-VMGpuPartitionAdapter -VMName $VMName
# Inspect the assigned adapter configuration
Get-VMGpuPartitionAdapter -VMName $VMName | Format-List
To customise resource reservations (for instance, allocating 50% of GPU compute and memory to the guest), adjust the partition weights:
Set-VMGpuPartitionAdapter -VMName $VMName `
-MinPartitionVRAM 100000000 `
-MaxPartitionVRAM 2000000000 `
-OptimalPartitionVRAM 1000000000 `
-MinPartitionEncode 100000000 `
-MaxPartitionEncode 2000000000 `
-OptimalPartitionEncode 1000000000 `
-MinPartitionDecode 100000000 `
-MaxPartitionDecode 2000000000 `
-OptimalPartitionDecode 1000000000 `
-MinPartitionCompute 100000000 `
-MaxPartitionCompute 2000000000 `
-OptimalPartitionCompute 1000000000
Provisioning Host Driver Files to the Guest VM
Because the guest VM does not run a standard driver installer, you must provide the host graphics runtime libraries so the guest DirectX subsystem can communicate with the host kernel driver:
- Locate the host graphics driver store under:
Find the active driver folder corresponding to your GPU vendor (e.g.,C:\Windows\System32\DriverStore\FileRepository\nv_dispi.inf_amd64_*for NVIDIA oru03*.inf_amd64_*for AMD). - Copy the host driver folder into the guest virtual machine at the exact same location:
C:\Windows\System32\DriverStore\FileRepository\<DriverFolder> - Copy the DirectX runtime DLL (
nvapi64.dllfor NVIDIA or vendor equivalent) anddxgi.dllfrom the hostC:\Windows\System32\directory into the guest VM’sC:\Windows\System32\directory.
You can automate this file transfer by mounting the VM’s VHDX while the VM is stopped:
# Mount the guest virtual disk on the host
$VHDPath = (Get-VMHardDiskDrive -VMName $VMName).Path
$DiskImage = Mount-DiskImage -ImagePath $VHDPath -PassThru
$DriveLetter = ($DiskImage | Get-Disk | Get-Partition | Where-Object { $_.Type -eq 'Basic' } | Get-Volume).DriveLetter
Write-Host "Mounted VHDX at drive: $DriveLetter`:\"
# Copy driver repository from host to guest VHDX
$HostDriver = (Get-ChildItem -Path "C:\Windows\System32\DriverStore\FileRepository" -Filter "*nv_dispi*").FullName
$GuestTarget = "$($DriveLetter):\Windows\System32\DriverStore\FileRepository\"
Copy-Item -Path $HostDriver -Destination $GuestTarget -Recurse -Force
# Dismount the virtual hard disk
Dismount-DiskImage -ImagePath $VHDPath
Validating GPU Acceleration Inside the Guest VM
Start the virtual machine:
Start-VM -Name $VMName
Log in to the guest operating system via Enhanced Session or RDP. Open Task Manager, navigate to the Performance tab, and verify that a dedicated GPU 0 entry appears, displaying GPU 3D rendering engines, copy queues, and dedicated video memory utilisation. Run dxdiag to verify full DirectX 12 Feature Level 12_1 hardware acceleration.