How to Enable GPU Passthrough in Hyper-V Virtual Machines

Unlock the full potential of your Hyper-V VMs by directly assigning a physical GPU, boosting graphics performance for demanding tasks like 3D rendering and gaming.

How to Enable GPU Passthrough in Hyper-V Virtual Machines

GPU passthrough allows virtual machines (VMs) to directly access physical graphics cards, significantly improving performance for graphics-intensive applications. This guide will walk you through the process of setting up GPU passthrough in Hyper-V, Microsoft’s built-in virtualization platform.

Prerequisites for GPU Passthrough

Before you begin, ensure your system meets these requirements:

  • A processor supporting Intel VT-d or AMD-V virtualization technology.
  • IOMMU (Input-Output Memory Management Unit) support in your CPU.
  • A GPU that supports virtualization (e.g., NVIDIA GRID or AMD MxGPU).
  • Windows Server 2016 or later, or Windows 10/11 Pro or Enterprise.
  • Hyper-V role installed and configured.
  • Generation 2 virtual machines only.

Important: GPU passthrough is not compatible with certain Hyper-V features like Live Migration, checkpoints, or dynamic memory allocation.

Enabling Hardware Virtualization

Step 1: Restart your computer and enter the BIOS/UEFI settings (usually by pressing F2, Del, or another key during startup).

Step 2: Look for an option called “Virtualization Technology,” “Intel VT-d,” “AMD-V,” or something similar. Enable this setting.

Step 3: Save your changes and exit the BIOS/UEFI. Your computer will restart.

Step 4: Once Windows has booted, open PowerShell as an administrator and run this command to verify IOMMU support:

(Get-VMHost).IovSupport

If it returns “True,” IOMMU is enabled and you can proceed. If it’s “False,” you may need to enable it in the BIOS or your hardware might not support it.

Preparing the Virtual Machine

Step 1: Open Hyper-V Manager and select your target VM.

Step 2: Right-click the VM and choose “Settings.”

Step 3: Under “Checkpoints,” select “Disable checkpoints” to ensure compatibility with GPU passthrough.

Step 4: In PowerShell, run these commands to configure the VM for GPU passthrough, replacing “YourVMName” with your actual VM name:

Set-VM -Name "YourVMName" -AutomaticStopAction TurnOff
Set-VM -Name "YourVMName" -GuestControlledCacheTypes $true -LowMemoryMappedIoSpace 1Gb -HighMemoryMappedIoSpace 32Gb

Setting Up GPU Passthrough on Windows 10/11

Step 1: Check if your GPU supports partitioning by running this PowerShell command:

# For Windows 10
Get-VMPartitionableGpu

# For Windows 11
Get-VMHostPartitionableGpu

Step 2: Download the Easy-GPU-PV script from GitHub: Easy-GPU-PV Repository

Step 3: Extract the ZIP file to a convenient location.

Step 4: Open PowerShell as an administrator and navigate to the extracted folder. Run these commands:

Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass -Force
.\Update-VMGpuPartitionDriver.ps1 -VMName "YourVMName" -GPUName "AUTO"

Step 5: Add the GPU to your VM with this command:

Add-VMGpuPartitionAdapter -VMName "YourVMName"

Setting Up GPU Passthrough on Windows Server

Step 1: Open PowerShell as an administrator and run this command to configure the VM:

Set-VM -Name "YourVMName" -GuestControlledCacheTypes $True -LowMemoryMappedIoSpace 3Gb -HighMemoryMappedIoSpace 33280Mb

Step 2: Identify your GPU’s PCI address with this command:

Get-PnpDevice -Class Display | ForEach-Object { 
    Write-Output "$($_.FriendlyName) has a device id of $($_.DeviceId) and is located at $($_ | Get-PnpDeviceProperty DEVPKEY_Device_LocationPaths | Select-Object -ExpandProperty Data | Where-Object { $_ -like "PCIROOT*" })"; 
}

Step 3: Disable the GPU in Device Manager.

Step 4: Dismount the GPU from the host system, replacing “PCIROOT(0)#PCI(0200)” with your GPU’s actual PCI address:

Dismount-VmHostAssignableDevice -LocationPath "PCIROOT(0)#PCI(0200)" -Force

Step 5: Assign the GPU to your VM:

Add-VMAssignableDevice -VMName "YourVMName" -LocationPath "PCIROOT(0)#PCI(0200)"

Step 6: Start your VM and install the appropriate GPU drivers within the virtual machine.

Verifying GPU Passthrough

Step 1: Start your virtual machine and log in.

Step 2: Open Device Manager within the VM and check under “Display adapters.” You should see your physical GPU listed.

Step 3: Install the latest GPU drivers from the manufacturer’s website if they’re not already present.

Step 4: Run a GPU-intensive application or benchmark tool to verify that the passthrough is working correctly.


With GPU passthrough configured, your Hyper-V virtual machine now has direct access to your physical GPU, significantly boosting graphics performance. This setup is ideal for running resource-intensive applications like CAD software, video editing tools, or even games within a virtual environment.