Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with screen brightness when on dGPU (plugged in) #660

Closed
GibStorm opened this issue Jun 22, 2023 · 65 comments
Closed

Problems with screen brightness when on dGPU (plugged in) #660

GibStorm opened this issue Jun 22, 2023 · 65 comments
Labels
question Further information is requested

Comments

@GibStorm
Copy link

Describe the bug
If I run with GHelper instead of Armory Crate (all Armory Crate/ASUS services disabled) and plug in to have the Optimized/Auto settings switch as intended to high performance modes, the brightness of my display is not adjustable and stuck in a very low brightness state. If I use GHelper to switch to "Eco" mode and thus using the iGPU (Radeon) the brightness works fine.

In order to be able to use my dGPU (RTX 4070) on full brightness, I have to switch to using Armory Crate again (start all services etc) and closing GHelper.
Using the Windows brightness slider also does nothing. Twinke Tray app is not able to change the brightness either.

Clear scenario to Reproduce
Steps to reproduce the behavior:

  1. Run GHelper with Armory Crate uninstalled or all services disabled.
  2. Switch everything to optimal power saving in GHelper (auto/optimized).
  3. Increase screen brightness to 100%.
  4. Plug in the charger.
  5. Everything switches to performance mode as inteded, but screen brightness drops.
  6. Unable to adjust screen brightness in this state.

Expected behavior
I would expect that in addition to GHelper switching everything to performance mode as intended, the screen brightness would either automatically go to max or stay at the previous brightness level. It would be expected to be able to adjust the levels as well.

App Logs
Logs attached.

Screenshots or screencasts
Would not illustrate the problem.

Desktop (please complete the following information):

  • OS: Windows 11 (version 22H2, build 22621.1848)
  • Laptop model: ROG Zephyrus G14 (2023) GA402NI (IPS display, 165 hz)

Asus software

  • Armoury Crate: Yes, but services disabled when having issue.
  • MyASUS installed: Yes, but services disabled when having issue.
  • Other Asus services running in background: No, all disabled when having issue.

Additional context
Brand new laptop. Basically everything works fine using Armory Crate, but not with GHelper. I love this app, and would like to assist in fixing this issue since it is the one thing preventing me from replacing Armory Crate with it.

log.txt

@seerge
Copy link
Owner

seerge commented Jun 22, 2023

@GibStorm hello,

I have also noticed your message on reddit, but thanks for posting it here, it's way more convenient.

I'm keen to think that this is due to NVidia optimus (as someone else mentioned on reddit). It creates 2 screens in system configuration (1 real and 1 virtual) in order to do it's own switches of what GPU will drive screen each moment.

And when when dGPU gets enabled without restart (i.e. when you plug in on Optimized) windows just gets confused and tries to set brightness on a wrong screen.

Can you reach the state where brightness is not controllable (i.e. disable/enable GPU?) and try following things one by one, and see if it helps (then i will be able to "implement" that in g-helper too):

  1. Change display refresh rate to 60Hz and back
  2. Change display resolution
  3. Press Win+P (project settings) and try to switch things there back and forward (i.e. set single display)
  4. Manually run NVidia control panel
  5. Open windows Services -> and try to restart each nvidia service

Thanks for cooperation :)

@seerge seerge added the question Further information is requested label Jun 22, 2023
@seerge
Copy link
Owner

seerge commented Jun 22, 2023

@GibStorm also try this build that uses alternative method to control brightness from FN+F7/F8 hotkeys (to see if it makes difference?)

GHelper.zip

@GibStorm
Copy link
Author

GibStorm commented Jun 22, 2023

@GibStorm hello,

I have also noticed your message on reddit, but thanks for posting it here, it's way more convenient.

I'm keen to think that this is due to NVidia optimus (as someone else mentioned on reddit). It creates 2 screens in system configuration (1 real and 1 virtual) in order to do it's own switches of what GPU will drive screen each moment.

