GPU not properly switching between battery and AC performance modes when laptop power source changes

If I unplug my laptop before I boot it to run on battery, the GPU will perform as expected (e.g. operate in lower performance modes), if I then plug it into AC, the GPU performance will remain unchanged (e.g. it will not opreate in higher performance modes like it should)

Conversely if I do the reverse, e.g. boot on AC then the gpu will perform as expected, but if I unplug it it will constanlty try to perform at it’s highest performance setting when it does not have access to enough power for it (which might potentially cause hardware damage…)

Restarting X by logging out after each time I change the power source seems to allow me to work aorund the issue, but this is just completely unacceptable.

I took a log on AC while operating as normal, then I unplugged the laptop to recreate the above mentioned issue and took another log on Battery where the issue is occurring.

nvidia-bug-report.log.AC.gz (361.7 KB)
nvidia-bug-report.log.Battery.gz (426.7 KB)