Laptop backlight control regression with 465.24.02

see post #28 how to change the brightness if backlight control is not working, that’s what I’m using currently to lower the screen brightness.

use “xrandr” to see what output is connected.

I can confirm that this backlight brightness bug has been fixed at long last with the latest beta driver 510.39.01. Tested on up-to-date Arch Linux with beta driver 510.39.01 from AUR repository on Lenovo Legion 5 Pro 16ACH6H (AMD) laptop with RTX 3070 card in discrete mode, of course.
There was no need for any module parameters. The only bug remaining is that the backlight does not get restored at new boot, so a custom systemd unit and a local script are still needed.
The fix below has also been successully tested on the same machine, running Debian GNU/Linux 11 (bullseye) which comes with 460.91.03 (unaffected) version of NVIDIA driver. The only difference is that the custom script “save-nvidia-brightness.sh” was saved to /etc/init.d folder which is present on said Debian release.

sudo nano /usr/local/bin/save-nvidia-brightness.sh

#!/bin/bash
# Saves nvidia brightness settings on reboot/shutdown
cat /sys/class/backlight/nvidia_0/actual_brightness | /usr/lib/systemd/systemd-backlight save backlight:nvidia_0

sudo chmod +x /usr/local/bin/save-nvidia-brightness.sh

sudo nano /lib/systemd/system/save-nvidia-brightness.service

[Unit]
Description=Save nvidia brightness
DefaultDependencies=no
Before=shutdown.target reboot.target halt.target

[Service]
Type=oneshot
ExecStart=/usr/local/bin/save-nvidia-brightness.sh

[Install]
WantedBy=halt.target reboot.target shutdown.target

systemctl enable save-nvidia-brightness

After adjusting brightness level to your liking, check by rebooting your machine and verifing that the brightness level has been restored.

Reference:
http://dalvikplanet.blogspot.com/2019/08/save-current-screen-brightness-before.html

Thank you! I am using the very same laptop and can confirm 510.39.01 fixed this issue. EnableBrightnessControl=1 is not needed as well.

I got a solution for my device: Putting i915 into /etc/initramfs-tools/modules and run sudo update-initramfs -u fixes the issue.

Ubuntu only ofc. But other distros should have similar ways to add a module to initramfs for early kms.

Found an alernative maybe better solution for my situation:

Create a file /etc/modprobe.d/random-name-here.conf with content:

softdep nvidia pre: i915

Making sure that the intel driver gets initialized before the nvidia driver. (Also establishes a dependency relation as a sideeffect so should not be set on amd devices)

I confirm that the brightness issue has been solved by installing nvidia-driver-510 from https://launchpad.net/~graphics-drivers/+archive/ubuntu/ppa for my Lenovo Legion Y7 laptop, known as Y9000K in mainland China.

However, the problem where the sound disappears when waking up from suspension is still present.
System:
Host: jizong-Legion Kernel: 5.16.4-051604-generic x86_64 bits: 64
Desktop: GNOME 40.5 Distro: Ubuntu 21.10 (Impish Indri)
Graphics:
Device-1: NVIDIA GA104M [GeForce RTX 3080 Mobile / Max-Q 8GB/16GB]
driver: nvidia v: 510.47.03
Device-2: Acer Integrated Camera type: USB driver: uvcvideo
Display: x11 server: X.Org 1.20.13 driver: loaded: nvidia
unloaded: fbdev,modesetting,nouveau,vesa resolution: 1: 3840x2160~60Hz
2: 4096x2560
OpenGL: renderer: NVIDIA GeForce RTX 3080 Laptop GPU/PCIe/SSE2
v: 4.6.0 NVIDIA 510.47.03

Hello everyone. Found a solution in the form of a GNOME extension!

