Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

A fork of Easy-GPU-PV dedicated to just adding GPU Paravirtualization to existing Windows Hyper-V VMs without including any other components.

Notifications You must be signed in to change notification settings

travertexs/Just-GPU-PV

 
 

Repository files navigation

Just-GPU-PV

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:

  1. Partitions your GPU of choice and copies the required driver files to the VM.
  2. You should now be ready to proceed!

Prerequisites:

  • 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 unrestricted in PowerShell as Administrator.

Instructions:

  1. Make sure your environment meets the prerequisites.
  2. Download and extract the repository.
  3. Open PowerShell as administrator and change directory (CD) to the path where PreChecks.ps1, Add-GpuToExistingVM.ps1 and Update-VMGpuPartitionDriver.ps1 are located.
  4. Run PreChecks.ps1, then copy the listed GPU (or note any warnings that need fixing). (You can also open and run PreChecks.ps1 in PowerShell ISE or Visual Studio Code)
  5. Run Add-GpuToExistingVM.ps1 -VMName "Name of your VM" -GPUName "Name of your GPU" -GPUResourceAllocationPercentage 100. In Windows 10, the GPUName must 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 in PreChecks.ps1. This may take 5-10 minutes. (You can also open Add-GpuToExistingVM.ps1 in PowerShell ISE or Visual Studio Code and edit the params section at the top of the file.)
  6. You should be good to go!

Upgrading GPU Drivers when you update the host GPU Drivers:

It's important to update the VM GPU drivers after you have updated the host GPU drivers. You can do this by:

  1. Reboot the host after updating GPU drivers.
  2. Open PowerShell as administrator and change directory (CD) to the path where Add-GpuToExistingVM.ps1 and Update-VMGpuPartitionDriver.ps1 are located.
  3. 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
  4. You should be good to go!

Values:

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.

Thanks to:

Notes:

  • 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.

About

A fork of Easy-GPU-PV dedicated to just adding GPU Paravirtualization to existing Windows Hyper-V VMs without including any other components.

Resources

Stars

Watchers

Forks

Languages

  • PowerShell 100.0%