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

Method of quickly disabling GPU partitioning #398

Open
kietatran00 opened this issue Aug 17, 2024 · 12 comments
Open

Method of quickly disabling GPU partitioning #398

kietatran00 opened this issue Aug 17, 2024 · 12 comments

Comments

@kietatran00
Copy link

Hello! I found that even when the VM is offline it'll still partition the GPU and end up losing performance when playing other games on the host. I was able to use Remove-VMGpuPartitionAdapter and removed the reserved GPU for the VM and noticed a drastic FPS increase, however I couldn't find a way to easily add the partionedGPU back to the VM. Any advice?

@iatoba72
Copy link

iatoba72 commented Sep 3, 2024

also interested in this !! an easy way to: when shuting down the vm, being able to use 100% on the host. maybe a rollback script?

@Stefanuk12
Copy link

I Frankenstein-ed this one together... Make sure you run as Administrator.
(De)attach.zip

@jordanfalduto
Copy link

Hello! I found that even when the VM is offline it'll still partition the GPU and end up losing performance when playing other games on the host. I was able to use Remove-VMGpuPartitionAdapter and removed the reserved GPU for the VM and noticed a drastic FPS increase, however I couldn't find a way to easily add the partionedGPU back to the VM. Any advice?

how would you even be able to confirm that 100% of the GPU wasn't being utilized besides an FPS test?

@DPoveaa
Copy link

DPoveaa commented Sep 24, 2024

I Frankenstein-ed this one together... Make sure you run as Administrator. (De)attach.zip

And how can i attach again?

@Stefanuk12
Copy link

I Frankenstein-ed this one together... Make sure you run as Administrator. (De)attach.zip

And how can i attach again?

change the mode to Attach

@jordanfalduto
Copy link

I Frankenstein-ed this one together... Make sure you run as Administrator. (De)attach.zip

And how can i attach again?

change the mode to Attach

So the $params.Mode is set to detach if the Mode = "Deattach"
but if $params.Mode is anything else it will Attach according to line 10 through 40?

@Stefanuk12
Copy link

I Frankenstein-ed this one together... Make sure you run as Administrator. (De)attach.zip

And how can i attach again?

change the mode to Attach

So the $params.Mode is set to detach if the Mode = "Deattach"

but if $params.Mode is anything else it will Attach according to line 10 through 40?

Yeah, I say to make it Attach for the sake of simplicity but you're totally right. You can set it to anything else.

@DPoveaa
Copy link

DPoveaa commented Sep 26, 2024

I Frankenstein-ed this one together... Make sure you run as Administrator. (De)attach.zip

And how can i attach again?

change the mode to Attach

Sorry for the stupid question, but how do I confirm that it worked? And whether or not the virtual machine has a video card linked?

@Stefanuk12
Copy link

I Frankenstein-ed this one together... Make sure you run as Administrator. (De)attach.zip

And how can i attach again?

change the mode to Attach

Sorry for the stupid question, but how do I confirm that it worked? And whether or not the virtual machine has a video card linked?

If you try to remove the adapter twice, it should error. If it errors, you know that the specified card isn't linked.

@jordanfalduto
Copy link

I finally got around to testing this and I don't really think this is a thing

  1. It's not how hosts work, when a VM is powered off, it consumes no resources

  2. Stefanuk12's PS script absolutely does it's intended purpose and rips the GPU from the VM. I detached it and watched it get ripped from the powered on VM in real time. System Information > Components > Display no longer shows the host GPU

  3. My performance did not increase or decrease after detaching. Pulling up Task Manager I see my GPU resources are at 100% utilization before and after. My GPU memory hovered around 15/32GB both before and after. FPS remained the same in both quality and performance modes respectively. Testing the exact same part of a game. Did both 1440p and AMD FSR scaling - no fluctuation in results both before and after.

Cheers for the effort and if it improves things for you, great! I'm just happy to be done with my fear that I've only been using 50% of my GPU for the past year lol

@IvanButBetter
Copy link

You can make sure the VM is 100% not using any resources by fully shutting it down after use (Not just disconnecting).

Open Hyper-V Manager
On the left-hand side, under the Hyper-V Manager dropdown you will see the name of your host machine. Click on it
In the centre tab you will see Virtual Machines, and the name of your VM. Click on it
Lastly, on the right hand side you will see a button that says Turn Off. This will shut down the VM completely

@mlbrnm
Copy link

mlbrnm commented Dec 31, 2024

I Frankenstein-ed this one together... Make sure you run as Administrator. (De)attach.zip

Thanks for making that.

Is this the best way to change the GPU allocation too? I set mine originally to 20% to play it safe, but I'm thinking I want higher now.

EDIT: Nevermind, found this: #280 (comment)

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

7 participants