amdgpu_bl0: Failed to write system 'brightness' attribute: Invalid argument

Bug #1954843 reported by Matthew D. Mower
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Confirmed
Undecided
Unassigned
systemd (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Ubuntu 21.10 does not succeed at setting the display brightness after booting (either to the GNOME login screen or to a logged-in user's desktop). The brightness is at its highest level until I adjust it with keyboard shortcuts or a GUI tool.

The systemd-backlight@backlight:amdgpu_bl0 service seems to fail during startup, but I can subsequently run it after startup and it succeeds (and restores brightness):

mdmower@T14S ~ $ sudo systemctl status systemd-backlight@backlight:amdgpu_bl0
[sudo] password for mdmower:
× systemd-backlight@backlight:amdgpu_bl0.service - Load/Save Screen Backlight Brightness of backlight:amdgpu_bl0
     Loaded: loaded (/lib/systemd/system/systemd-backlight@.service; static)
     Active: failed (Result: exit-code) since Tue 2021-12-14 13:26:05 PST; 30s ago
       Docs: man:systemd-backlight@.service(8)
    Process: 962 ExecStart=/lib/systemd/systemd-backlight load backlight:amdgpu_bl0 (code=exited, status=1/FAILURE)
   Main PID: 962 (code=exited, status=1/FAILURE)
        CPU: 3ms

Dec 14 13:26:05 T14S systemd[1]: Starting Load/Save Screen Backlight Brightness of backlight:amdgpu_bl0...
Dec 14 13:26:05 T14S systemd-backlight[962]: amdgpu_bl0: Failed to write system 'brightness' attribute: Invalid argument
Dec 14 13:26:05 T14S systemd[1]: systemd-backlight@backlight:amdgpu_bl0.service: Main process exited, code=exited, status=1/FAILURE
Dec 14 13:26:05 T14S systemd[1]: systemd-backlight@backlight:amdgpu_bl0.service: Failed with result 'exit-code'.
Dec 14 13:26:05 T14S systemd[1]: Failed to start Load/Save Screen Backlight Brightness of backlight:amdgpu_bl0.

mdmower@T14S ~ $ sudo systemctl start systemd-backlight@backlight:amdgpu_bl0

mdmower@T14S ~ $ sudo systemctl status systemd-backlight@backlight:amdgpu_bl0
● systemd-backlight@backlight:amdgpu_bl0.service - Load/Save Screen Backlight Brightness of backlight:amdgpu_bl0
     Loaded: loaded (/lib/systemd/system/systemd-backlight@.service; static)
     Active: active (exited) since Tue 2021-12-14 13:26:45 PST; 1s ago
       Docs: man:systemd-backlight@.service(8)
    Process: 5119 ExecStart=/lib/systemd/systemd-backlight load backlight:amdgpu_bl0 (code=exited, status=0/SUCCESS)
   Main PID: 5119 (code=exited, status=0/SUCCESS)
        CPU: 5ms

Dec 14 13:26:45 T14S systemd[1]: Starting Load/Save Screen Backlight Brightness of backlight:amdgpu_bl0...
Dec 14 13:26:45 T14S systemd[1]: Finished Load/Save Screen Backlight Brightness of backlight:amdgpu_bl0.

ProblemType: Bug
DistroRelease: Ubuntu 21.10
Package: xorg 1:7.7+22ubuntu2
ProcVersionSignature: Ubuntu 5.13.0-22.22-generic 5.13.19
Uname: Linux 5.13.0-22-generic x86_64
ApportVersion: 2.20.11-0ubuntu71
Architecture: amd64
BootLog: Error: [Errno 13] Permission denied: '/var/log/boot.log'
CasperMD5CheckResult: pass
CompositorRunning: None
CurrentDesktop: ubuntu:GNOME
Date: Tue Dec 14 13:29:38 2021
DistUpgraded: Fresh install
DistroCodename: impish
DistroVariant: ubuntu
ExtraDebuggingInterest: Yes
GraphicsCard:
 Advanced Micro Devices, Inc. [AMD/ATI] Cezanne [1002:1638] (rev d1) (prog-if 00 [VGA controller])
   Subsystem: Lenovo Cezanne [17aa:5095]
InstallationDate: Installed on 2021-12-12 (2 days ago)
InstallationMedia: Ubuntu 21.10 "Impish Indri" - Release amd64 (20211012)
MachineType: LENOVO 20XF004WUS
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-5.13.0-22-generic root=UUID=859a72cc-a3fe-470f-b525-37b151408289 ro quiet splash vt.handoff=7
SourcePackage: xorg
Symptom: display
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 11/08/2021
dmi.bios.release: 1.14
dmi.bios.vendor: LENOVO
dmi.bios.version: R1NET44W (1.14)
dmi.board.asset.tag: Not Available
dmi.board.name: 20XF004WUS
dmi.board.vendor: LENOVO
dmi.board.version: SDK0J40697 WIN
dmi.chassis.asset.tag: No Asset Information
dmi.chassis.type: 10
dmi.chassis.vendor: LENOVO
dmi.chassis.version: None
dmi.ec.firmware.release: 1.14
dmi.modalias: dmi:bvnLENOVO:bvrR1NET44W(1.14):bd11/08/2021:br1.14:efr1.14:svnLENOVO:pn20XF004WUS:pvrThinkPadT14sGen2a:rvnLENOVO:rn20XF004WUS:rvrSDK0J40697WIN:cvnLENOVO:ct10:cvrNone:skuLENOVO_MT_20XF_BU_Think_FM_ThinkPadT14sGen2a:
dmi.product.family: ThinkPad T14s Gen 2a
dmi.product.name: 20XF004WUS
dmi.product.sku: LENOVO_MT_20XF_BU_Think_FM_ThinkPad T14s Gen 2a
dmi.product.version: ThinkPad T14s Gen 2a
dmi.sys.vendor: LENOVO
version.compiz: compiz N/A
version.libdrm2: libdrm2 2.4.107-8ubuntu1
version.libgl1-mesa-dri: libgl1-mesa-dri 21.2.2-1ubuntu1
version.libgl1-mesa-glx: libgl1-mesa-glx N/A
version.xserver-xorg-core: xserver-xorg-core 2:1.20.13-1ubuntu1
version.xserver-xorg-input-evdev: xserver-xorg-input-evdev N/A
version.xserver-xorg-video-ati: xserver-xorg-video-ati 1:19.1.0-2build1
version.xserver-xorg-video-intel: xserver-xorg-video-intel 2:2.99.917+git20200714-1ubuntu2
version.xserver-xorg-video-nouveau: xserver-xorg-video-nouveau 1:1.0.17-1build1

Revision history for this message
Matthew D. Mower (mdmower) wrote :
Revision history for this message
Matthew D. Mower (mdmower) wrote (last edit ):

EDIT: Workaround ineffective. No longer using.

My crude little workaround to keep trying to start the backlight service until it succeeds (defaults to trying every 100ms):

[Unit]
Description=Restart backlight service

[Service]
Type=simple
Restart=on-failure
ExecStart=systemctl start systemd-backlight@backlight:amdgpu_bl0

[Install]
WantedBy=multi-user.target

affects: ubuntu → xorg (Ubuntu)
affects: xorg (Ubuntu) → linux (Ubuntu)
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote : Status changed to Confirmed

This change was made by a bot.

Changed in linux (Ubuntu):
status: New → Confirmed
Revision history for this message
Matthew D. Mower (mdmower) wrote (last edit ):

I enabled debug logging for systemd with kernel cmdline:
systemd.log_level=debug systemd.log_target=kmsg log_buf_len=1M printk.devkmsg=on

New log attached to bug report is the output of 'journalctl -b': systemd-debug.log

Filtering on "backlight" and omitting systemd-logind, this portion looks interesting to my novice eyes. Does it imply the device loads after systemd-backlight attempts to load the brightness value?

Dec 18 11:03:31 T14S systemd-backlight[1131]: amdgpu_bl0: Maximum brightness is 255
Dec 18 11:03:31 T14S systemd-backlight[1131]: sd-device-enumerator: Scan all dirs
Dec 18 11:03:31 T14S systemd-backlight[1131]: sd-device-enumerator: Scanning /sys/bus
Dec 18 11:03:31 T14S systemd-backlight[1131]: sd-device-enumerator: Scanning /sys/class
Dec 18 11:03:31 T14S systemd-backlight[1131]: Using saved brightness 78.
Dec 18 11:03:31 T14S systemd-backlight[1131]: amdgpu_bl0: Failed to write system 'brightness' attribute: Invalid argument
Dec 18 11:03:31 T14S systemd[1217]: sys-devices-pci0000:00-0000:00:08.1-0000:05:00.0-backlight-amdgpu_bl0.device: Changed dead -> plugged
Dec 18 11:03:31 T14S systemd[1217]: sys-devices-platform-thinkpad_acpi-leds-tpacpi::kbd_backlight.device: Changed dead -> plugged
Dec 18 11:03:37 T14S systemd[3633]: sys-devices-pci0000:00-0000:00:08.1-0000:05:00.0-backlight-amdgpu_bl0.device: Changed dead -> plugged
Dec 18 11:03:37 T14S systemd[3633]: sys-devices-platform-thinkpad_acpi-leds-tpacpi::kbd_backlight.device: Changed dead -> plugged

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

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

Changed in systemd (Ubuntu):
status: New → Confirmed
Revision history for this message
Matthew D. Mower (mdmower) wrote :

I tested some mainline 5.13.x kernels from https://kernel.ubuntu.com/~kernel-ppa/mainline/?C=N;O=D and was able to find a point release where this issue is resolved. Testing results:

Signed Ubuntu kernel 5.13.0-27-generic: brightness adjustments work, but service fails during startup and screen is at full brightness every boot (at gdm and at GNOME 3 desktop)

Unsigned mainline kernels:
- 5.13.19 - fixed, service starts successfully automatically
- 5.13.15 - fixed, service starts successfully automatically
- 5.13.12 - fixed, service starts successfully automatically
- 5.13.11 - fixed, service starts successfully automatically
- 5.13.9 - stuck at max brightness, adjustments don't work at all, service starts successfully but is ineffective
- 5.13.0 - stuck at max brightness, adjustments don't work at all (forgot to check whether service started)

The service I was looking at for status on bootup is: systemd-backlight@backlight:amdgpu_bl0

Revision history for this message
Matthew D. Mower (mdmower) wrote :

I just tested signed Ubuntu kernel 5.13.0-28-generic which is in Proposed right now, but it does not fix the issue. Brightness adjustments work, but service fails during startup and screen is at full brightness every boot (at gdm and at GNOME 3 desktop).

Revision history for this message
Matthew D. Mower (mdmower) wrote :

I compiled several Ubuntu-5.13.0-x.x tags from https://kernel.ubuntu.com/git/ubuntu/ubuntu-impish.git/refs/ but the backlight issue seems to go far back in time. I tested:
- Ubuntu-5.13.0-25.26
- Ubuntu-5.13.0-21.21
- Ubuntu-5.13.0-20.20
- Ubuntu-5.13.0-19.19
- Ubuntu-5.13.0-16.16

In Ubuntu-5.13.0-16.16, there are some 400ish commits by Ubuntu on top of upstream v5.13.13. I haven't been able to identify which could be responsible, yet.

Revision history for this message
Fernando Sclavo (fsclavo) wrote :

Just updated my laptop (Ubuntu 20.04.3 LTS) from 5.13.0-27-generic to 5.13.0-28-generic and have the same issue (stuck in max brightness).
On 5.13.0-27-generic, brightness adjust works fine.

Revision history for this message
Matthew D. Mower (mdmower) wrote :

This issue is no longer present in Ubuntu 22.04. Wile using Ubuntu 21.10, the following workarounds also remedied the issue:
- Run a mainline 5.15.x kernel from https://kernel.ubuntu.com/~kernel-ppa/mainline/?C=N;O=D
- Run the Jammy Jellyfish kernel from https://packages.ubuntu.com/jammy/linux-image-generic
In both cases, it's necessary to install libssl3 from Jammy Jellyfish as well (see https://askubuntu.com/a/1389586/117513).

Ultimately, since Ubuntu 21.10 is rapidly approaching EoL, it makes sense to upgrade to Ubuntu 22.04.

Revision history for this message
Nick Rosbrook (enr0n) wrote :

According to the last comment, this was fixed by upgrading to 22.04.

Changed in systemd (Ubuntu):
status: Confirmed → Invalid
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.