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
7.54k stars 266 forks source link

Popup asking to close apps using dGPU not appearing when unpluged from the wall #3326

Closed Diego-JRH closed 1 hour ago

Diego-JRH commented 2 hours ago

Rules

What's wrong?

Sometimes when you are using a program that runs on dGPU and you unplug the computer or there is a power outage, all programs using the dGPU close without warning, leading to lose all unsaved work but sometimes in the same situation a popup window appears asking if you want to close all programs using the GPU, if you choose No, the computer transitions to batery mode without closing all apps. I want this beahaviour to be consistent, if a program uses dGPU and the charger is unplugged, then ask if I want to close it, if I manually select to iGPU only then there is no need to ask. I hope I explained it well.

How to reproduce the bug?

Open a program using dGPU, unplug charger, programs closes suddenly or a popup window appears asking if you want to close it. Don't know what changes the outcome.

Logs

log.txt

Device and Model

Asus ROG Strix SCAR 18 G834JY

Additional information.

No response

Armoury Crate

Uninstalled

Asus Services

None

Version

No response

OS

Windows 11 Pro 24H2

seerge commented 2 hours ago

@Diego-JRH hello,

Actually there is already such check in the app. It gets GPU usage % from Nvidia driver. In your case it was zero usage on the moment of power off.

29/10/2024 22:33:15: GPU usage: NVIDIA GeForce RTX 4090 Laptop GPU 0% <--- GPU USAGE WAS REPORTED TO BE ZERO
...
29/10/2024 22:33:15: Kill:prusa-slicer
29/10/2024 22:33:15: Stopped: prusa-slicer
29/10/2024 22:33:15: Kill:Rhino
29/10/2024 22:33:15: Stopped: Rhino
29/10/2024 22:33:15: Running eco command 1 <---- SETTING ECO

Just checking a list of processes that use GPU will render Optimized mode unusable, cause it will be always something that uses GPU (mostly literally your browser, that survives GPU power off just fine).

If you have unstable power you should just use Standard honestly :)

seerge commented 2 hours ago

@Diego-JRH and btw, you have Stop apps use GPU checked under Extra. That's why prusa-slicer and Rhino were closed. G-Helper stopped them. They didn't crash or close by themselves.

I'm not sure what kind of apps are they, but there is a chance that they will survive GPU power off, same as many others do (browsers / some light apps, etc). So you can just manually try running them and setting Eco

Diego-JRH commented 2 hours ago

Rhino is a 3D modeling software and Prusa Slicer is tool for "Slicing" meaning turning 3D models to Gcode so they can be 3D printed. They are not always using the dGPU, only when you are modeling or moving the model, but they run on it like games do. The browser or excel survived because they were using the iGPU.

seerge commented 1 hour ago

@Diego-JRH well, excel doesn't use GPU, browser does (especially if you have external monitor connected).

Since your apps didn't use GPU on the moment of power off, GPU usage check has passed :)

Checking for a GPU process list that nvidia driver reports is not an option as i explained above, cause it will simply render Optimized mode unusable (same as it actually happens in Armoury ...)

Diego-JRH commented 1 hour ago

I just tested what you said, the popup window only appears when a program is using the GPU to a certain degree, if the program runs on the GPU but uses it little enough, it will not trigger the popup window and will close it. I guess there in no workaround for this.

Diego-JRH commented 1 hour ago

It's storm season where I live, so sometimes the power goes out. If I'm unlucky enough it happens while I'm modeling, it suddenly closes and I have to rely on autosaves.

seerge commented 1 hour ago

@Diego-JRH yes, there is a threshold of 10% at the moment. I have set it based on my experiments with watching youtube in browser (that uses less than that). Youtube survives GPU shutdown :)

Mainly it would prevent game or app actively using GPU from crashing on sudden power off. Not more exotic cases.

There is no good workaround here. Just use Standard.

You can also try to add a power-off delay . But that is applicable if power goes off for a short period of time (like 3 seconds)

Diego-JRH commented 1 hour ago

Yeah I think that may work as the power usually is out for just a moment

seerge commented 1 hour ago

@Diego-JRH ok, great :) good luck with that then

I'm closing this as answered as there is nothing else that I can do here