https://extensions.gnome.org/extension/1625/soft-brightness/
My hardware is
RAM 31.3 GiB
ASUSTeK COMPUTER INC. G752VSK
Intel® Core™ i7-7700HQ CPU @ 2.80GHz × 8 ( no
intel graphics)
NVIDIA GeForce GTX 1070/PCIe/SSE2
inxi -G youswer@no1
Graphics:
Device-1: NVIDIA GP104BM [GeForce GTX 1070 Mobile] driver: nvidia
v:510.47.03
Device-2: 04081-0009510016501004991 USB2.0 HD UVC WebCam type: USB
driver: uvcvideo
Display: x11 server: X.org 1.21.1.3 driver: loaded: nvidia
resolution: <missing: xdpyinfo>
OpenGL: renderer: NVIDIA GeForce GTX 1070/PCIe/SSE2
v:4.6.0 NVIDIA 510.47.03

               -`youswer@no1
              .o+`-----------
             `ooo/ OS: Arch Linux x86_64
            `+oooo: Host: G752VSK 1.0
           `+oooooo: Kernel: 5.16.5-zen1-1-zen
           -+oooooo+: Uptime: 20 hours, 19 mins
         `/:-:++oooo+: Packages: 855 (pacman)
        `/++++/++++++++: Shell: zsh 5.8
       `/++++++++++++++: Resolution: 1920x1080
      `/+++ooooooooooooo/` DE: GNOME 41.3
     ./ooosssso++osssssso+` WM: Mutter
    .oossssso-````/ossssss+` WM Theme: Mojave-dark-alt
   -osssssso. :sssssso. Theme: Mojave-dark-alt [GTK2/3]
  :osssssss/ osssso+++. Icons: Colloid-dark [GTK2/3]
 /ossssssss/ +ssssooo/- Terminal: gnome-terminal

/ossssso+/:- -:/+osssso+- CPU: Intel i7-7700HQ (8) @ 3.800GHz +sso+:- .-/+oso: GPU: NVIDIA GeForce GTX 1070 Mobile
++:. -/+/ Memory: 2037MiB / 32055MiB

ls /sys/class/backlight/ youswer@no1
nvidia_0
No difference.
~ » ls /sys/class/backlight/ youswer@no1
acpi_video0

Works fine! And no needed options in Xorg.conf : “RegistryDwords” “EnableBrightnessControl=1”
and more.

That extension may be useful in the future, but now I can also confirm, that driver 510 works fine with my computer.

1 Like

Without this extension my laptop can’t adjust the brightness.
What I just didn’t do.

How do you actually change the brightness on your device?

Until driver 495 I would simply use echo 80 > sudo tee /sys/class/backlight/nvidia_0/brightness along with nvidia.NVreg_RegistryDwords=EnableBrightnessControl=1 in my kernel parameters, but after updating to driver 510, I can no longer change the brightness, even after removing the kernel param. Any tips?

Device is Legion 7 16ACHg6.

Output of lsmod:

nvidia_drm             73728  9
nvidia_uvm           2625536  0
nvidia_modeset       1163264  16 nvidia_drm
nvidia              39129088  785 nvidia_uvm,nvidia_modeset
nvidia_wmi_ec_backlight    16384  0
wmi                    40960  3 nvidia_wmi_ec_backlight,wmi_bmof,ideapad_laptop

Output of dmesg:

sudo dmesg | grep nvidia
[sudo] password for nick:
[    1.535952] nvidia: module license 'NVIDIA' taints kernel.
[    1.559884] nvidia-nvlink: Nvlink Core is being initialized, major device number 511
[    1.573026] nvidia 0000:01:00.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=none:owns=none
[    1.674936] nvidia_uvm: module uses symbols from proprietary module nvidia, inheriting taint.
[    1.675305] nvidia-modeset: Loading NVIDIA Kernel Mode Setting Driver for UNIX platforms  510.47.03  Mon Jan 24 22:51:43 UTC 2022
[    1.682014] [drm] [nvidia-drm] [GPU ID 0x00000100] Loading driver
[    1.682016] [drm] Initialized nvidia-drm 0.0.0 20160202 for 0000:01:00.0 on minor 0
[    1.692043] nvidia-uvm: Loaded the UVM driver, major device number 508.

Alienware Area-51m R2 1.10.0 here, with NVIDIA GeForce RTX 2080 SUPER Mobile / Max-Q. Nothing but xrandr works for setting the brightness after drivers > 460… What a pity! Tested on Debian, Ubuntu, Arch, Gentoo.

Lenovo Legion 5 pro, RTX3070M, driver version 510.54-1, kernel version 5.16.9. Still no luck.

I have Legion 7 16ACHg6, kernel 5.13.0 (from Ubuntu 21.10), Nvidia driver 510.47.03 and brightness control is working for me. I’am not using hybrid mode.

Some kernel parameters remained from previous experiments in my system, however, maybe they will help:

amdgpu.backlight=0 nvidia-drm.modeset=1 nvidia.NVreg_RegistryDwords=EnableBrightnessControl=1

1 Like

Does pressing the brightness keys just work? If so, what DE are you using?

I am running nvidia-510.54-2 with kernel 5.17-rc4 on Arch and neither xbacklight nor echo 50 | sudo tee /sys/class/backlight/nvidia_0/brightness work…