And when when dGPU gets enabled without restart (i.e. when you plug in on Optimized) windows just gets confused and tries to set brightness on a wrong screen.

Can you reach the state where brightness is not controllable (i.e. disable/enable GPU?) and try following things one by one, and see if it helps (then i will be able to "implement" that in g-helper too):

  1. Change display refresh rate to 60Hz and back
  2. Change display resolution
  3. Press Win+P (project settings) and try to switch things there back and forward (i.e. set single display)
  4. Manually run NVidia control panel
  5. Open windows Services -> and try to restart each nvidia service

Thanks for cooperation :)

I've tried all 5 things, without it changing anything in relation to the problem. Only thing I had problems with, was running NVIDIA Control Panel. I could not do that, because it states that I am "not using a monitor connected to an NVIDIA GPU. I've tried forcing the app to run on the other GPU using the Windows graphics settings, but that changes nothing.

@GibStorm
Copy link
Author

@GibStorm also try this build that uses alternative method to control brightness from FN+F7/F8 hotkeys (to see if it makes difference?)

GHelper.zip

The new version still doesn't enable me to change screen brightness. The Windows brightness slider changes, but visually there is no difference.

@seerge
Copy link
Owner

seerge commented Jun 22, 2023

@GibStorm ok, thanks for trying :)

I assume that in System -> Display settings you have 2 diplays (correct?) Each of them has a brightness slider, can you switch between displays and try to drag them and see if both have no effect on birghtness?

Screenshot 2023-06-22 122709

And just to confirm - does rebooting (in a state where brightness is locked) unlock brightness?

@GibStorm
Copy link
Author

@GibStorm ok, thanks for trying :)

I assume that in System -> Display settings you have 2 diplays (correct?) Each of them has a brightness slider, can you switch between displays and try to drag them and see if both have no effect on birghtness?

Screenshot 2023-06-22 122709

And just to confirm - does rebooting (in a state where brightness is locked) unlock brightness?

I actually don't see that overview at all. It shows no displays there at all.

image

@seerge
Copy link
Owner

seerge commented Jun 22, 2023

@GibStorm ok, what about my second question :

And just to confirm - does rebooting (in a state where brightness is locked) unlock brightness?

And can you try this build with a bit more verbose logging and post a log here again ? It won't fix brightness, i just want to see what is display configuration windows has :)

GHelper.zip

@seerge
Copy link
Owner

seerge commented Jun 22, 2023

P.S. And can you post a screenshot of your device manager with display adapters and monitors ? (like this one)

Screenshot 2023-06-22 125044

@GibStorm
Copy link
Author

@GibStorm ok, what about my second question :

And just to confirm - does rebooting (in a state where brightness is locked) unlock brightness?

And can you try this build with a bit more verbose logging and post a log here again ? It won't fix brightness, i just want to see what is display configuration windows has :)

GHelper.zip

I've just made a "clean" NVIDIA driver reinstall, just to make sure. Then I wanted to test this, but oddly it all now works just fine when I switch between charger and not.

I'm running with the new debug build, and have attached the log.

image
log.txt

@seerge
Copy link
Owner

seerge commented Jun 22, 2023

@GibStorm May be nvidia driver was the reason then?

You are not the only one reporting this, but from reddit i also see that people had same locked brightness also using armoury (sometimes). So that's why i think it's nvidia / optimus related issue.

What I also remember from AC behavior, it won't let you turn Eco unless optimus switch is literally set to "optimus" (i.e. not Auto and not NVidia only) in nvidia control panel. G-helper doesn't check / require that. May be the reason of locked brightness was that Eco mode was turned on with a different optimus setting in a first place? (just guessing)

