Here's a detailed article on using Hyper-V with NVIDIA DDA VMs on a Windows Server 2022 machine:
Hyper-V with NVIDIA DDA VMs on Windows Server 2022
In this article, we will discuss how to set up and configure Hyper-V with NVIDIA DDA (Direct Data Access) VMs on a Windows Server 2022 machine. This setup allows you to leverage the power of NVIDIA GPUs for GPU-accelerated workloads in virtual machines.
Prerequisites
Before we begin, ensure that your host machine meets the following requirements:
- Operating System: Windows Server 2022
- GPU: NVIDIA (4x3 or more)
- CPU: Intel Xeon Gold 6542Y (VT-d enabled)
- IOMMU/SR-IOV: Enabled in BIOS
Setting up Hyper-V
- Install Hyper-V role on Windows Server 2022. You can do this via Server Manager or PowerShell.
Install-WindowsFeature -Name Hyper-V -IncludeManagementTools
- Configure the Hyper-V settings.
- Open Hyper-V Manager.
- Right-click on the server name and select
Hyper-V Settings. - In the settings window, enable
Virtual Machines,Virtual Hard Disks,Virtual Switches, andExternal Hard Disks.
Installing NVIDIA Drivers
-
Download the latest NVIDIA drivers for your GPU from the official NVIDIA website.
-
Install the drivers on the host machine.
Configuring NVIDIA GPU Passthrough
-
Identify the PCI ID of the NVIDIA GPU you want to pass through to the VM. You can find this information in the Device Manager or by using the
lsusbcommand in Linux. -
Disable the GPU in the BIOS.
-
Edit the
Hyper-Vboot configuration data (BCD) file to allow PCI device assignment.
bcdedit /set nvsvc-disable 0
- Configure the VM settings to enable GPU passthrough.
- Create a new VM or edit an existing one.
- Under
Settings>Integration Services, disableAccelerated 3D Graphics. - Under
Settings>Management>Add Hardware, add a newLegacy Adapter. - In the
Integration Servicessection of the new adapter, enableAccelerated 3D Graphics. - Under
Settings>Management>Add Hardwareagain, add a newLegacy PCI Device. - In the
Resource Settingssection of the new PCI device, select the GPU you want to pass through and set theConnectiontoPCI Passthrough.
- Start the VM and verify that the GPU is working correctly inside the VM.
Troubleshooting
If you encounter issues with GPU passthrough, ensure that:
- The GPU is properly disabled in the BIOS.
- The NVIDIA drivers are up-to-date.
- The VM is configured to use the correct GPU.
- The VM is configured to allow 3D acceleration.