Configuring Hyper-V Discrete Device Assignment in Windows Server 2025 gives enterprise virtual machines direct, unmediated access to physical PCIe hardware. While Hyper-V GPU-Partitioning (GPU-P) abstracts GPU compute through shared host drivers, Discrete Device Assignment (DDA) detaches the physical peripheral directly from the host operating system kernel. It mounts the target device directly into the VM address space via physical Direct Memory Access (DMA) and interrupt remapping. For production environments executing deep learning inference, high-density transcode pipelines, or dedicated hardware NVMe arrays, DDA completely eliminates virtualization abstraction penalties.
- Architectural Prerequisites: IOMMU, SR-IOV, and ACS Topology
- Locating the PCIe LocationPath and Dismounting from Host
- VM Configuration: MMIO Space Allocation & Parameters
- Assigning the PCIe Endpoint to the Guest VM
- DDA Rollback: Re-attaching Hardware to the Host
- Discrete Device Assignment vs. GPU-Partitioning (GPU-P)
- Frequently Asked Questions (FAQ)
Architectural Prerequisites: IOMMU, SR-IOV, and ACS Topology
DDA bypasses the hypervisor layer entirely. Because of this, it relies strictly on bare-metal hardware support within the host platform. Before attempting PCIe dismounts, ensure that your BIOS/UEFI firmware exposes three non-negotiable architectural flags:
- IOMMU Support: Intel VT-d (Virtualization Technology for Directed I/O) or AMD-Vi must be enabled to translate guest physical addresses (GPA) into host physical addresses (HPA). Modern multi-socket platforms equipped with enterprise server-grade processors with native IOMMU support enforce strict page tables at the hardware root level.
- PCIe Access Control Services (ACS): ACS prevents peer-to-peer PCIe transactions between endpoints behind the same root port without passing through the host IOMMU. If two PCIe devices reside in an unseparated ACS group, assigning one device to a VM compromises host memory integrity. Hyper-V will block assignment if ACS isolation fails.
- Second-Level Address Translation (SLAT): Hardware-enforced Extended Page Tables (EPT) or Nested Page Tables (NPT) must be verified via Coreinfo or PowerShell.
To inspect your current host PCIe topology and verify if an endpoint is eligible for assignment, review the official Microsoft Learn Discrete Device Assignment deployment guide or execute the following baseline interrogation script in an elevated PowerShell session:
# Query all present PCI display adapters and enterprise storage controllers
Get-PnpDevice -PresentOnly | Where-Object { $_.Class -in @("Display", "SCSIAdapter") } |
Select-Object FriendlyName, InstanceId, Class, Status |
Format-Table -AutoSize
Locating the PCIe LocationPath and Dismounting from Host
Hyper-V does not bind devices using vendor or device IDs; it targets the specific physical routing topology via the LocationPath property. This string defines the exact PCI root complex, bus, device, and function (BDF) routing.
# Extract the unique LocationPath for the target GPU
$InstanceId = (Get-PnpDevice -FriendlyName "*RTX*" -PresentOnly).InstanceId
$LocationPath = (Get-PnpDeviceProperty -InstanceId $InstanceId -KeyName "DEVPKEY_Device_LocationPaths").Data[0]
Write-Host "Target Device Path: $LocationPath" -ForegroundColor Cyan
Once the LocationPath is extracted, the device must be severed from the Windows Server host driver stack. Attempting to dismount an active device without disabling it first will trigger kernel access violations.
# Step 1: Disable the device driver on the host system
Disable-PnpDevice -InstanceId $InstanceId -Confirm:$false
# Step 2: Unbind and dismount the PCIe device from the host kernel
Dismount-VMHostAssignableDevice -LocationPath $LocationPath -Force
VM Configuration: MMIO Space Allocation & Parameters
Guest virtual machines hosting DDA devices must adhere to rigid configuration rules. Hyper-V will fail to boot a guest VM if dynamic memory allocation is active or if Memory-Mapped I/O (MMIO) buffers are insufficient to accommodate the physical device’s Base Address Registers (BARs).
- Generation 2 Only: DDA does not support legacy BIOS emulation (Generation 1).
- Static Memory: Hyper-V Dynamic Memory must be disabled; physical device DMA buffers require pinned, non-pageable physical host RAM.
- Automatic Stop Action: Guest VMs with assigned hardware cannot be saved (Save State). The stop action must be set to
TurnOff.
$VMName = "Enterprise-Compute-VM"
# Enforce static memory allocation and mandatory stop action
Set-VMMemory -VMName $VMName -DynamicMemoryEnabled $false
Set-VM -VMName $VMName -AutomaticStopAction TurnOff
# Allocate 32-bit (Low) and 64-bit (High) MMIO Addressing Space
# Modern GPUs with Resizable BAR typically require >32GB of High MMIO space
Set-VM -VMName $VMName -LowMemoryMappedIoSpace 3Gb -HighMemoryMappedIoSpace 33Gb
Assigning the PCIe Endpoint to the Guest VM
With host dismount complete and MMIO buffers mapped, assign the physical device to the guest VM container:
# Attach the dismounted PCIe endpoint directly into the guest VM
Add-VMAssignableDevice -VMName $VMName -LocationPath $LocationPath
# Verify assignment state
Get-VMAssignableDevice -VMName $VMName | Select-Object LocationPath, ResourcePoolName
Start the virtual machine. Inside the guest OS (Windows or Linux), open Device Manager or run lspci -nnk. The hardware will appear as a native PCIe device. Install official enterprise drivers directly inside the guest OS.
DDA Rollback: Re-attaching Hardware to the Host
If hardware maintenance or cluster rebalancing requires returning the PCIe peripheral to host control, execute this rollback sequence:
# Step 1: Remove device assignment from VM (VM must be turned off)
Remove-VMAssignableDevice -VMName $VMName -LocationPath $LocationPath
# Step 2: Re-mount the device into the host root namespace
Mount-VMHostAssignableDevice -LocationPath $LocationPath
# Step 3: Enable the host driver stack
Enable-PnpDevice -InstanceId $InstanceId -Confirm:$false
Discrete Device Assignment vs. GPU-Partitioning (GPU-P)
Selecting between raw hardware passthrough and software partitioning depends on your operational requirements for isolation versus resource pooling:
| Metric / Feature | Discrete Device Assignment (DDA) | GPU-Partitioning (GPU-P) |
|---|---|---|
| Virtualization Overhead | Near-zero (<1% native performance) | 3% to 8% (Host scheduling penalty) |
| VRAM & Compute Allocation | 100% dedicated to single VM | Dynamically shared among multiple VMs |
| Direct Compute / CUDA Access | Unrestricted bare-metal registers | Restricted by host driver API translation |
| Live Migration Support | Unsupported (Hardware-pinned state) | Supported with state checkpointing |
| Host Stability Impact | Host crash isolated from guest fault | Host driver fault crashes all guest VMs |
Frequently Asked Questions (FAQ)
Can I use Hyper-V DDA with consumer NVIDIA GeForce GPUs?
Yes. While NVIDIA historically triggered Error 43 in virtual environments, recent driver branches (version 465.89 and newer) removed artificial hypervisor virtualization locks. However, consumer cards lack SR-IOV support, meaning the entire physical card must be mapped to a single virtual machine.
Why does the VM fail to boot after running Add-VMAssignableDevice?
The primary root cause is insufficient High MMIO memory space. Modern GPUs require large MMIO apertures to map onboard VRAM. Ensure HighMemoryMappedIoSpace is configured to at least 33GB or higher using the Set-VM command.
Does Discrete Device Assignment support NVMe SSD controllers?
Yes. Entire PCIe NVMe controllers can be dismounted from the host and assigned directly to a guest VM, delivering sub-millisecond I/O latencies without hypervisor virtual disk (VHDX) translation overhead.
For homelabs, remote testing, and staging environments, we run NVMe VDS instances on Erahost. Fast provisioning, European routing, and predictable I/O.
View NVMe Plans →