P.S. From new log it's clear that it's only one display, and it's called DISPLAY1 in windows now :) so it's all good (but it's also probably the reason why brightness works)

@GibStorm
Copy link
Author

I don't know, but maybe you should see if you could log stuff like that? I'm runding your debug version now, in case something pops up again 🙂

@seerge
Copy link
Owner

seerge commented Jun 22, 2023

@GibStorm you can try to "re-create" issue now.

SCENARIO 1 (all good)

  1. Start with GPU set to Standard (i.e. enabled)
  2. Set Nvidia control panel display mode to - "Optimus" (2nd option)
    optimus
  3. Set GPU to Eco -> check brightness controls
  4. Set GPU to Standard again -> check brightness controls

SCENARIO 2 (trying to break it)

  1. Start with GPU set to Standard (i.e. enabled)
  2. Set Nvidia control panel display mode to - "Nvidia GPU only" (3nd option)
  3. Set GPU to Eco -> check brightness controls
  4. Set GPU to Standard again -> check brightness controls (should be broken?)

@GibStorm
Copy link
Author

I'll take a look at it later tonight and will get back to you. Thank you for your help so far :)

@GibStorm
Copy link
Author

Adjusting brightness stopped working again. This time it was stuck at max brightness though.

So,

SCENARIO 1 (started while brightness adjustment didn't work while plugged in)

  1. GPU mode was already "Standard" due to "Optimized" setting and being plugged in
  2. Changed Display Mode in NVIDIA Control Panel from "Auto Select" to "Optimus" - Brightness adjustments still don't work
  3. Set GPU Mode to "Eco" - Adjustments still don't work
  4. Set GPU Mode to "Standard" - Adjustments still don't work

SCENARIO 2

  1. Set GPU Mode to "Standard"
  2. Changed Display Mode to "NVIDIA GPU Mode Only" - Brightness adjustments still don't work
  3. Set GPU Mode to "Eco". Screen went black and hen came back, NVIDIA Control Panel closed itself. Brightness controls now work. (cannot open NVIDIA Control Panel in this state)
  4. Set GPU Mode to "Standard" again. Brightness controls stopped working yet again,

Through all of this, your second 0.89.0.0 debug version was used. Log attached.
log.txt

@seerge
Copy link
Owner

seerge commented Jun 22, 2023

@GibStorm ok, clear.

But what I want to know if SCENARIO 1 breaks brightness controls or not (when it's already broken it's not much help)

Does rebooting help to restore brighntess control? (i assume it does)

If so - can you reboot in standard mode and try to repeat SCENARIO 1 (i.e. when display mode is set to "Optimus" prior to switching GPU off), and see if it brightness works after?

@GibStorm
Copy link
Author

Rebooting restores brightness control without doing anything else (while in "Standard" mode).

OK, so whille in "Standard" mode and brightness controls now working:

  1. I opened NVIDIA CP and Display Mode is in "NVIDIA GPU Only Mode".
  2. I try to set Display Mode to "Auto Select" which gives me error about a couple of apps that need closing first.
  3. I close the apps, and a message pops up from NVIDIA CP that Display Mode is now in "Optimus Mode" (Auto Select is chosen). Brightness controls still work at this point.
  4. Just for good measure, I set Display Mode to "Optimus" for testing. Brightness controls still work.
  5. I set GPU Mode to "Eco". NVIDIA CP closes itself. Brightness controls work.
  6. I Set GPU Mode to "Standard". Brightness controls still work.

At this point I start thinking that the issue only happens in relation with actually connecting the charger.
I wanted to test this, so:

  1. I set CPU Mode to "Turbo" and GPU Mode to Optimized while having the charger plugged in.
  2. Tested brightness controls, which still work at this point.
  3. Opened NVIDIA CP and set to "Auto Select". Brightness controls work.
  4. Unplugged the charger. NVCP closed itself, CPU mode went to Silent, GPU mode to Eco (as expected). Brightness controls still work.
  5. Re-inserted the charger. CPU mode went to Turbo, GPU mode to Standard (as expected). Brightness controls still work (!)

Honestly, I fail to see the culprit here.

Another log is attached.

log.txt

@GibStorm
Copy link
Author

Please not that I do not have two displays detected, as you mentioned earlier. I only have one.

@seerge
Copy link
Owner

seerge commented Jun 22, 2023

@GibStorm thanks for trying, i see that you have only 1 display and it's always main (i.e. DISPLAY1) from the log :) so my first assumption was not correct

I think the key here - is that NVidia display mode has to be in Optimus (or Auto but also in "optimus"), i.e. it has to be AMD iGPU driving display BEFORE you turn dGPU off.

AC literally won't let you set Eco if display mode is not Optimus, and that's probably a reason for that.

I'm not aware about way to programmatically set Optimus setting somehow (from g-helper), i think it can be done only by hand by user. But I will try to look into if it's possible to read optimus status at least (i.e. throw a warning for user if he wants to set Eco)

For now I would just advice to either always keep nvidia display in optimus, or at least set it prior to disabling GPU (setting Eco mode) :)

@GibStorm
Copy link
Author

I´ll keep running your debug build of G-Helper, and set Display Mode in NVCP to "Optimus" specifically. If that prevents the problem, at least we have made progress :)

