https://docs.nvidia.com/grid/5.0/grid-vgpu-user-guide/index.html#using-gpu-pass-through-windows-server-hyper-v
On supported versons of Microsoft Windows Server with Hyper-V role, you can use Discrete Device Assignment (DDA) to enable a VM to access a GPU directly.
Perform this task in Windows PowerShell. If you do not know the location path of the GPU that you want to assign to a VM, use Device Manager to obtain it.
Ensure that the following prerequisites are met:
- Windows Server with Desktop Experience and the Hyper-V role are installed and configured on your server platform, and a VM is created.
For instructions, refer to the following articles on the Microsoft technical documentation site:
- The guest OS is installed in the VM.
- The VM is powered off.
- Obtain the location path of the GPU that you want to assign to a VM.
- In the device manager, context-click the GPU and from the menu that pops up, choose Properties.
- In the Properties window that opens, click the Details tab and in the Properties drop-down list, select Location paths.
- Dismount the GPU from host to make it unavailable to the host so that it can be used solely by the VM.gpu-device-location
- This example dismounts the GPU at the location path PCIROOT(80)#PCI(0200)#PCI(0000)#PCI(1000)#PCI(0000).
Dismount-VMHostAssignableDevice -LocationPath "PCIROOT(80)#PCI(0200)#PCI(0000)#PCI(1000)#PCI(0000)" -force
The location path of the GPU that you obtained in the previous step.
Dismount-VMHostAssignableDevice -LocationPath gpu-device-location -force
- Assign the GPU that you dismounted in the previous step to the VM.gpu-device-location
- Note: You can assign a pass-through GPU to only one virtual machine at a time.
This example assigns the GPU at the location path PCIROOT(80)#PCI(0200)#PCI(0000)#PCI(1000)#PCI(0000) to the VM VM1.
Add-VMAssignableDevice -LocationPath "PCIROOT(80)#PCI(0200)#PCI(0000)#PCI(1000)#PCI(0000)" -VMName VM1
The location path of the GPU that you dismounted in the previous step.
- vm-name
The name of the VM to which you are attaching the GPU.
Add-VMAssignableDevice -LocationPath gpu-device-location -VMName vm-name
- Power on the VM. The guest OS should now be able to use the GPU.
After assigning a GPU to a VM, install the NVIDIA graphics driver in the guest OS on the VM as explained in Installing the NVIDIA vGPU Software Graphics Driver.