Yes, it works simply by pressing brightness keys.

Please can you all stop telling brightness works, yes we all know brightness works, what doesn’t work is backlight control. So please stop telling it works, its up to NVIDIA to tell us why they have removed the backlight handler in the sofware, thanks.

2 Likes

Legion R9000P 2021 laptop with RTX 3060 (Legion 7 China version)
backlight control still not work in discrete mode

System:
Kernel: 5.16.12-arch1-1 x86_64 bits: 64 compiler: gcc v: 11.2.0
parameters: initrd=\amd-ucode.img initrd=\initramfs-linux.img
root=“LABEL=system” rootflags=subvol=root rw acpi_backlight=vendor
amdgpu.backlight=0 nvidia-drm.modeset=0
Desktop: GNOME 41.4 tk: GTK 3.24.33 wm: gnome-shell dm: GDM 41.3
Distro: Arch Linux
Machine:
Type: Laptop System: LENOVO product: 82JQ v: Lenovo Legion R9000P2021H
serial: Chassis: type: 10 v: Lenovo Legion R9000P2021H
Mobo: LENOVO model: LNVNB161216 v: SDK0L77769 WIN
serial: UEFI: LENOVO v: GKCN49WW date: 11/08/2021
CPU:
Info: model: AMD Ryzen 7 5800H with Radeon Graphics bits: 64 type: MT MCP
arch: Zen 3 family: 0x19 (25) model-id: 0x50 (80) stepping: 0
microcode: 0xA50000C
Graphics:
Device-1: NVIDIA GA106M [GeForce RTX 3060 Mobile / Max-Q] vendor: Lenovo
driver: nvidia v: 510.54
bus-ID: 01:00.0 chip-ID: 10de:2560 class-ID: 0300
Display: x11 server: X.Org v: 1.21.1.3
OpenGL: renderer: NVIDIA GeForce RTX 3060 Laptop GPU/PCIe/SSE2
v: 4.6.0 NVIDIA 510.54 direct render: Yes

Same problem here.
Asus GL502VS laptop with GTX 1070, no intel graphics.
backlight control still not work.

System Information:
Manufacturer: ASUSTeK COMPUTER INC.
Product Name: GL502VS

Build Operating System: 5.15.6-200.fc35.x86_64
Current Operating System: Linux fedora 5.16.13-200.fc35.x86_64 #1 SMP PREEMPT Tue Mar 8 22:50:58 UTC 2022 x86_64
Kernel command line: BOOT_IMAGE=(hd1,gpt2)/vmlinuz-5.16.13-200.fc35.x86_64 root=UUID=adb5a87c-e9da-4c3e-96d3-c1d94caf7fbf ro rootflags=subvol=root rd.driver.blacklist=nouveau modprobe.blacklist=nouveau nvidia-drm.modeset=1 rhgb quiet acpi_backlight=vendor

DE:
KDE Plasma 5.24.2
KDE Framework 5.91.0

Build ID: xorg-x11-server 1.20.14-3.fc35
Current version of pixman: 0.40.0

NVIDIA GLX Module 510.47.03 Mon Jan 24 22:57:16 UTC 2022
NVIDIA GPU NVIDIA GeForce GTX 1070 (GP104-B) at PCI:1:0:0
Memory: 8388608 kBytes
NVIDIA(0): VideoBIOS: 86.04.42.00.07
‘OpenGLVersion’ (fedora:0.0): 4.6.0 NVIDIA 510.47.03
nvidia-bug-report.log.gz (104.1 KB)

can confirm.

Legion 5 Pro, Ubuntu 22.04,

Nvidia 510, Discrete mode. Zero brightness control.

Nvidia 510, Hybrid mode, AMDGPU based brightness control.

Nvidia 470, Discrete mode. ACPI nvidia_0 based brightness control.

Nvidia 470, Hybrid mode, AMDGPU based brightness control.

Seems version 510 has a regression in backlight control.

I can confirm for Lenovo Thinkpad (P15/P17/T15g/T15p/P15v Gen 1) that backlight control is working now since the last BIOS update Version 1.28

below excerpt from the readme file:


CHANGES IN THIS RELEASE
Version 1.28

[Important updates]

  • Update includes a security fix.

[New functions or enhancements]

  • Updated the Diagnostics module to version 04.22.000.
  • Update Regulatory Information.

[Problem fixes]

  • Fixed an issue where Power-On Password is set by WMI even if Power-On
    Password Control was disabled.
  • Fixed an issue where Linux adjust brightness fail in discrete mode.