0% found this document useful (0 votes)
73 views6 pages

GPU Partitioning

This document provides detailed instructions for setting up GPU partitioning (GPU-P) with Nvidia graphics cards in Hyper-V, including steps for configuring virtual machines, copying necessary driver files, and using PowerShell scripts for GPU resource allocation. It also covers the installation of streaming applications like Rainway and Parsec, as well as notes on software compatibility and handling multiple GPUs. Users are advised to leave headroom on the GPU to avoid resource allocation errors and to be cautious of potential issues with virtual display drivers.

Uploaded by

trip
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
73 views6 pages

GPU Partitioning

This document provides detailed instructions for setting up GPU partitioning (GPU-P) with Nvidia graphics cards in Hyper-V, including steps for configuring virtual machines, copying necessary driver files, and using PowerShell scripts for GPU resource allocation. It also covers the installation of streaming applications like Rainway and Parsec, as well as notes on software compatibility and handling multiple GPUs. Users are advised to leave headroom on the GPU to avoid resource allocation errors and to be cautious of potential issues with virtual display drivers.

Uploaded by

trip
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Instructions for GPU-P setup

NOTE: These are my instructions on how to set up an Nvidia card. AMD cards are similar. For steps 2
and 3, you will need to search in the Device manager to locate different driver files. If I have the time
and if my Radeon 7770HD cards have encoders, I will try and update this to help AMD users.

1. When setting up HyperV. Create VMs with Gen 2. You will also need to disable enhanced sessions
and Checkpoints for VMs. By Default, each HyperV VM is set to one CPU core and RAM will be set
to Dynamic (if on Windows 10 and not server.). This can be changed on the VM’s Settings

2. On your host machine, go to C:\Windows\System32\DriverStore\FileRepository\


and copy the nv_dispi.inf_amd64 folder
to C:\Windows\System32\HostDriverStore\FileRepository\ on your VM (This folder will not exist,
so make sure to create it)

3. Next you will need to copy items from C:\Windows\System32\ from


your host to C:\Windows\System32\

In your hosts System32 folder, do a search for NV*.* and copy all.

!!! PLEASE NOTE IF YOU HAVE UPDATED YOUR HOST’S VIDEO DRIVERS, YOU WILL HAVE TO
RECOPY ALL DRIVERS TO YOUR VM’S OR CODE 43 WILL REAPPEAR !!!
4. You will notice that you do not have any sort of Audio Driver installed on the VM.

You will need to have a virtual audio cable installed to pass audio. One Virtual Audio Cable
software I can recommend is VB Cable. You can get the free version or support their product. One
thing to note is when you mute the audio in the VM, it will not mute or change the volume level.

Link to VB Cable (virtual audio cable): VB-Audio Virtual Apps 622


5. Shut VM down and configure your Powershell script for the VM. You can change out the Values as
you see fit or change them to be the same as mine from the Video.

6. Run PowerShell on the host system as admin to start partitioning the GPU with Powershell with
the script below.

PowerShell Script
This will be trial and error to get settings right. You can use the PowerShell command “ Get-
VMPartitionableGpu ” to locate the total amount of resources you have available and divide it for
each VM you want to assign resources to. Also if you have multiple GPUs, The name field will
match the hardware ID of the card.

For users using Windows 11, Please see this comment in the thread, It looks like people can directly
assign GPUS to have a partition from and not let Windows auto select one for you 2 Gamers 1 GPU with
Hyper V GPU-P (GPU Partitioning finally made possible with HyperV) - #137 by JayRyl

#The output of all the values of Get-VMPartitionableGpu will look like this

