2 Gamers 1 GPU with Hyper V GPU-P (GPU Partitioning finally made possible with HyperV)

Okay this is a cool idea. However, the issue is I’m trying to run two iterations of the SAME game and be able to play together through steam. The reason I had to try VM’s is that it is impossible to run 2 steam accounts simultaneously on the same machine. I’m now looking into Aster/multiseat solutions, but as I’m trying to understand it, does it allow separated windows instances? Because steam can only run one bootstrapper at a time on a machine per account. That’s the current oof.

I’m sure it can be, my current working theory is locking FPS as well. I can’t find any way so far to limit gpu resource pool directly to programs or an OS eitherwise. Vsync may be a good start.

Ah yeah, Multiseat software has this limitation. Though I haven’t experimented with most games, Sanboxie allows you to run 2 steam accounts simultaneously. However there might be an issue with certain anticheat games. I could never get the steam service to install inside the sandbox but it seemed to work ok.

P.S. Can’t understand why steam these days cannot allow 2 accounts simultaneously where multiple windows accounts and switching between users has been a thing since forever.

I have make some test on GPU-p

  1. Run 14 Maya 2015 VMs on GTX1070.
    Hardware i7-10700, 64G, 1T ssd, GTX 1070 - 8G.
    Host: windows server 2019
    Guest: win10 21h1
    Application: Maya 2015
    14 VM can started. Maya 2015 can start on windows 10. 14 Maya application can work normal ( open and view maya model file).

  2. Run 14 Maya 2015 VMs on RTX A4000.
    Hardware i7-10700, 64G, 1T ssd, RTX A4000-16G
    Host: windows server 2019
    Guest: win10 21h1
    Application: Maya 2015
    14 VM can started. Maya 2015 can started on Windows 10. But when I start the 4th, or 5th Maya Application. Maya give a error of can’t alloc GPU memeory ,suggest change MAYA_OGS_GPU_MEMORY_LIMIT.
    When I change GPU to RTX 3060, Same error.

1 Like

For anyone that wants to follow this guide while sticking to RDP instead of Parsec or Rainway, I discovered a way to get very decent performance out of it.

The reasons I needed to stick with RDP was that I wanted to keep the machine strictly offline, so streaming services that authenticate through the network were out of the question.

Steps:

  1. Follow the original guide, skipping the point where the author describes how to install Parsec and Rainway.

  2. Next we will need to register the virtualized GPU as an MFT hardware encoder.
    Follow the guide by tangmo at —forum.level1techs.com/t/2-gamers-1-gpu-with-hyper-v-gpu-p-gpu-partitioning-finally-made-possible-with-hyperv/172234/93—
    Please note that not all GPUs support HEVC encoding, so the keys with ID 966F107C-8EA2-425D-B822-E4A71BEF01D7 might not exist on your pc. If that is the case just skip them and copy the one related to H.264 encoding (60F44560-5A20-4857-BFEF-D29773CB8040). Remember to update the DLL paths as explained in the guide.

  3. Now it’s the time for optimization.
    Follow the guide at —reddit.com/r/sysadmin/comments/fv7d12/pushing_remote_fx_to_its_limits—
    Note that the guide is originally intended for optimizing the deprecated RemoteFX technology, but a lot of it is just generic RDP and windows optimization. You can skip the part about setting up Remote Desktop Gateway. If you want you can also skip all the steps that are directly related to RemoteFX.

Now if all went well you should be having a pretty smooth experience with RDP. If I have the time and people are interested I might post a detailed write-up that encapsulates all the steps needed. Another cool feat would be to automate the whole process with a Powershell script.

7 Likes

Hi @NetworkNoob nice man!!

I going to try this on my RX 5700xt :smiley:

Has anyone encountered mouse stuttering issues when running the host and vm at the same time?

I followed the steps outlined in the video.
I have a AMD 5950X with RTX 3080 and 64 GB RAM.
I assigned 8 cores and 16 GB RAM to the VM.

Get Partition Settings

PS C:\Windows\system32> Get-VMPartitionableGpu


Name                    : \\?\PCI#VEN_10DE&DEV_2206&SUBSYS_403D1458&REV_A1#4&2283f625&0&0019#{064092b3-625e-43bf-9eb5-d
                          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
MaxPartitionCompute     : 1000000000
OptimalPartitionCompute : 1000000000
CimSession              : CimSession: .
ComputerName            : WILL-GAMING-202
IsDeleted               : False

I used the PS partition script and changed the VM name.

$vm = "GAMING-01"

