Easy-GPU-PV/README.md

73 lines
7.5 KiB
Markdown
Raw Normal View History

2022-01-11 23:06:48 +00:00
# Easy-GPU-PV
A work-in-progress project dedicated to making GPU Paravirtualization on Windows Hyper-V easier!
2021-11-14 19:53:47 +00:00
2022-01-11 23:17:55 +00:00
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.
2021-11-13 21:53:26 +00:00
2022-01-11 23:17:55 +00:00
Easy-GPU-PV aims to make this easier by automating the steps required to get a GPU-PV VM up and running.
2022-01-11 23:06:48 +00:00
Easy-GPU-PV does the following...
2021-11-13 21:53:26 +00:00
1) Creates a VM of your choosing
2021-11-14 19:54:22 +00:00
2) Automatically Installs Windows 11 to the VM
2021-11-13 21:53:26 +00:00
3) Partitions your GPU of choice and copies the required driver files to the VM
2022-01-10 22:26:04 +00:00
4) Installs [Parsec](https://parsec.app) to the VM, Parsec is an ultra low latency remote desktop app. You can use Parsec for free non commercially. To use Parsec commercially, sign up to a [Parsec For Teams](https://parsec.app/teams) account
2021-06-22 22:38:54 +00:00
2021-11-14 20:54:16 +00:00
### Prerequisites:
2021-12-10 11:03:24 +00:00
* Windows 10 20H1+ Pro or Enterprise or Windows 11 Pro or Enterprise.
* Desktop Computer with dedicated NVIDIA/AMD GPU or Integrated Intel GPU - Laptops with NVIDIA GPUs are not supported at this time, but Intel integrated GPUs work on laptops. GPU must support hardware video encoding (NVIDIA NVENC, Intel Quicksync or AMD AMF).
* 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](https://www.microsoft.com/en-gb/software-download/windows10ISO) / Windows 11 ISO [downloaded from here.](https://www.microsoft.com/en-us/software-download/windows11) - Do not use Media Creation Tool, if no direct ISO link is available, follow [this guide.](https://www.nextofwindows.com/downloading-windows-10-iso-images-using-rufus)
* Virtualisation enabled in the motherboard and [Hyper-V fully enabled](https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/quick-start/enable-hyper-v) on the Windows 10/ 11 OS (requires reboot).
2021-12-10 11:06:23 +00:00
* Allow Powershell scripts to run on your system - typically by running "Set-ExecutionPolicy unrestricted" in Powershell running as Administrator.
2021-06-22 22:38:54 +00:00
2021-11-14 17:24:32 +00:00
### Instructions
2021-10-19 06:07:22 +00:00
1. Make sure your system meets the prerequisits.
2022-01-11 23:06:48 +00:00
2. [Download the Repo and extract.](https://github.com/jamesstringerparsec/Easy-GPU-PV/archive/refs/heads/main.zip)
2021-10-19 06:07:22 +00:00
3. Search your system for Powershell ISE and run as Administrator.
2021-11-21 12:50:49 +00:00
4. In the extracted folder you downloaded, open PreChecks.ps1 in Powershell ISE.
2021-10-19 06:10:09 +00:00
5. Open and Run PreChecks.ps1 in Powershell ISE using the green play button and copy the GPU Listed (or the warnings that you need to fix).
2022-01-07 15:28:45 +00:00
6. Open CopyFilesToVM.ps1 Powershell ISE and edit the params section at the top of the file, you need to be careful about how much ram, storage and hard drive you give it as you 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.
2021-10-19 06:07:22 +00:00
7. Run CopyFilesToVM.ps1 with your changes to the params section - this may take 5-10 minutes.
2022-01-10 20:27:07 +00:00
8. Open and sign into Parsec on the VM. You can use Parsec to connect to the VM up to 4K60FPS.
2022-01-09 14:28:35 +00:00
9. You should be good to go!
2021-11-08 16:47:26 +00:00
2021-11-21 13:49:37 +00:00
### Upgrading GPU Drivers when you update the host GPU Drivers
2021-11-21 13:50:38 +00:00
It's important to update the VM GPU Drivers after you have updated the Host GPUs 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 that CopyFilestoVM.ps1 and Update-VMGPUPartitonDriver.ps1 are located.
2021-11-25 12:08:01 +00:00
3. Run ```Update-VMGPUPartitonDriver.ps1 -VMName "Name of your VM" -GPUName "Name of your GPU"``` (Windows 10 GPU name must be "AUTO")
2021-11-21 13:49:37 +00:00
### Values
```VMName = "GPUP"``` - Name of VM in Hyper-V and the computername / hostname
2021-12-09 11:52:29 +00:00
```SourcePath = "C:\Users\james\Downloads\Win11_English_x64.iso"``` - path to Windows 10/ 11 ISO on your host
2021-12-12 19:20:51 +00:00
```Edition = 6``` - Leave as 6, this means Windows 10/11 Pro
```VhdFormat = "VHDX"``` - Leave this value alone
```DiskLayout = "UEFI"``` - Leave this value alone
2022-01-10 09:24:29 +00:00
```SizeBytes = 40gb``` - Disk size, in this case 40GB, the minimum is 20GB
```MemoryAmount = 8GB``` - Memory size, in this case 8GB
```CPUCores = 4``` - CPU Cores you want to give VM, in this case 4
2022-01-09 14:31:37 +00:00
```NetworkSwitch = "Default Switch"``` - Leave this alone unless you're not using the default Hyper-V Switch
2022-01-10 19:12:43 +00:00
```VHDPath = "C:\Users\Public\Documents\Hyper-V\Virtual Hard Disks\"``` - Path to the folder you want the VM Disk to be stored in, it must already exist
```UnattendPath = "$PSScriptRoot"+"\autounattend.xml"``` -Leave this value alone
2021-11-25 12:08:51 +00:00
```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``` - Percentage of the GPU you want to share with the VM
```Team_ID = ""``` - The Parsec for Teams ID if you are a Parsec for Teams Subscriber
```Key = ""``` - The Parsec for Teams Secret Key if you are a Parsec for Teams Subscriber
2021-12-09 12:57:39 +00:00
```Username = "GPUVM"``` - The VM Windows Username, do not include special characters, and must be different from the "VMName" value you set
2022-01-09 21:13:52 +00:00
```Password = "CoolestPassword!"``` - The VM Windows Password, cannot be blank
```Autologon = "true"```- If you want the VM to automatically login to the Windows Desktop
2021-11-08 16:47:26 +00:00
2021-12-10 10:59:03 +00:00
### Thanks to:
2021-12-10 10:58:37 +00:00
- [Hyper-ConvertImage](https://github.com/tabs-not-spaces/Hyper-ConvertImage) for creating an updated version of [Convert-WindowsImage](https://github.com/MicrosoftDocs/Virtualization-Documentation/tree/master/hyperv-tools/Convert-WindowsImage) that is compatible with Windows 10 and 11.
- [gawainXX](https://github.com/gawainXX) for help testing and pointing out bugs and feature improvements.
2021-11-13 21:22:19 +00:00
2021-11-21 12:50:49 +00:00
### Notes:
2022-01-09 20:02:31 +00:00
- 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.](https://www.nextofwindows.com/downloading-windows-10-iso-images-using-rufus)
2021-11-21 16:02:23 +00:00
- Windows 10 20H1 is not well tested as I don't have any Win10 20H1 installs, if you have success on Windows 10 20H1 - 21H2 please let me know.
2021-12-12 17:20:16 +00:00
- A powered on display / HDMI dummy dongle must be plugged into the GPU to allow Parsec to capture the screen. You only only need one of these per host machine regardless of number of VM's.
2022-01-09 15:49:47 +00:00
- If your computer is super fast it may get to the login screen before the audio driver (VB Cable) and Parsec display driver are installed, but fear not! They should soon install.
2021-11-17 22:37:17 +00:00
- The screen may go black for times up to 10 seconds in sitautions 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.
2022-01-03 16:14:11 +00:00
- Vulkan renderer is unavailable and GL games may or may not work. [This](https://www.microsoft.com/en-us/p/opencl-and-opengl-compatibility-pack/9nqpsl29bfff?SilentAuth=1&wa=wsignin1.0#activetab=pivot:overviewtab) may help with some OpenGL apps.
2022-01-09 14:28:35 +00:00
- 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.