Brightness not working Ubuntu 20.04 Lenovo Legion 5 (15IMH05)

For me, I only have acpi_video0 in /sys/class/backlight. The content of the brightness file changes when I try to change the brightness using the fn keys or through the UI, but the actual screen brightness stays the same.
I removed all additional parameters from GRUB.

Is there anything else on this subject? @amrits . I removed that param from startup before to make it even start at all. Before that it was a black screen.

The drivers are installed and working, just nu screen brightness control available.

I have tried everything mentioned in this post, nothing helped. This is a real problem for me because this screen is way to bright to have it running on 100% capacity all of the time. Hopefully this can be solved.

For @amrits as well

I have a Lenovo Legion Y540 which is a precursor to the Legion 5. It’s model 15IRH, has only RTX 2060 Ti graphics (no hybrid in BIOS possible). Couple things I’ve found while troubleshooting.

  • The Legion series was spec’d for primarily Windows gaming and so most likely will not receive any Linux support from Lenovo.
  • The Legion Y540 was an up-spec’d Ideapad; I found this after booting GRUB with the acpi_video=vendor option, which resulted in /sys/class/backlight/ideapad. Using acpi_video=ideapad in GRUB resulted in a hang at boot time; no further troubleshooting was possible.
  • The F5/F6 keys worked in Linux Mint using EnableBrightnessControl=1 but getting there was a struggle, having to boot into compatibility mode first with the Nouveau drivers, then installing NVIDIA, then rebooting, then messing with the 10-nvidia.conf file. I eventually switched to Arch Linux (EndeavourOS) as I could get better troubleshooting info.

After hours of systematic trial-and-error, and hours of frustration, I was able to make the following work. Using kernel 5.10 and NVIDIA 465. All this is done using sudo or other account with root privileges.

First:
Edit etc/default/grub:
Add kernel parameter acpi_video=native
This allows the system to generate the nvidia_0 backlight class.
Run update-grub for Debian systems, grub-mkconfig -o /boot/grub/grub.cfg for Arch systems

Second:
Edit /etc/mkinitcpio.conf:
MODULES="nvidia nvidia_modeset nvidia_uvm nvidia_drm"

Notice that @shashank_96 's edit is missing the nvidia_uvm module.

On Debian, run updateinitramfs -u.

On Arch-based, you need to add hooks for when you rebuild the kernel.
Edit /etc/pacman.d/hooks/nvidia.hook:

[Trigger]
Operation=Install
Operation=Upgrade
Operation=Remove
Type=Package
Target=nvidia
Target=linux

[Action]
Description=Update Nvidia module in initcpio
Depends=mkinitcpio
When=PostTransaction
NeedsTargets
Exec=/bin/sh -c ‘while read -r trg; do case $trg in linux) exit 0; esac; done; /usr/bin/mkinitcpio -P’

Then run mkinitcpio -P

Third and last:

To enable kbd brightness, edit /usr/share/X11/xorg.conf.d/10-nvidia.conf:

Section “OutputClass”
Identifier “nvidia”
MatchDriver “nvidia-drm”
Driver “nvidia”
Option “AllowEmptyInitialConfiguration”
Option “RegistryDwords” “EnableBrightnessControl=1;”
ModulePath “/usr/lib/x86_64-linux-gnu/nvidia/xorg”
EndSection


So this is a lot of hoops to jump through but I was able to get my F5/F6 keys working. Troubleshooting this is a bear because the issues almost always seem to arise at the GRUB/ kernel module level.

One other resource that may help, but I haven’t investigated yet, is in the Manjaro article ACPI Kernel Parameters and how to choose them. If you know which version of Windows your Legion 5 was built for, you may be able to get further along the troubleshooting path than I did using trial-and-error.

thanks for the detailed answer, but at least for me, it’s not working.
I still have acpi_video0 instead of nvidia_0 class in /sys/class/backlight.
Still, I can change the brightness file content but the actual brightness is the same.

1 Like

Well then, here’s my “Troubleshooting Grid.” Maybe there’s a single setting or combination that works on your Legion 5. Also, on some systems it seems the F5/F6 keys aren’t sending the “correct” keycode that the driver is listening for. You then need to remap they keys so they send the correct code.

Some day, all this will be fixed (fingers crossed) For now it’s a royal pain in the you-know-where.

acpi_backlight=video
acpi_backlight=osi (may need to play with the ACPI settings from the Manjaro article)
acpi_backlight=vendor
acpi_backlight=native
acpi_backlight=none

acpi_vendor=video
acpi_vendor=osi
acpi_vendor=vendor
acpi_vendor=native
acpi_vendor=none

1 Like

FINALLY!!! IT WORKS!!!

What works for me is this flag in /etc/default/grub:
nvidia.NVreg_RegistryDwords=EnableBrightnessControl=1

This is my grub file content:

GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=0
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nvidia.NVreg_RegistryDwords=EnableBrightnessControl=1"
GRUB_CMDLINE_LINUX=""

Then of course run: sudo update-grub

Source: https://bugs.launchpad.net/ubuntu/+source/nvidia-graphics-drivers-455/+bug/1905591

My eyes are saved :)

8 Likes

Hi @amrits,
ls /sys/class/backlight gives acpi_video0
inside of it there are:
actual_brightness brightness max_brightness scale type
bl_power device power subsystem uevent

