A project dedicated to making GPU Paravirtualization on Windows Hyper-V easier!
GPU-PV allows you to partition your systems dedicated or integrated GPU and assign it to several Hyper-V VMs. It's the same technology that is used in WSL2, and Windows Sandbox.
Easy-GPU-PV aims to make this easier by automating the steps required to get a GPU-PV VM up and running.
Easy-GPU-PV does the following...
- Creates a VM of your choosing
- Automatically Installs Windows to the VM
- Add a partition of the GPU of choice to the VM and copies the required driver files to the VM
- Windows 10 20H1+ Pro, Enterprise or Education OR Windows 11 Pro, Enterprise or Education. Windows 11 on host and VM is preferred due to better compatibility.
- Matched Windows versions between the host and VM. Mismatches may cause compatibility issues, blue-screens, or other issues. (Win10 21H1 + Win10 21H1, or Win11 21H2 + Win11 21H2, for example)
- Desktop Computer with dedicated NVIDIA/AMD GPU or Integrated Intel GPU.
- Latest GPU driver from intel.com or nvidia.com. Don't rely on Device manager or Windows update.
- Latest Windows 10 ISO downloaded from here / Windows 11 ISO downloaded from here. - Do not use Media Creation Tool, if no direct ISO link is available, follow this guide.
- Virtualisation enabled in the motherboard and Hyper-V fully enabled on the Windows 10/ 11 OS (requires reboot).
- Allow Powershell scripts to run on your system - typically by running
Set-ExecutionPolicy Unrestricted -Scope Process
in Powershell running as Administrator.
- Make sure your system meets the prerequisites.
- Clone or download this repository to your system.
- In the extracted folder you downloaded, run PreChecks.ps1 in Powershell ISE and copy the GPU Listed (or fix the warnings listed). Run the files from within the extracted folder. Do not move them.
- Open CreateVM.ps1 and edit the params section at the top of the file. Be careful about how much ram, storage and hard drive you give it as your system needs to have that available. On Windows 10 the GPUName must be left as "AUTO", In Windows 11 it can be either "AUTO" or the specific name of the GPU you want to partition exactly how it appears in PreChecks.ps1. Additionally, you need to provide the path to the Windows 10/11 ISO file you downloaded.
- Run CreateVM.ps1 with your changes to the params section - this may take 5-10 minutes.
- You should be good to go!
It's important to update the VM GPU Drivers after you have updated the Host GPUs drivers. You can do this by...
- Reboot the host after updating GPU Drivers.
- Open Powershell as administrator and change directory (
cd
) to the repository where Update-VMGpuPartitionDriver.ps1 is located. - Run
Update-VMGpuPartitionDriver.ps1 -VMName "Name of your VM" -GPUName "Name of your GPU"
(On Windows 10 GPU name must be "AUTO")
VMName = "GPUPV"
- Name of the VM in Hyper-V and the computername / hostname.
SourcePath = "$PSScriptRoot"+"\Windows_Installation_Image.iso"
- Path to the Windows installation image.
Edition = 4
- Windows edition index. You can check your wim by Dism.exe /Get-WimInfo /WimFile:<your wim file path>
.
DiskLayout = "UEFI"
- Either BIOS
or UEFI
. Leave as UEFI for Windows 11.
SizeBytes = 40GB
- Size of the virtual hard disk.
MemoryAmount = 8GB
- Amount of memory to allocate to the VM.
CPUCores = 4
- Number of CPU cores to allocate to the VM.
NetworkSwitch = "Default Switch"
- Name of the network switch to connect the VM to.
VHDPath = "C:\ProgramData\Microsoft\Windows\Virtual Hard Disks\"
- Path to the folder where the virtual hard disk will be stored. Must already exist.
UnattendPath = "$PSScriptRoot"+"\autounattend.xml"
- Path to the unattend.xml file for unattended installation.
GPUName = "AUTO"
- Name of the GPU to partition. Must be AUTO on Windows 10.
GPUResourceAllocationPercentage = 50
- Percentage of GPU resources to allocate to the VM.
Username = "User"
- The VM Windows Username, do not include special characters, and must be different from the "VMName" value you set
Password = "changeme"
- The VM Windows Password; can't be blank.
autologon = "false"
- Enable autologon for the VM.
- 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.
- If you get "ERROR : Cannot bind argument to parameter 'Path' because it is null." this probably means you used Media Creation Tool to download the ISO. You unfortunately cannot use that, if you don't see a direct ISO download link at the Microsoft page, follow this guide.
- 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 top of the device in device manager, it's working correctly.
- The screen may go black for times up to 10 seconds in situations when UAC prompts appear, applications go in and out of fullscreen and when you switch between video codecs in Parsec - not really sure why this happens, it's unique to GPU-P machines and seems to recover faster at 1280x720.
- Vulkan renderer is unavailable and GL games may or may not work. This may help with some OpenGL apps.
- If you do not have administrator permissions on the machine it means you set the username and vmname to the same thing, these needs to be different.
- AMD Polaris GPUS like the RX 580 do not support hardware video encoding via GPU Paravirtualization at this time.
- To download Windows ISOs with Rufus, it must have "Check for updates" enabled.