sharpjd / GPUPrefSwitcher

Enables seamless switching of game settings and targeting the dGPU/iGPU for gaming laptops when they plug in or out, making portable gaming more viable and convenient.
GNU General Public License v3.0
19 stars 3 forks source link

Switching the entire system at once #4

Open Gazgiza opened 2 months ago

Gazgiza commented 2 months ago

Hi ! I've been tweaking the program for the past few days but I can't find a way to automatically switch the entire system at once on batery saver mode. I do get some better battery life but not as excepted. Is there a way to solve this ? Have a nice day !

sharpjd commented 2 months ago

Hi, not quite sure what you mean by "switching the whole system".

If you could include your laptop's specs (specific model), that would be useful.

This app requires you to add the apps you want to run on a specific GPU via Windows Settings -> Graphics or by clicking "Add App" in the app interface. I don't know of a way to set the GPU preference for every single app at once (the "default" key in the registry doesn't work).

How you'll know the app is working is when you see that the dGPU is shut off via monitoring apps like Task Manager, HWInfo64, or BatteryBar. If you need further help, you can check the tutorial video here: https://youtu.be/zRKj0TE9Z1Q

Depending on your specs and CPU settings (e.g. max clock), you may see less or more power savings. For example, on my i7 11800h, the power profile I mainly use on battery limits the CPU to 3.5GHz rather than the max 4.6GHz for the sake of efficiency.

Gazgiza commented 2 months ago

Hi, I'm using a dell g16 with a 4070 and a 13900hx. And my goal is sort of shutting down the 4070 when unplugged so that every app use the igpu and not having to manually add every app. I've seen sketchy tutorials talking about disabling the driver but it seems more risky than useful. Downclocking the cup seems to also be an option but I'll look at it later on. Ps: I've watched the video to set the app up.

Gazgiza commented 2 months ago

For the moment, the program works for the specified apps but it hasn't turned the gpu off

sharpjd commented 2 months ago

Unfortunately there could be a lot of reasons the is remaining on. In my personal experience, these include:

Additionally, make sure your laptop's mux switch isn't in dedicated graphics only mode.

The best way to check if there's still anything running is to go to Task Manager -> Details -> Left click column and select "Dedicated GPU Memory" and sort apps by that column. It should be 0 all the way down.

And indeed, disabling the driver or device from Device Manager is not the way to go.

Gazgiza commented 2 months ago

Are apps like NVIDIA control panel the problem or is it more GEFORCE experience ?

sharpjd commented 2 months ago

I've heard that GeForce Experience can cause problems, but that hasn't been the case for me. You could just close it and find out. I personally disable NVIDIA services entirely while on battery using the Task Scheduler trigger function because the dGPU seems to get pinged less. Here's a batch script to automate that (also make a copy but with net start instead of net stop for when you plug in):

echo This script disables NVIDIA related services. TIMEOUT /T 60 net stop /y NvContainerLocalSystem net stop /y NVDisplay.ContainerLocalSystem net stop /y FvSvc

Gazgiza commented 2 months ago

That's good for me, I haven't installed it.

Gazgiza commented 2 months ago

How much W/H is the battery on your laptop and how long does it last ?

sharpjd commented 2 months ago

93Wh. When it was in good health and the dGPU was off, 5-7 hours. Power consumption was 10w< idle and up to 30 when browsing the web.

You can follow tips from my previous comments and find out what your idle power draw is.

Gazgiza commented 2 months ago

With HWmonitor ?

Additionally, make sure your laptop's mux switch isn't in dedicated graphics only mode.

What do you mean by "mux" ?

Gazgiza commented 2 months ago

On hw monitor I get around 30watts of consumption on idle and my battery is 86 W/H

sharpjd commented 2 months ago

With HWmonitor ?

Additionally, make sure your laptop's mux switch isn't in dedicated graphics only mode.

What do you mean by "mux" ?

If you do not know what a laptop "Mux Switch" is, I'd highly recommend watching a video about it; they're an important part of gaming laptops. If your laptop is directly outputting video from the dGPU to the internal display, then the dGPU will obviously never turn off and keep consuming power.

On hw monitor I get around 30watts of consumption on idle and my battery is 86 W/H

Turn off background apps and switch away from the High Performance power plan. I have no idea if the 13900HX is just that power hungry; but for reference, my 11800h can consume as low as 1W when idle (the rest is taken by other system components such as the display, keyboard, motherboard, and RAM), adding up to 8-12W total — which is why I think 30W is still a bit unusually high.

Gazgiza commented 2 months ago

I think I found the problem. The gpu memory is used at around 10 percent on idle even though there's only hwmonitor opened. It doesn't switch to the integrated graphics when on battery... Do you know why ? I'll see what I can find about mux. Thanks

Gazgiza commented 2 months ago

That's wierd : explorer.exe is using multiple mo of dedicated memory and my browser too even though they are supposed to be on battery saving mode so my gpu is at 20 watts

Gazgiza commented 2 months ago

Capture d'écran 2024-09-03 191546

sharpjd commented 1 month ago

Check the Graphics Options panel to make sure that there aren't any apps set to "High Performance"

I also forgot to mention that HWInfo64 also wakes up the GPU when it starts, and may ping it every time you tab in and out. There is also a setting to not wake sleeping GPUs.

It's good you found the apps running on the dGPU. For now, simply try killing all those apps. Remember that unplugging from an external monitor will probably also require to do that.

Chrome sometimes holds some dGPU memory for me while I'm plugged in even without an external monitor. Closing and reopening usually does the trick

Gazgiza commented 1 month ago

Capture d'écran 2024-09-06 082006

Gazgiza commented 1 month ago

I have this whereas I should have the option for igpu right ?

sharpjd commented 1 month ago

Yes. The "Power Saving" option should show the name of your integrated graphics, not your 4070.

Perhaps your Mux Switch is set to bypass the iGPU. Check your laptop's OEM control panel app to change this.

If you can't find it there (unlikely since your laptop is new), check the BIOS.

Gazgiza commented 1 month ago

Perhaps your Mux Switch is set to bypass the iGPU. Check your laptop's OEM control panel app to change this.

I found the cause for this : I had disabled nvidia optimus so now I have the option. The dedicated memory usage is now at 0 but the shared memory is still used a bit so my dgpu doesn't go to sleep mode but the power draw is 4 watts less only. Is there a way to disable shared memory ?