seerge / g-helper

Lightweight Armoury Crate alternative for Asus laptops and ROG Ally. Control tool for ROG Zephyrus G14, G15, G16, M16, Flow X13, Flow X16, TUF, Strix, Scar and other models
https://seerge.github.io/g-helper/
GNU General Public License v3.0
6.83k stars 247 forks source link

Alert before turning off dGPU in Optimized mode #377

Closed dsevillamartin closed 1 year ago

dsevillamartin commented 1 year ago

Is your feature request related to a problem? Please describe. I don't want my apps running on dGPU (such as games) to close when using Optimized GPU and the power cable disconnects.

Describe the solution you'd like v0.48 says App will show a warning message when Optimized mode is about to go Eco but GPU is in heavy use, but I've personally never seen this. I don't know if it doesn't work or I just haven't seen "heavy usage", but even running 3DMark and unplugging caused the dGPU to disable. Some notification (either as Windows notif or an on-screen alert about closing apps or keeping dGPU on) would be helpful.

This is one of the "problems" with Armory Crate and AMD Software sometimes, that it doesn't go Eco when a few apps are using it. But in some cases I wish it'd do that behavior or alert.

Describe alternatives you've considered None

Additional context None

seerge commented 1 year ago

@dsevillamartin current GPU usage treshold is 20%, can you check this build (where i have added GPU usage log) and post here : ?

GHelper.zip

dsevillamartin commented 1 year ago

Sure thing. For info, I have the 6700S G402RJ model. For this log, I launched Hades with unlocked frames (500+), giving a consistent 67% GPU usage in the menu.

Screenshots

