systemd-backlight does not save and restore brightness for nvidia display

Bug #1840592 reported by Bump
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
nvidia-graphics-drivers (Ubuntu)
Confirmed
Undecided
Unassigned
nvidia-graphics-drivers-418 (Ubuntu)
Confirmed
Undecided
Unassigned
nvidia-settings (Ubuntu)
Confirmed
Undecided
Unassigned
systemd (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Running nvidia gtx 1080 graphics card, with proprietary nvidia drivers on ubuntu 19.04. I can change screen brightness from 0% to 100% in 5% steps. However, after a reboot or after a shutdown, brightness level reverts to 100%. Please fix to is "remembers" the current brightness value at shutdown time, like in does Windows.

Revision history for this message
Bump (bump55) wrote :
Revision history for this message
Bump (bump55) wrote :

Happens on both ubuntu and Plasma.

Revision history for this message
Bump (bump55) wrote :
summary: - display brightness not restored on next boot
+ display brightness not restored on next boot resets to 100
Revision history for this message
Bump (bump55) wrote : Re: display brightness not restored on next boot resets to 100

$ cat /sys/class/backlight/nvidia_0/actual_brightness
85
$ cat /sys/class/backlight/nvidia_0/max_brightness
100

Revision history for this message
Bump (bump55) wrote :

/lib/systemd/system/systemd-backlight@.service NOT working properly with nvidia cards.

Bump (bump55)
summary: - display brightness not restored on next boot resets to 100
+ systemd-backlight does not save&restore brightness for nvidia display
Bump (bump55)
summary: - systemd-backlight does not save&restore brightness for nvidia display
+ systemd-backlight does not save and restore brightness for nvidia
+ display
Revision history for this message
Bump (bump55) wrote :

systemctl list-units --no-pager |grep "systemd-backlight"
  systemd-backlight@backlight:acpi_video0.service loaded active exited Load/Save Screen Backlight Brightness of backlight:acpi_video0
  systemd-backlight@backlight:nvidia_0.service loaded active exited Load/Save Screen Backlight Brightness of backlight:nvidia_0

Revision history for this message
Bump (bump55) wrote :

The notebook has 2 gpus, one is from the intel cpu and another is nvidia which can be enabled or disable on bios on section "MSI VGA MODE" and choose "MSI IGPU MODE" or "MSI DGPU MODE"

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

The backlight device only gets registered after it's opened by graphical session.

And the backlight gets unregistered when graphical session stops, hence when systemd-backight@.service's "Conflicts=shutdown.target" triggers, the backlight is already gone so the brightness wasn't saved.

Since it's not saved, the backlight won't be restored for next boot.

The easiest approach is to let nvidia driver always registers the backlight device.

Revision history for this message
Bump (bump55) wrote :

Well, apparently Nvidia driver doesn't do that.

Revision history for this message
D (djve) wrote :

And it's an issue with 20.04 daily builds.
Hardware is Lenovo P73 with NVIDIA RTX-5000 Q-Max.

So how can the driver be made to register the backlight device?

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in nvidia-graphics-drivers (Ubuntu):
status: New → Confirmed
Changed in nvidia-graphics-drivers-418 (Ubuntu):
status: New → Confirmed
Changed in nvidia-settings (Ubuntu):
status: New → Confirmed
Changed in systemd (Ubuntu):
status: New → Confirmed
Revision history for this message
Bump (bump55) wrote :

Has anybody checked how other distros operate this? Maybe Debian/Kali?

Revision history for this message
Ayush Akarsh (ayush-akarsh) wrote :

I have a nvidia 1650 graphic card on my legion-Y540 with ubuntu 20.04
I had fixed my brightness issue(Function keys not working) by adding Option "RegistryDwords" "EnableBrightnessControl=1" in the device section of /etc/x11/xorg.conf

It worked perfectly well until a software update, then now method worked, and I am only able to adjust brightness with the help of brightness controller, but in that I cannot use night mode, cause it sets the brightness to maximum only, whenever I use that.

Please help!!

Revision history for this message
Bump (bump55) wrote :

@ayush-akarsh try this command to get and set backlight. Works for me on nvidia.

xbacklight -get
xbacklight -set 40

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.