Name : \\?\PCI#VEN_10DE&DEV_1F02&SUBSYS_251619DA&REV_A1#4&2283f625&0&
c845897dd59}\GPUPARAV
ValidPartitionCounts : {32}
PartitionCount : 32
TotalVRAM : 1000000000
AvailableVRAM : 1000000000
MinPartitionVRAM :0
MaxPartitionVRAM : 1000000000
OptimalPartitionVRAM : 1000000000
TotalEncode : 18446744073709551615
AvailableEncode : 18446744073709551615
MinPartitionEncode :0
MaxPartitionEncode : 18446744073709551615
OptimalPartitionEncode : 18446744073709551615
TotalDecode : 1000000000
AvailableDecode : 1000000000
MinPartitionDecode :0
MaxPartitionDecode : 1000000000
OptimalPartitionDecode : 1000000000
TotalCompute : 1000000000
AvailableCompute : 1000000000
MinPartitionCompute : 0
ii
When Setting up the partitions, try to leave headroom on the GPU or it might throw an error stating that
there aren’t any resources available. Try to leave 10% - 15% available If you seem to be getting errors
when starting up a second VM (or VM#x) that would be also using the same card as another VM(s).

PowerShell script

$vm = "ENTER YOUR VM NAME HERE"


Remove-VMGpuPartitionAdapter -VMName $vm
Add-VMGpuPartitionAdapter -VMName $vm
Set-VMGpuPartitionAdapter -VMName $vm -MinPartitionVRAM 1
Set-VMGpuPartitionAdapter -VMName $vm -MaxPartitionVRAM 11
Set-VMGpuPartitionAdapter -VMName $vm -OptimalPartitionVRAM 10
Set-VMGpuPartitionAdapter -VMName $vm -MinPartitionEncode 1
Set-VMGpuPartitionAdapter -VMName $vm -MaxPartitionEncode 11
Set-VMGpuPartitionAdapter -VMName $vm -OptimalPartitionEncode 10
Set-VMGpuPartitionAdapter -VMName $vm -MinPartitionDecode 1
Set-VMGpuPartitionAdapter -VMName $vm -MaxPartitionDecode 11
Set-VMGpuPartitionAdapter -VMName $vm -OptimalPartitionDecode 10
Set-VMGpuPartitionAdapter -VMName $vm -MinPartitionCompute 1
Set-VMGpuPartitionAdapter -VMName $vm -MaxPartitionCompute 11
Set-VMGpuPartitionAdapter -VMName $vm -OptimalPartitionCompute 10
Set-VM -GuestControlledCacheTypes $true -VMName $vm
Set-VM -LowMemoryMappedIoSpace 1Gb -VMName $vm
Set-VM -HighMemoryMappedIoSpace 32GB -VMName $vm
Start-VM -Name $vm

7. Installing a Streaming Application (Rainway and Parsec)

Installing Rainway

If you are at this point and have a real or headless monitor hooked to the GPU, You can install
Rainway and get going. You may be able to still use the fake VGA/USB Monitor in the Parsec Guide
Below.

Link to Rainway: Game Streaming - Play Anywhere | Rainway 900

Installing Parsec

Parsec will work with GPU-P, The headless Monitor trick may or may not work for this. One way
that me and a friend were able to get this to work (with or without Parsec Warp subscription) was
to install a fake VGA/USB Monitor Driver.

To download the driver, this is the AMYUNI Technologies Forum page where the driver is found.
Link to Forum page: Activating a Secondary Display on Windows 10 when no Monitor is
Connected -Amyuni Technologies 936
A1. Extract the downloaded folder “usbmmidd.zip” and you can move this to a more general
location like C:\ProgramFiles or root of the C: Drive.

A2. After moving this folder, you will want to run the “usbmmidd.bat” file to install the driver.

!!!NOTE!!! In HyperV, once the driver is installed, your mouse may cease to function cause a second
monitor will be present in the VM that cannot be seen. To resolve this, you will have to navigate to
the settings menu set to only show on Display 1 only using the keyboard.

A3. !!YOU MAY NOT NEED TO DO THIS STEP!!, the driver may have to be initialized again. You can
follow the steps here incase it needs to be done every restart. It may cause more failed monitor
drivers in the device manager.

We will have to make a Task scheduler that starts every time the VM starts.

In Windows, search for Task Scheduler in search

Select “Task Scheduler Library” and Create New Task.

In the Creation of the Task, Set these options in the General Tab.

In the Triggers tab, create new trigger and set At startup.

In the Actions tab, make a new action. Have it Start a program and select the usbmmidd.bat file.

The Conditions tab can be left alone.


In the Settings tab, make the task run as soon as possible, stop the task if runs longer than 1 hour,
and force it to stop if task does not end.

A4. After hitting ok, you will be all set and can install Parsec.

Link to Parsec: https://parsec.app/ 212

From here on out, everything should be working. Install stuff from steam or get prereqs for other
software.

Notes about multiple GPUs


So you are aware, multiple GPUs will work but no guarantee you will get assigned the card you want as
it may randomly select a GPU every time the host computer reboots. If it’s two or more of the same GPU
type then don’t worry about getting assigned a slower card.

Notes about software compatibilities:

Nvidia Geforce Experience: Doesn’t look like it will work as it will not detect an Nvidia GPU is
installed. Even after putting in GPU drivers.

AMD’s Radeon Software: Looks to be in the same boat as Geforce experience from my testing.

Parsec: I know Parsec works, even Parsec Warp users can use this with the virtual display driver to
get better screen resolutions. If you are a Warp user and want to have two Displays (HyperV
monitor with additional USB/VGA virtual monitor), Warp users can use this. But be warned, the
viewing window on HyperV may not work when setting the monitor settings back to extend, and
have to navigate by a keyboard. Recommendation to use a parsec installed app rather than a web
app to use.

Rainway: Far as I can tell, fully works in an unofficial way and will run whatever you need in any
amount of VMs.

Open stream: From the Reddit post comments I’ve seen, this works. I haven’t fully investigated
this. If you have any results, lets us know in the reply section!

MSI Afterburner: Run this on the Host computer rather than the VM. Seems to give it a bit more
performance when increasing some clock speeds of ram and GPU core in the VMs. Might not have
a consistent experience across the VMs.

OBS: From the looks of it, Hardware encoding with NVENC is working when using the DLLs listed
above. If NVENC Works with this, then there may be other applications that may follow as well.

Cuda enable apps: From testing out the program Meshroom to try out Cuda requirements, it
recognized Cuda and used it. So Might be working or hit or miss with other apps.

You might also like