And looking at /sys/class/backlight/nvidia_0/brightness
and /sys/class/backlight/nvidia_0/actual_brightness
both have the correct brightness (and change value when I press F5/F6). But still screen brightness in 100%

3 Likes

WORKED ALSO FOR ME !!
nvidia.NVreg_RegistryDwords=EnableBrightnessControl=1
Thank you for this solution found in the deepest forum

Still not working for me…

2 Likes

nvidia.NVreg_RegistryDwords=EnableBrightnessControl=1 works for me!

The /etc/default/grub file.

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nvidia.NVreg_RegistryDwords=EnableBrightnessControl=1"
sudo update-grub

But I have set ‘Discrete graphic’ in BIOS Settings. I haven’t other changes of a clear system, only grub and BIOS.

Without this configuration it didn’t work for me. Also I had limited settings for NVIDIA settings when I had Security Boot Enable. When I had Security Boot - Disabled I had more settings, but I hadn’t display configuration.

When I have updated BIOS settings and Grub I have got worked brightness.

My laptop is Lenovo Legion 5 Gen 6 (NVIDIA + Intel graphics):

  • NVIDIA Corporation GA107BM [GeForce RTX 3050 Ti Mobile]
  • 11th Gen Intel(R) Core™ i7-11800H
    NVIDIA driver 470.82.00 from Ubuntu Additional drivers.
2 Likes

Hi, I have same promblem on Lenovo legion 5. This is the command output in my case:
david@david:~$ ls /sys/class/backlight
acpi_video0

acpi_video0 is a directory with content:
david@david:~$ ls /sys/class/backlight/acpi_video0
actual_brightness bl_power brightness device max_brightness power scale subsystem type uevent

Had to create an account to thank you!! I’m searching for hours and this works.

I edited the grub file, set discrete graphic and set security boot on disabled.

My specs:
Lenovo Legion 5 15ITH6H
11th Gen Intel® Core™ i7-11800H @ 2.30GHz × 16
NVIDIA Corporation GA104M [GeForce RTX 3070 Mobile / Max-Q]
NVIDIA driver 470.86
Ubuntu 21.10

Hope this helps, cheers!

1 Like

Thank You, i have been using a script for changing the brightness with xrandr but i finally can have piece of mind.

Hello @amrits , on my machine there are 2 directories under /sys/class/backlight: amdgpu_bl0 and nvidia_0. The interesting thing is that the keyboard buttons and the brightness slider do change the values of the brightness in /nvidia_0, but this doesn’t affect the brightness of the screen. Instead, when I manually change the brightness values in /amdgpu_bl0, the brightness of the screen changes! What do you think about this?

1 Like

@maxpav
Please share bug report and acpi dump from the failing systems.

It worked after changing nvidia driver to 470 !!!

Thank you for your suggestion

I can confirm, that

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nvidia.NVreg_RegistryDwords=EnableBrightnessControl=1"

on Ubuntu 22.04 and GeForce RTX 3600 mobile with the 470.XX.XX driver works on a Legion 7 (2021) (16ACHg6) for controlling the backlight - while it does not with 515.XX or 520.56.06 (with 520.56.06 there is even one more regression: the backlight is completely off after sleep - so the display is basically off. As you cannot control it, you have to force-reboot…).

There are some ACPI errors regarding backlight:

[    5.911249] ACPI BIOS Error (bug): Could not resolve symbol [\_SB.PCI0.GP17.VGA.LCD._BCM.AFN7], AE_NOT_FOUND (20211217/psargs-330)
[    5.911350]  Initialized Local Variables for Method [_BCM]:
[    5.911350]   Local0: 0000000013343bf7 <Obj>           Integer 00000000000000FF
[    5.911354]   Local1: 000000002274e16a <Obj>           Integer 0000000000000000
[    5.911357] Initialized Arguments for Method [_BCM]:  (1 arguments defined for method invocation)
[    5.911358]   Arg0:   00000000510381c2 <Obj>           Integer 0000000000000064
[    5.911363] ACPI Error: Aborting method \_SB.PCI0.GP17.VGA.LCD._BCM due to previous error (AE_NOT_FOUND) (20211217/psparse-529)
[    5.911494] ACPI: \_SB_.PCI0.GP17.VGA_.LCD_: _BCM evaluation failed

Interestingly: on a Legion 5 (2021) (15ACH6H) with otherwise the same software setup and BIOS revision (gkcn57ww), the backlight control works with 515.XX (didn’t test with 520).

In both cases the graphics are set to “discrete” mode, so the NVIDIA card is the only one in the system.

2 Likes

Ok, I created an account just to reply.
after reading, I noticed that the screen is still controlled by intel graphics if you didn’t set you laptop to discrete mode
I didn’t want to change, because I want to have the possibility of being hybrid.
So I found what I needed to change to be able to change the brightness.

vim /sys/class/backlight/intel_backlight/brightness

The value when screen is on maximum is 512, so 50% is 256, 25% is 128 and so on.
I’m still a noob with linux, so I still don’t know who to reroute the brightness button to change this value.
But at least now you know where to change it.

After trying everything else what finally worked for me was using the 470 driver from additional drivers after setting the grub flag as in your comment! Thank you so much for sharing your setup details, bud!

Edit: My machine is a Lenovo 82JQ00H4AX Legion 5 Pro 16ACH6H(AMD Ryzen 7 5800H + RTX 3070 Max-Q) running Ubuntu 22.04.1 LTS.