**Before unplugging**, drop in 2nd image is alt-tabbing: ![Screenshot 2023-05-14 110901](https://github.com/seerge/g-helper/assets/6401250/6cfacc9c-342f-4d74-9b77-580cb61a29fb) ![Screenshot 2023-05-14 110919](https://github.com/seerge/g-helper/assets/6401250/9648fd91-5c0f-4945-a368-a45961419ae5) **After unplugging**, immediately goes to 0 usage as the GPU has been disabled. Then switches to iGPU usage: ![Screenshot 2023-05-14 111008](https://github.com/seerge/g-helper/assets/6401250/d29dc2d2-24af-4bb2-a34a-d1ca21e9fcc9)

5/14/2023 11:08:26 AM: ------------
5/14/2023 11:08:26 AM: App launched: ROG Zephyrus G14 GA402RJ_GA402RJ :0.62.0.0
5/14/2023 11:08:26 AM: Unable to load DLL 'nvapi64' or one of its dependencies: The specified module could not be found. (0x8007007E)
5/14/2023 11:08:26 AM: AutoSetting for Online
5/14/2023 11:08:26 AM: BatteryLimit = 80 : OK
5/14/2023 11:08:26 AM: PerformanceMode = 1 : OK
5/14/2023 11:08:26 AM: FanCPU = 14-2D-35-3F-48-51-58-62-11-23-30-3E-48-4E-57-5D : OK
5/14/2023 11:08:26 AM: FanGPU = 14-31-3C-44-4B-50-54-62-16-1D-28-34-40-47-55-5F : OK
5/14/2023 11:08:26 AM: Boost 0
5/14/2023 11:08:26 AM: Eco flag : 0
5/14/2023 11:08:26 AM: Mux flag : 1
5/14/2023 11:08:27 AM: Screen = 120Hz : OK
5/14/2023 11:08:27 AM: ScreenOverdrive = 0 : OK
5/14/2023 11:08:27 AM: Monitor Power On
5/14/2023 11:09:34 AM: WMI event 87
5/14/2023 11:09:34 AM: WMI event 123
5/14/2023 11:09:35 AM: Windows - Power Mode Changed
5/14/2023 11:09:35 AM: AutoSetting for Offline
5/14/2023 11:09:35 AM: BatteryLimit = 80 : OK
5/14/2023 11:09:35 AM: PerformanceMode = 0 : OK
5/14/2023 11:09:35 AM: FanCPU = 27-31-3C-42-48-4D-51-62-09-0F-15-1B-22-29-30-45 : OK
5/14/2023 11:09:35 AM: FanGPU = 31-3D-40-44-48-4D-51-62-09-16-1D-1F-26-2D-34-4A : OK
5/14/2023 11:09:35 AM: GPU usage: 5
5/14/2023 11:09:42 AM: GPUEco = 1 : OK
5/14/2023 11:09:42 AM: PowerLimit A0 = 30 : OK
5/14/2023 11:09:42 AM: PowerLimit A3 = 30 : OK
5/14/2023 11:09:42 AM: PowerLimit B0 = 15 : OK
5/14/2023 11:09:43 AM: Eco flag : 1
5/14/2023 11:09:43 AM: Mux flag : 1
5/14/2023 11:09:43 AM: Screen = 60Hz : OK
5/14/2023 11:09:43 AM: ScreenOverdrive = 0 : OK
5/14/2023 11:09:54 AM: WMI event 207
5/14/2023 11:09:54 AM: WMI event 88
5/14/2023 11:09:54 AM: WMI event 123
5/14/2023 11:09:55 AM: Windows - Power Mode Changed
5/14/2023 11:09:55 AM: AutoSetting for Online
5/14/2023 11:09:55 AM: BatteryLimit = 80 : OK
5/14/2023 11:09:55 AM: PerformanceMode = 1 : OK
5/14/2023 11:09:55 AM: FanCPU = 14-2D-35-3F-48-51-58-62-11-23-30-3E-48-4E-57-5D : OK
5/14/2023 11:09:55 AM: FanGPU = 14-31-3C-44-4B-50-54-62-16-1D-28-34-40-47-55-5F : OK
5/14/2023 11:09:55 AM: Boost 0
5/14/2023 11:10:03 AM: GPUEco = 0 : OK
5/14/2023 11:10:03 AM: Eco flag : 0
5/14/2023 11:10:03 AM: Mux flag : 1
5/14/2023 11:10:03 AM: Screen = 120Hz : OK
5/14/2023 11:10:03 AM: ScreenOverdrive = 0 : OK
5/14/2023 11:10:06 AM: Unable to load DLL 'nvapi64' or one of its dependencies: The specified module could not be found. (0x8007007E)
seerge commented 1 year ago

@dsevillamartin in log i see that on the moment of unplugging GPU usage was 5% , below 20% threshold. Did you alt tab game when unplugging?

dsevillamartin commented 1 year ago

I did not. The game was open and GPU usage was 67% when I unplugged. The moment I saw any number lower than that was after the screen went black, already having switched from dGPU to iGPU. Hades didn't close, but it did immediately hang and need force closing.

Interestingly, I did have the alert appear for the first time while trying to use OBS to record both Hades and the Task Manager. In that case, the screen still went black but the game functioned fine as the dGPU was still enabled.

I've had this occur with other games though. I believe with Stardew Valley, Persona 4 Golden, and others. They either close or hang.


EDIT It actually seems to be working fine now with Hades? So I'm not entirely sure what's going on. I hadn't seen the alert before trying to record it, and now I saw it when just testing it with the game again. I'll try to do some more testing.

seerge commented 1 year ago

@dsevillamartin well, i can lower threshold. But main reason it's there - is to prevent false alarms, as even 4K video in youtube would push your gpu to 5-10% easily

seerge commented 1 year ago

@dsevillamartin try this build with treshhold set to 10% GHelper.zip

dsevillamartin commented 1 year ago

I'm not sure if it's a threshold issue. I don't think I'd suggest that change; I do agree with the false alarms thing.

Could it be that the check occurs too late, perhaps during that black flash? I'll admit I'm not entirely sure how these things work, but I legitimately had never seen the alert when previously unplugging and having high GPU usage. The fact that GHelper at times would detect 5% usage when it had been at 67% right before unplugging (and would've remained had the dGPU not been turned off) I think is the main issue, but what that'd be attributed to, I don't know.

I think the GPU usage check is fine --- perhaps adding some customization to change the range and/or add apps to a list that prevent Eco mode. I know this'd be more work, but perhaps help for not always intensive apps that still require heavy GPU usage at times.

I just attempted it with 3DMark and the benchmark immediately closed --- this could be just because even alt-tabbing will close it, but shows the error "No DXGI adapter with given Iuid found" so I think GHelper turned off dGPU and made it crash (even though GPU usage was at over 80%). The logs actually say GPU usage: 0 even though a benchmark was rendering.

seerge commented 1 year ago

@dsevillamartin GHelper.zip check this build, next to 10% limit, i have adedd a GPU adapter name into logs, mb it takes igpu by some reason in your case ...

seerge commented 1 year ago

Btw, i hope you don't have Asus smart display control running, right ? cause if you do, it probably switches refresh rate on your screen causing gpu to drop to 0% for a moment and it confuses g-helper of course

dsevillamartin commented 1 year ago

🤦‍♂️ It looks like I did have ASUS Smart Display Control running... my apologies. Stopping it did make the dGPU remain enabled through 3DMark running.

I'm not sure if I should've read somewhere to uninstall this? I couldn't find it in the README and I'm fairly certain I ran the debloat script as well. Not blaming you of course --- I really appreciate this program.

This issue can probably be closed due to user error then. I do believe that perhaps a list of apps that prevent Eco mode would be helpful, but I understand if that's not something you want to add and/or maintain. It would help with apps that aren't using 20% GPU, but perhaps it's not worth the effort.

Thank you very much for your help 🙏 and this app.

seerge commented 1 year ago

@dsevillamartin it just dublicates g-helper refersh rate switcher, except it does it in a wrong time (before gpu switch)

I will lower threshold to 10% in next builds, to see how it goes.