Add-VMGpuPartitionAdapter -VMName $vm
Set-VMGpuPartitionAdapter -VMName $vm -MinPartitionVRAM 80000000 -MaxPartitionVRAM 100000000 -OptimalPartitionVRAM 100000000 -MinPartitionEncode 80000000 -MaxPartitionEncode 100000000 -OptimalPartitionEncode 100000000 -MinPartitionDecode 80000000 -MaxPartitionDecode 100000000 -OptimalPartitionDecode 100000000 -MinPartitionCompute 80000000 -MaxPartitionCompute 100000000 -OptimalPartitionCompute 100000000

Set-VM -GuestControlledCacheTypes $true -VMName $vm
Set-VM -LowMemoryMappedIoSpace 1Gb -VMName $vm
Set-VM –HighMemoryMappedIoSpace 32GB –VMName $vm

I connect to the VM using Hyper V
image

The device manager shows the RTX 3080.
image

however when running a benchmark on the VM, the fps is low and my hardware GPU temp is low.

Seems like I don’t have something setup properly?

Any thoughts?

Thanks for the write up, @murar8

I think this causing the mouse stuttering issues when running the host and vm at the same time.

I’ll try to follow the guide.

@cheif22 I am able to get OpenGL and Direct X running in Hyper-V with GPU-P but not Vullan . However , MS Sandbox should be able to run Vulkan without problem . Insight?

Anyone managed making encoder to work on AMD cards? Was able to make benchmarks perform normally, but rainway only sees CPU encoder and parsec gives -15000 error.

