BartoszCichecki / LenovoLegionToolkit

Lightweight Lenovo Vantage and Hotkeys replacement for Lenovo Legion laptops.
GNU General Public License v3.0
5.53k stars 249 forks source link

Add option to keep dGPU awake #1443

Open personshelldon opened 1 month ago

personshelldon commented 1 month ago

Rules

Version

2.24.1

OS

Windows 11 Pro 10.0.22631 Build 22631

Device

Legion 5 Pro 16ARX8

Is your feature request related to a problem?

I found a similar closed feature request but without an explanation of why this option is needed.

Many Legion devices on AMD + dGPU have a problem with display stuttering/freezing for 0.5-1 seconds when applications are opened sometimes. This isn't very pleasant when it happens 10 times a day... I found that this problem is related to a concrete build: AMD + dGPU + Windows 11. There are many possible solutions for this problem: disable Windows MPO layers, disable GPU Hardware Scheduling, disable FreeSync etc. But nothing helped.

And I found that causing this problem on my machine. When You open any application it may wake up the dGPU that is in a Power Off state and this "Wake Up" process sometimes freezes all the screen (even the mouse cursor). The most "freezable" place when You are in Hybrid-Auto mode and trying to open Display Settings - a 50% percent chance that there will be a stutter for 1 second. Because LenovoLegionToolkit also reads some data about dGPU it may also freeze the screen when opened sometimes, for example.

The problem can be fixed by 2 possible solutions: force the use of iGPU (disable dGPU) or keep the dGPU Powered On in a low power (P8) state. I tested both of these solutions for a week and no stuttering since then.

How would you like the problem to be solved?

Add the possibility to change GPU Working Mode in Actions and add these actions to Fn+F9 hotkeys.

What alternatives have you considered?

Add a switch that will keep the dGPU in Power On low power (P8) mode. (For example, I found this solution https://github.com/jobeid/TrayPwrD3 and tested it - it works also and fixes the problem)

Additional information

No response

BartoszCichecki commented 1 month ago

Regarding dGPU working mode and Actions, check the Arguments section in Readme - you will find what you need.

Regarding locking dGPU to P8 - interesting idea, let's see if it picks up.

personshelldon commented 1 month ago

@BartoszCichecki Thank You! I did not see that option, sorry for that. It is exactly what will help me very much!

BartoszCichecki commented 2 weeks ago

I did a bit of reaserch on keeping dGPU awake. I don't know DirectX APIs well enough to do anything about it. If someone wants to help, please be my guest.