@seerge
Copy link
Owner

seerge commented Jun 22, 2023

@GibStorm oke, btw second display info doesn't come from me only . It comes from this issue #521 :) (see a screenshot there showing 2 displays)

And that's kind of frustrating that you have only 1 display in config ;) as I was hoping to use that as a marker to check if optimus is on or not

@GibStorm
Copy link
Author

@GibStorm oke, btw second display info doesn't come from me only . It comes from this issue #521 :) (see a screenshot there showing 2 displays)

I know, I've seen :) I just wanted to emphasize that it wasn't the case with my machine. Maybe that's different in the 2023 models of the Zephyrus G14's?

@seerge
Copy link
Owner

seerge commented Jun 22, 2023

@GibStorm can you run in powershell (as admin or not) following command ? that's nvidia's own utility that outputs current gpu status

nvidia-smi -i

And btw, sorry for asking so much questions, i just don't have access to laptop with nvidia GPU at all atm, as I have returned my G16 back to the store, due to whining fan, and waiting for some sale on G14 2023 :D

@GibStorm
Copy link
Author

Had to be a bit more specific with the command, but here is the output :)

image

@seerge
Copy link
Owner

seerge commented Jun 22, 2023

@GibStorm and can you check if output changes if you set display mode to "Nvidia Only" instead of "Optimus" ?
I mainly interested in section with Bus-ID / Disp.A (it says OFF now)

@GibStorm
Copy link
Author

GibStorm commented Jun 22, 2023

The only difference as far as I can see, is that now it has apps actually running off of the dGPU. Everything else seems the same to me.

Also, even though switching this back and forth just now, brightness controls still work.

image

@seerge
Copy link
Owner

seerge commented Jun 22, 2023

@GibStorm
Actually it says ON now (instead of OFF)
248077437-6aaa0f8b-d235-4d30-809e-d5feea44d054

@GibStorm
Copy link
Author

@seerge right you are. Did't see that :) Awesome, so you can now check this state, I guess?

@seerge
Copy link
Owner

seerge commented Jun 22, 2023

@GibStorm yes, if that's the flag. But I think it would be better to run a command that would output only that

nvidia-smi --help-query-gpu - will give you full list of parameters (find display active there)
nvidia-smi --query-gpu=<PUT DISPLAY ACTIVE NAME HERE> --format=csv - to get value

@seerge
Copy link
Owner

seerge commented Jun 22, 2023

@GibStorm or just run nvidia-smi -i 0 -q

@GibStorm
Copy link
Author

Yeah, that's what I thought :)

Here's what I suggest you write.

Title:
NVIDIA Display Mode is not set to Optimus

Description:
Disabling the dGPU by going to Eco mode while Display Mode in NVIDIA Control Panel is not set to Optimus might cause problems with brightness controls until after the next reboot.

Do you still want to continue?

image

@GibStorm
Copy link
Author

GibStorm commented Jun 23, 2023

