A fork of Easy-GPU-PV dedicated to just adding GPU Paravirtualization to existing Windows Hyper-V VMs without including any other components.
GPU-PV allows you to partition your system's dedicated or integrated GPU and assign it to several Hyper-V VMs. It's the same technology used in WSL2 and Windows Sandbox. Just-GPU-PV aims to make this easier by automating the steps required to get a GPU-PV VM up and running.
Just-GPU-PV does not include any other components for VMs apart from adding GPU-PV support for existing VMs. The scripts only perform the following actions:
- Partitions your GPU of choice and copies the required driver files to the VM.
- You should now be ready to proceed!
- Windows 10 version 20H1 or newer (Pro, Enterprise, or Education editions) OR Windows 11 (Pro, Enterprise, or Education editions). Windows 11 on both the host and VM is preferred due to better compatibility.
- Matched Windows versions between the host and VM. Mismatches may cause compatibility issues, BSODs, or other problems. (e.g., Win10 21H1 + Win10 21H1, or Win11 21H2 + Win11 21H2)
- Desktop computer with a dedicated NVIDIA/AMD GPU or an integrated Intel GPU. Laptops with NVIDIA GPUs are not supported at this time, but Intel integrated GPUs work on laptops. The GPU must support hardware video encoding (NVIDIA NVENC, Intel Quick Sync, or AMD AMF).
- Virtualization enabled in the motherboard, and Hyper-V fully enabled on Windows 10/11 OS (requires reboot).
- Allow PowerShell scripts to run on your system—typically by running
Set-ExecutionPolicy unrestrictedin PowerShell as Administrator.
- Make sure your environment meets the prerequisites.
- Download and extract the repository.
- Open PowerShell as administrator and change directory (CD) to the path where
PreChecks.ps1,Add-GpuToExistingVM.ps1andUpdate-VMGpuPartitionDriver.ps1are located. - Run
PreChecks.ps1, then copy the listed GPU (or note any warnings that need fixing). (You can also open and runPreChecks.ps1in PowerShell ISE or Visual Studio Code) - Run
Add-GpuToExistingVM.ps1 -VMName "Name of your VM" -GPUName "Name of your GPU" -GPUResourceAllocationPercentage 100. In Windows 10, theGPUNamemust be left as "AUTO". In Windows 11, it can be "AUTO" or the specific name of the GPU you want to partition, exactly as it appears inPreChecks.ps1. This may take 5-10 minutes. (You can also openAdd-GpuToExistingVM.ps1in PowerShell ISE or Visual Studio Code and edit theparamssection at the top of the file.) - You should be good to go!
It's important to update the VM GPU drivers after you have updated the host GPU drivers. You can do this by:
- Reboot the host after updating GPU drivers.
- Open PowerShell as administrator and change directory (CD) to the path where
Add-GpuToExistingVM.ps1andUpdate-VMGpuPartitionDriver.ps1are located. - Run
Update-VMGpuPartitionDriver.ps1 -VMName "Name of your VM" -GPUName "Name of your GPU"(In Windows 10, the GPU name must be "AUTO".); this may take 5-10 minutes - You should be good to go!
VMName = "GPUP" - The name of the VM in Hyper-V.
GPUName = "AUTO" - "AUTO" selects the first available GPU. On Windows 11, you may also use the exact name of the GPU you want to share with the VM in multi-GPU situations (GPU selection is not available in Windows 10 and must be set to "AUTO").
GPUResourceAllocationPercentage = 50 - The percentage of the GPU you want to share with the VM.
- Easy-GPU-PV for creating the script foundation.
- Hyper-ConvertImage for creating an updated version of Convert-WindowsImage that is compatible with Windows 10 and 11.
- gawainXX for help testing and pointing out bugs and feature improvements.
- Your GPU on the host will have a Microsoft driver in Device Manager, rather than an NVIDIA/Intel/AMD driver. As long as it doesn't have a yellow triangle over the device in Device Manager, it's working correctly.
- Vulkan renderer is unavailable, and OpenGL games may or may not work. This may help with some OpenGL applications.
- AMD Polaris GPUs like the RX 580 do not support hardware video encoding via GPU Paravirtualization at this time.