jamesstringerparsec / Easy-GPU-PV

A Project dedicated to making GPU Partitioning on Windows easier!
4.35k stars 438 forks source link

multiple GPUs ? #34

Open kolet opened 2 years ago

kolet commented 2 years ago

hi there ,

had multiple questions

1, will this work on multiple gpus ?

splitting 4 vms into 2 groups (2x2) and assigning a vm group (2 vms) into each gpu ? (2 vm 1 gpu x 2)

2, how does the friends/people will able to connect to the vm (with low latency)? via RDP ? is there any other ways ?

cyberquarks commented 2 years ago
  1. I think it would it's just a matter of creating VM's with different GPU that you put on the script
  2. You will need parsec to connect with the VM there's no other "RDP" (that I know of that is faster than Parsec atm)
kcdevteam commented 2 years ago

Well it will not work that way, I tried with two Radeon Pro W6800 and the PreCheck script output 4x the same name :

System Compatible Printing a list of compatible GPUs...May take a second Copy the name of the GPU you want to share... AMD Radeon PRO W6800 AMD Radeon PRO W6800 AMD Radeon PRO W6800 AMD Radeon PRO W6800 Press Enter to Exit :

I think it should offer an option to select GPU by id, if you have multiple same gpus it will not work by name.

MingyaoLiu commented 2 years ago

If you run multiple GPU with same name, your installation will succeed, but GPU won't be passed to VM, and error will show in powershell with something like:

Add-VMGpuPartitionAdapter : Cannot convert 'System.Object[]' to the type 'System.String' required by parameter
'InstancePath'. Specified method is not supported.

and

Set-VMGpuPartitionAdapter : Unable to find a GPU partition adapter matching the given criteria.

What you need to do is look at the specific line that is erroring out, and call them with the correct InstancePathID.

Use

Get-WmiObject -Class "Msvm_PartitionableGpu" -ComputerName $env:COMPUTERNAME -Namespace "ROOT\virtualization\v2"

to get all the GPU devices, then look into the Name object of each GPU, choose the correct one that you want to use (you can use device manager to check which one is which).

Then call the errored out commands with your vm name and the correct path. (don't copy the code below, as code could have been updated with different values for calculation, find the code in your script.)

$VMName="XXXX"
$DevicePathName="\\?\PCI#VEN_10DEXXXXXXXXXXXXXXXXXXXXXXXX"
$devider=50

Remove-VMGpuPartitionAdapter -VMName $VMName

Add-VMGpuPartitionAdapter -VMName $VMName -InstancePath $DevicePathName

Set-VMGpuPartitionAdapter -VMName $VMName -MinPartitionVRAM ([math]::round($(1000000000 / $devider))) -MaxPartitionVRAM ([math]::round($(1000000000 / $devider))) -OptimalPartitionVRAM ([math]::round($(1000000000 / $devider)))

Set-VMGPUPartitionAdapter -VMName $VMName -MinPartitionEncode ([math]::round($(18446744073709551615 / $devider))) -MaxPartitionEncode ([math]::round($(18446744073709551615 / $devider))) -OptimalPartitionEncode ([math]::round($(18446744073709551615 / $devider)))

Set-VMGpuPartitionAdapter -VMName $VMName -MinPartitionDecode ([math]::round($(1000000000 / $devider))) -MaxPartitionDecode ([math]::round($(1000000000 / $devider))) -OptimalPartitionDecode ([math]::round($(1000000000 / $devider)))

Set-VMGpuPartitionAdapter -VMName $VMName -MinPartitionCompute ([math]::round($(1000000000 / $devider))) -MaxPartitionCompute ([math]::round($(1000000000 / $devider))) -OptimalPartitionCompute ([math]::round($(1000000000 / $devider)))