Choosing "No" in that popup causes the main application to be stuck in "Changing..." state, as seen here

image

@seerge
Copy link
Owner

seerge commented Jun 23, 2023

@GibStorm this build should fix it :)
GHelper.zip

@seerge
Copy link
Owner

seerge commented Jun 23, 2023

@GibStorm do we consider this as solved then?

@GibStorm
Copy link
Author

GibStorm commented Jun 23, 2023

@seerge yup :) Thanks a lot for your help!

@seerge seerge closed this as completed Jun 23, 2023
@AudreyAP
Copy link

@seerge I don't have any issue with brightness controls when switching from dGPU to iGPU on Intel+Nvidia M16 2023 - might want to see if the issue is only on AMD machines and not give the popup otherwise?

My windows brightness slider breaks when in advanced Optimus / mux mode but it did that on stock Asus windows, and I don't think it's related to this issue. I can still control brightness with keys (same as OEM image).

@seerge
Copy link
Owner

seerge commented Jun 26, 2023

@AudreyAP it could be interested only on amd+nvidia setups, so you can’t “break” brightness controls on your m16 no matter what you do now?

@seerge
Copy link
Owner

seerge commented Jun 26, 2023

@AudreyAP try this build, it should skip whole check for non-AMD CPUs

GHelper.zip

@kwhychange
Copy link

Hi, I tried the new 0.91 update but the problem persists for me. I have my settings set to optimized and auto. Is there anything that I can do to fix this?

@gloglas
Copy link

gloglas commented Jun 30, 2023

I had same issue, try updating everything and then do Clean Nvidia driver installation. Don't forget to turn Optimus back on. It seems to help for now but we'll see.

@AudreyAP
Copy link

AudreyAP commented Jun 30, 2023

@seerge Just double checked:

Using latest GHelper release 0.91, being in "NVIDIA GPU only", then switching to ECO in GHelper does not result in any brightness issues on the iGPU. It does not seem that M16 2023 (Intel + Nvidia) needs to be switched to Optimus mode before switching the GPU off.

This is partially unrelated, but I found another issue while testing this. Certain apps (mostly games) respond very poorly to ECO mode changes. Valorant for example will go completely unresponsive and will need to be quit via task manager if running on the GPU, then switched to ECO mode.

You might want to add an option to "Optimized" mode to ask the user to confirm that they want to switch to Eco mode after unplugging if anything is being rendered by the GPU, just in case the user wants to just move their power adaptor to a new outlet or something. User should be able to switch to ECO manually (they know what they are doing), but Optimized should have an option to ask for confirmation such that crashes can be avoided.

@seerge
Copy link
Owner

seerge commented Jun 30, 2023

@AudreyAP hello.

Actually app already checks for GPU load before switching it OFF / ON in Optimized mode and shows you a warning if load is > 10% (i.e. game is running). This is done to prevent crashing your gaming session if you suddenly lose power in outlet :) You can see GPU usage % in app logs when it starts switching.

@AudreyAP
Copy link

@seerge Oh! Oops. 🤦‍♀️

I guess valorant loading screen in the background must just not load the GPU enough. All good then :)

@AudreyAP
Copy link

AudreyAP commented Nov 9, 2023

I may have been wrong here - I'm not sure why, but I can sometimes break brightness control while the GPU is enabled but not in advanced optimus mode.

Switching to ECO mode allows me to control the brightness once again, but switching back to Standard (gpu on, but intel driving the display) results in brightness controls not working and being locked to a low-ish value. I need to reboot to get brightness control back while in standard mode.

@AudreyAP
Copy link

AudreyAP commented Nov 9, 2023

Restarting this service:

image

fixes brightness control.

@Meglos
Copy link

Meglos commented Feb 2, 2024

@seerge Hi, sorry for the necro thread but this is still an issue on the G16 2023 (Nvidia/Intel). The fix mentioned above (restarting the Nvidia service) does work but it is kind of a pain in the ass to open up services each time I plug in my laptop. A clean install of Nvidia drivers fixed it temporarily but then it came back upon the next restart.

@AudreyAP
Copy link

AudreyAP commented Feb 2, 2024

@Meglos I think this is a windows/Nvidia bug tbh and I have some theories about what might be causing it.

Do you happen to use hibernation?

@Meglos
Copy link

Meglos commented Feb 2, 2024

@AudreyAP I do, because sleep seems to have all sorts of annoying issues in Win11

@AudreyAP
Copy link

AudreyAP commented Feb 2, 2024

@Meglos try disabling hibernation. My theory is that for whatever reason the drivers REALLY don't like handling the GPU appearing after hibernation. The issue only ever happens after the machine comes out of hibernation for me. I'm turning off hibernation to test, maybe if we both get good results serge can implement auto-restarting the Nvidia service when the machine comes out of hibernation?

Edit: I've found that disabling wake on lan and magic packet in the ax211 settings help with sleep issues. No clue why.

@seerge
Copy link
Owner

seerge commented Feb 2, 2024

@Meglos hello, the official workaround is live in the app for a while #1042 . You need to select "Enable GPU on shutdown", then windows / nvidia drivers will always see GPU on boot and act fine :)

@AudreyAP
Copy link

AudreyAP commented Feb 2, 2024

@seerge I've been using it for a few weeks and the issue remains. See above for my hypothesis on why it keeps happening?

@seerge
Copy link
Owner

seerge commented Feb 2, 2024

@AudreyAP checkbox from #1042 also covers hibernation (at least if it happens not while laptop is asleep). Did you try it ? :)

@AudreyAP
Copy link

AudreyAP commented Feb 2, 2024

@seerge yep I've been using it for at least a few weeks and while the problem is less severe, it still happens every so often.

I think the problem may be the transition from sleep to hibernate caused by adaptive hibernation, as this issue mostly happens in the morning when I turn the laptop on after it has been hibernating overnight automatically. Maybe that transition is not being caught? I do not ever manually hibernate, it only ever happens due to adaptive hibernation. The machine seems to transition directly between sleep and hibernation according to sleepstudy so I think ghelper is literally not able to even detect that the transition has happened. That's my theory.

@seerge
Copy link
Owner

seerge commented Feb 2, 2024

@AudreyAP if hibernation happens during sleep - then all apps including G-Helper are suppressed. So if you had dGPU disabled in that moment, the "workaround" doesn't happen of course :) there is no solution for that.

@AudreyAP
Copy link

AudreyAP commented Feb 2, 2024

@seerge how about this: when ghelper becomes active, check if the machine has recently exited hibernation. If it has, and if the user has the "enable gpu on shutdown" option enabled, and if the GPU is disabled (meaning ghelper was not able to successfully enable it), enable the GPU, then restart the "Nvidia display container ls" service. Restarting that service fixes the brightness issue 100% of the time for me, no reboot necessary.

This would cause a little bit of lag while the GPU switches so maybe it could be an optional add-on to "enable gpu on shutdown"?

@seerge
Copy link
Owner

seerge commented Feb 2, 2024

@AudreyAP i think it's way too complicated :| may be just add a quick batch file on desktop with a command to restart service and run it if that happens? :)

P.S. As far as I remember, restarting NVidia container will not help with setting Starndar -> Eco mode again anyway

@AudreyAP
Copy link

AudreyAP commented Feb 2, 2024

@seerge the real solution here is making dynamic hibernate wake up the machine before it commands hibernation... I'll try to figure out if this is possible.

@seerge
Copy link
Owner

seerge commented Mar 5, 2024

@AudreyAP and others,

I'm now testing G14 2024, and it seems like it doesn't suffer from this "Shutdown in Eco mode" issue at all #1042

I'm able to shutdown device in Eco, start over and switch Standard <-->Eco any number of times w/o any issues.

I run latest official Nvidia drivers tho. Can you confirm it's "fixed" now ? or is it only 2024 models

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

6 participants