NeilSeligmann / G15Manager

An open source alternative to manage your ROG Zephyrus G15. Supports changing Fan Profile, rebind most keys (including ROG Key), and changing Windows' Power Options
GNU General Public License v3.0
6 stars 3 forks source link

Feature Request: DGPU mode and Display Overdrive switch #3

Open TrooperZ opened 1 year ago

TrooperZ commented 1 year ago

Could you please add a feature to change the DGPU mode like in armory crate (Ultimate: dgpu on, Standard: mshybrid, Eco: dgpu off, extreme power savings) and display overdrive toggle?

Corbanistan commented 1 year ago

Could you please add a feature to change the DGPU mode like in armory crate (Ultimate: dgpu on, Standard: mshybrid, Eco: dgpu off, extreme power savings) and display overdrive toggle?

Wondering about this too. Maybe Nvidia Optimus gets close? I wonder how this could be done.

NeilSeligmann commented 1 year ago

As far as I remember, the Display Overdrive option is an executable in the Armoury Crate folder. I could look into implementing it.

And for the DGPU Mode, you can already do something close to it. By using Fn + C and Fn + V you can enable/disable the dedicated GPU. However, there is no option for using only the dedicated GPU.

Corbanistan commented 1 year ago

As far as I remember, the Display Overdrive option is an executable in the Armoury Crate folder. I could look into implementing it.

And for the DGPU Mode, you can already do something close to it. By using Fn + C and Fn + V you can enable/disable the dedicated GPU. However, there is no option for using only the dedicated GPU.

That should work for now. I never run dGPU only. Always have both enabled and the high demand stuff uses the Nvidia chip. What does the stock driver do to disable the dGPU? Just disable it similar to doing so in device manager?

TrooperZ commented 1 year ago

I was looking at ACPI calls earlier about the GPU switch with some guy and I found some possible leads on how the GPU mode is switched for the mux switch. It would be nice to implement a feature that lets you switch the GPU mode (dgpu or igpu, kind of like standard/ultimate mode in armory crate, usually requires restart) and the eco mode which kicks the dgpu into extreme power saving mode and doesn't let you use displays with it.

Could it be possible to replicate what Armory Crate does with the GPU modes?

Corbanistan commented 1 year ago

I was looking at ACPI calls earlier about the GPU switch with some guy and I found some possible leads on how the GPU mode is switched for the mux switch. It would be nice to implement a feature that lets you switch the GPU mode (dgpu or igpu, kind of like standard/ultimate mode in armory crate, usually requires restart) and the eco mode which kicks the dgpu into extreme power saving mode and doesn't let you use displays with it.

Could it be possible to replicate what Armory Crate does with the GPU modes?

What have you found out? Are they disabling it using something like setupapi.dll or tying into Nvidia's driver?

NeilSeligmann commented 1 year ago

As far as I remember, the Display Overdrive option is an executable in the Armoury Crate folder. I could look into implementing it. And for the DGPU Mode, you can already do something close to it. By using Fn + C and Fn + V you can enable/disable the dedicated GPU. However, there is no option for using only the dedicated GPU.

That should work for now. I never run dGPU only. Always have both enabled and the high demand stuff uses the Nvidia chip. What does the stock driver do to disable the dGPU? Just disable it similar to doing so in device manager?

The G15 Manager uses the same logic for disabling/enabling the dGPU as the G14 Manager it is based on. It uses the native Windows API to set the device configuration:

Here you can view the code: https://github.com/NeilSeligmann/G15Manager/blob/main/cxx/plugin/gpu/device.cxx

I don't know how the Armoury Crate does it.

NeilSeligmann commented 1 year ago

I was looking at ACPI calls earlier about the GPU switch with some guy and I found some possible leads on how the GPU mode is switched for the mux switch. It would be nice to implement a feature that lets you switch the GPU mode (dgpu or igpu, kind of like standard/ultimate mode in armory crate, usually requires restart) and the eco mode which kicks the dgpu into extreme power saving mode and doesn't let you use displays with it.

Could it be possible to replicate what Armory Crate does with the GPU modes?

As far as I know, the Armoury Crate will use different methods for switching the GPUs depending on the model of the computer. For example, the model I have (GA503 QR) does not have a MUX switch, the dGPU Nvidia is passed through the internal AMD GPU.

If you have the knowledge on how to implement the MUX switch, then please share it and I will gladly help you implement it. However, I cannot try it with my computer.

Corbanistan commented 1 year ago

I was looking at ACPI calls earlier about the GPU switch with some guy and I found some possible leads on how the GPU mode is switched for the mux switch. It would be nice to implement a feature that lets you switch the GPU mode (dgpu or igpu, kind of like standard/ultimate mode in armory crate, usually requires restart) and the eco mode which kicks the dgpu into extreme power saving mode and doesn't let you use displays with it. Could it be possible to replicate what Armory Crate does with the GPU modes?

As far as I know, the Armoury Crate will use different methods for switching the GPUs depending on the model of the computer. For example, the model I have (GA503 QR) does not have a MUX switch, the dGPU Nvidia is passed through the internal AMD GPU.

If you have the knowledge on how to implement the MUX switch, then please share it and I will gladly help you implement it. However, I cannot try it with my computer.

Currently experimenting with a rough GPU switcher console app I wrote in C#. It uses the Windows API (setupapi.dll). I originally tried with WMI but didn't like how it ended up. It's just a test app but I'll clean it up a little when I get time and upload to GitHub.

Corbanistan commented 1 year ago

I was looking at ACPI calls earlier about the GPU switch with some guy and I found some possible leads on how the GPU mode is switched for the mux switch. It would be nice to implement a feature that lets you switch the GPU mode (dgpu or igpu, kind of like standard/ultimate mode in armory crate, usually requires restart) and the eco mode which kicks the dgpu into extreme power saving mode and doesn't let you use displays with it. Could it be possible to replicate what Armory Crate does with the GPU modes?

As far as I know, the Armoury Crate will use different methods for switching the GPUs depending on the model of the computer. For example, the model I have (GA503 QR) does not have a MUX switch, the dGPU Nvidia is passed through the internal AMD GPU.

If you have the knowledge on how to implement the MUX switch, then please share it and I will gladly help you implement it. However, I cannot try it with my computer.

Just realized what you were saying. My G15 doesn't have a MUX switch either, but when on battery the dGPU is fully disconnected from the system. As in, not even visible in Device Manager. I think that may have an impact on why I get decent battery life. I now have a working demo in C# that disables the Nvidia GPU via software, but that doesn't go as far as the OEM drivers go.

TrooperZ commented 1 year ago

All the calls I was making weren't really doing much, but some guy and I on the UXTU discord found that the address 0x00090020 in the ACPI tables is responsible for some GPU switch thing (accepts the value of 1 or 0), that could be something responsible for the GPU switcher.

Corbanistan commented 1 year ago

Yup I think ACPI calls are the way to go to completely power down the dGPU. Just disabling it isn't powering it down completely. Looking at Nvidia Optimus.

TrooperZ commented 1 year ago

This guy got it down: https://github.com/seerge/g-helper

Corbanistan commented 1 year ago

This guy got it down: https://github.com/seerge/g-helper

Wow nice. Looks like it's for G14 but I'll take a look when I have time and maybe help to port whatever needs to be ported to G15 if needed.

Corbanistan commented 1 year ago

Quickly scrolling through his code, I noticed a few things differ between G14 and G15, specifically the GPU modes. Not sure if they're just named differently in G15 or if they actually work differently. I will test his app out soon. Maybe then when I get some time I'll mock something up for the G15 in C# (I don't use Go, but you'd be free to convert it to Go if you want).