Can’t make my amd gpu 6800xt work even running banished:(
Looks like it not using gpu resources at all :frowning:

I copied bunch of files from AMD gpu driver details (on main PC device manager)
I copied not just system32, but also Syswow64 files, now Banished is running around 100 fps, but still can’t run Diablo 2 :frowning:

@jacky400 I am uncertain about MS sandbox. Probably the sandbox application might be looking for something else (video accelerator wise) possibly. I apologize but I do not have much knowledge on this particular application.

I don’t know much about MS Sandbox or if it is able to work in a hyperv machine or to what extent it can run since technically it is a VM inside a VM from what I can figure from what your trying to do?

A thing I can point you to is to look for is if there is a MS Sandbox config or powershell line to select a video accelerator cause it might be trying to run off of MS basic display adapter which i don’t believe has Open GL support (or latest version support).

MS sandbox basically use the same appraoch to enable the GPU-V by accessing host driver (HostDriverStore) . Probably sandbox did much more than we discovered so as to get vulkan up and running .

Hey M8s

I’m working on my VM AMD setup with Hyper V and was able to split my graphic card. It’s visible in DM but somehow my game (Diablo 2R ) keeps crashing. It happens always at the same time as the intro right before the connection to the server would happen. If I disable the passthrough the game starts but lags like hell.

The weird part is that my DM on the host shows 2 cards listed but passed over to one of the guests its the TM devices and not the main one! Not sure if this is the reason why the game doesn’t start.

Overall my VM runs very smooth and at the start of the game as well no lag no fps drops nothing just crashing all the time when the server connection should happen.

Without the Display devices, it’s even connecting and I can enter the options menu but it’s extremely slow and unplayable.

I used DriverStoreExplorer.v0.11.72 to find my driver folder and also used the DM driver details to pick up all the files from the System 32 folder + everything from the WOW64 folder

All driver files i copied over:

Get Partition Settings: (see picture)
PS Partition script: (see picture)
Devices manager of Host: (see picture)
Devices manager of the VM: (see picture)

I would love to get some help since I’m actually a noob that is running into a wall at this point. :sweat_smile: My goal is to run 3 clients of the game at the same time with the host and guest VMs, but atm im not even able to run the game on one VM.

Thanks everybody for taking the time reading this :slightly_smiling_face:

My Specs:
ROG Strix G513QY
AMD Ryzen 9 5900HX with Radeon Graphics 3.30 GHz
AMD Radeon RX 6800M GDDR6@ 12GB (384000 GByte/s)
16.0 GB RAM
Driver:
Adrenalin 21.10.2
OS:
Win 10 Pro

1 Like

I managed to get it to work on an AMD IGPU, I had to copy all the files in system32 folder in the VM as I couldn’t identify which one is the right one.

1 Like

how about 2 or more GPU in one VM? In my test, I have 3 RTX 3080 and the VM only reads one and not all 3. It only shows 1 RTX 3080 in device manager instead of all 3.

Anyone have an idea how to add multiple GPU in one VM? Thanks!

Thank you for the guide. Keep it up

it seems like this is the answer on how to add 2 or more GPU in one VM? will this work on Windows HyperV?

Hi,

I have just tried messing about with this since finding the video linked earlier in this thread and then finding this thread were more folk seem to have tried more things. I have got a RTX3070 in my wifes PC that I am using with Hyper-V its all setup but I am having trouble with CS:GO, it now launches the game after copying all the nv* files from SysWOW64, however when I try and load a map the game just bails out, I understand there may be some issues due to the way we have Nvidia Drivers working, do you think this kind of issue would be resolved by installing drivers and faking the GPU ID in the reg?

I did note a user further up the page removed NVAPI files to “stop games for using it” however when I do this CS:GO won’t launch with a NVAPI related error message so I don’t think I can do this. Any help would be appreciated.

Thanks

I followed the guide but am stuck at booting the VM with the following error:

‘ZEUS’ GPU Partition (Instance ID EF73D12C-4C59-469D-BBA9-4F285AF233BF): Failed to Power on with Error ‘Insufficient system resources exist to complete the requested service.’ (0x800705AA). (Virtual machine ID 241419B9-808F-40AD-A99A-EAC648C0FBED)

I am using the following hardware:

  • Host: Windows Server 2019 Standard (1809, 17763.2268) & All updates applied
    • i7 8700 3.2GHz
    • 32GB RAM
    • 14.4 TB total disks in RAID 5 (7.27 TB usable)
    • NVIDIA GeForce GTX 1660 SUPER
  • VM: Windows 10 Pro, version 2004 (21H1) & All updates applied

I copied the required files with the following script:

$GpuDllPaths = (Get-CimInstance Win32_VideoController -Filter "Name like 'N%'").InstalledDisplayDrivers.split(',') | Get-Unique
$GpuInfDirs = $GpuDllPaths | ForEach-Object {[System.IO.Path]::GetDirectoryName($_)} | Get-Unique
$GpuInfDirs = $GpuInfDirs | Where-Object {(Split-Path $_ -Leaf ).StartsWith("nv")}
$s = New-PSSession -VMName $vm -Credential (Get-Credential)
$GpuInfDirs | ForEach-Object { Copy-Item -ToSession $s -Path $_ -Destination C:\Windows\System32\HostDriverStore\FileRepository\ -Recurse -Force }
Copy-Item -ToSession $s -Path C:\Windows\System32\nv*.dll -Destination C:\Windows\System32\
Remove-PSSession $s
Restart-VM $vm -Force

And this is the output of Get-VMPartitionableGpu:

PS C:\Users\Administrator\Desktop> Get-VMPartitionableGpu

Name                    : \\?\PCI#VEN_10DE&DEV_21C4&SUBSYS_40131458&REV_A1#4&2db3ecda&0&0008#{064092b3-625e-43bf-9eb5-dc845897dd59}\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
MaxPartitionCompute     : 1000000000
OptimalPartitionCompute : 1000000000
CimSession              : CimSession: .
ComputerName            : ATLANTIS
IsDeleted               : False

And TechPowerUp:
techpowerup

And using the following in PowerShell:

$vm = "ZEUS"
Remove-VMGpuPartitionAdapter -VMName $vm
Add-VMGpuPartitionAdapter -VMName $vm
Set-VMGpuPartitionAdapter -VMName $vm -MinPartitionVRAM 1
Set-VMGpuPartitionAdapter -VMName $vm -MaxPartitionVRAM 250000000
Set-VMGpuPartitionAdapter -VMName $vm -OptimalPartitionVRAM 249999999
Set-VMGpuPartitionAdapter -VMName $vm -MinPartitionEncode 1
Set-VMGpuPartitionAdapter -VMName $vm -MaxPartitionEncode 18446744073709551615
Set-VMGpuPartitionAdapter -VMName $vm -OptimalPartitionEncode 18446744073709551614
Set-VMGpuPartitionAdapter -VMName $vm -MinPartitionDecode 1
Set-VMGpuPartitionAdapter -VMName $vm -MaxPartitionDecode 250000000
Set-VMGpuPartitionAdapter -VMName $vm -OptimalPartitionDecode 249999999
Set-VMGpuPartitionAdapter -VMName $vm -MinPartitionCompute 1
Set-VMGpuPartitionAdapter -VMName $vm -MaxPartitionCompute 250000000
Set-VMGpuPartitionAdapter -VMName $vm -OptimalPartitionCompute 249999999
Set-VM -GuestControlledCacheTypes $true -VMName $vm
Set-VM -LowMemoryMappedIoSpace 1Gb -VMName $vm
Set-VM –HighMemoryMappedIoSpace 32GB –VMName $vm
Get-VMGpuPartitionAdapter -VMName $vm

I went from 599999999 to 250000000 to test if that was alright but I think I got it incorrect and would like some suggestions.

Thank you.

Edit: The graphics card has a HDMI dummy.