Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can i change the GPU allocation without deleting everything? #99

Open
matei9 opened this issue Jan 22, 2022 · 11 comments
Open

Can i change the GPU allocation without deleting everything? #99

matei9 opened this issue Jan 22, 2022 · 11 comments

Comments

@matei9
Copy link

matei9 commented Jan 22, 2022

So, i already have a GPUVM set up with windows 10, but i set the allocation to 45 and i want to change it to something higher without losing data because i spend a lot of time setting it up. If it helps i own an: AMD Radeon Vega 8 Graphics.

@tresgarbo
Copy link

I am also curious about changing the value of GPUResourceAllocationPercentage after the VM has been created.

@Kodikuu
Copy link
Collaborator

Kodikuu commented Feb 1, 2022

There's no solution in the script right now, but take a look at the Assign-VMGPUPartitionAdapter function in CopyFilesToVM.ps1

@ArmandoRl1
Copy link

I managed to do this from the Hyper-V Settings: File > Settings > SCSI Controller > Hard Drive > Edit > Choose Action (on the menu on the left > Expand
After selecting the new size, restart the machine, and search for Create and format hard disk partitions on the windows menu. You should see there is some unallocated space on the drive. Right Click your C: Partition and click Expand. Some Next buttons later you should have your drive expanded.

@Kodikuu
Copy link
Collaborator

Kodikuu commented Feb 6, 2022

@ArmandoRl1 The question is about the GPU partition allocation, not the drive space

@Sm0rezDev
Copy link

I have put an pull request regarding to change the GPU resource allocation.

@moligny
Copy link

moligny commented Feb 16, 2022

@Sm0rezDev I used your script to adjust GPU allocation on two VMs. Thank you! It seems to have worked perfectly - only suggestion I have is to add a warning that virtual machines will be restarted, perhaps with an option like --force to allow unattended usage.

@davide445
Copy link

@moligny trying to run the script I got these errors regarding this section (running on PowerShell ISE)

Param (
[string]$VMName = "GPUPV",
[int]$GPUResourceAllocationPercentage = Precentage(33)
)

"Missing expression after '='. "

"Unexpected token ")" in expression or statement"

How do you run it successfully.

@davide445
Copy link

Seems to work using

[string]$VMName = "GPUPV"
[int]$GPUResourceAllocationPercentage = 33

@MeranaTona
Copy link

MeranaTona commented Nov 3, 2022

Highly relevant feature from @Sm0rezDev, any chance to get it merged @Kodikuu @jamesstringerparsec @CollinCodez?

#117

@Sm0rezDev
Copy link

Sm0rezDev commented Nov 3, 2022 via email

@Uj947nXmRqV2nRaWshKtHzTvckUUpD
Copy link

Uj947nXmRqV2nRaWshKtHzTvckUUpD commented Oct 5, 2023

So, i already have a GPUVM set up with windows 10, but i set the allocation to 45 and i want to change it to something higher without losing data because i spend a lot of time setting it up. If it helps i own an: AMD Radeon Vega 8 Graphics.

you can set the parameters as you wish whenever the vm is shutdown, you won't lose any data. i use this extreme profile in a ps1 script which i usually run whenever i re-add the gpu-p (eg. after nvidia drivers update).

REF: https://forum.level1techs.com/t/2-gamers-1-gpu-with-hyper-v-gpu-p-gpu-partitioning-finally-made-possible-with-hyperv/172234/187
#280

PS1 script below:

$VMName = "Windows11"
Set-VMGpuPartitionAdapter -VMName $VMName -MinPartitionVRAM 1000000000 -MaxPartitionVRAM 1000000000 -OptimalPartitionVRAM 1000000000 -MinPartitionEncode 18446744073709551615 -MaxPartitionEncode 18446744073709551615 -OptimalPartitionEncode 18446744073709551615 -MinPartitionDecode 1000000000 -MaxPartitionDecode 1000000000 -OptimalPartitionDecode 1000000000 -MinPartitionCompute 1000000000 -MaxPartitionCompute 1000000000 -OptimalPartitionCompute 1000000000

Note that "GPUResourceAllocationPercentage" is just a variable set on the copy script to determine a devider. It is not actually recognizable by powershell cmdlets

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants