3

My laptop seems to be on max brightness and the brightness control slider/Fn keys have no effect on the screen brightness except showing a pop-up notification of the slider. This problem isn't really new to the legion series (or some other laptops) but unlike other (old) legion 5 laptops, none of the potential solutions worked for me for Ubuntu 20.04.2. There are solutions for the exact same laptop on a different variant of Ubuntu and Manjaro but that still doesn't work on normal Ubuntu 20.04 which is why it is a bit confusing.

So my laptop's configuration is AMD 5800H + Nvidia RTX3070. I am currently on mainline kernel 5.10.0-051000-generic with ubuntu 20.04.2. I have added the Nvidia graphics PPA and currently on driver v460.67. I am on dGPU mode (graphics card directly connected to screen). This the conf location:

 /usr/share/X11/xorg.conf.d$ ll
total 36
drwxr-xr-x 2 root root 4096 Apr  6 21:34 ./
drwxr-xr-x 5 root root 4096 Feb  9 19:50 ../
-rw-r--r-- 1 root root   92 Okt 22  2019 10-amdgpu.conf
-rw-r--r-- 1 root root  239 Apr  6 20:34 10-nvidia-brightness.conf
-rw-r--r-- 1 root root  206 Apr  6 21:34 10-nvidia.conf
-rw-r--r-- 1 root root 1350 Jan 17 10:13 10-quirks.conf
-rw-r--r-- 1 root root   92 Okt 22  2019 10-radeon.conf
-rw-r--r-- 1 root root 1429 Aug 13  2019 40-libinput.conf
-rw-r--r-- 1 root root 3458 Mär 11  2020 70-wacom.conf

Here are the output of relevant files:

/usr/share/X11/xorg.conf.d$ cat 10-nvidia-brightness.conf 
Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce RTX 3070 Laptop GPU"
    Option         "RegistryDwords" "EnableBrightnessControl=1"
EndSection

/usr/share/X11/xorg.conf.d$ cat 10-nvidia.conf 
Section "OutputClass"
    Identifier "nvidia"
    MatchDriver "nvidia-drm"
    Driver "nvidia"
    Option "AllowEmptyInitialConfiguration"
    ModulePath "/usr/lib/x86_64-linux-gnu/nvidia/xorg"
EndSection

Note: Even for 10-nvidia.conf, I have tried the Option "RegistryDwords" "EnableBrightnessControl=1" but still no results.

I have blacklisted nouveau drivers:

cat /etc/modprobe.d/blacklist-nvidia-nouveau.conf 
blacklist nouveau
options nouveau modeset=0

And also added the below so that Nvidia drivers load first:

cat /etc/initramfs-tools/modules
# List of modules that you want to include in your initramfs.
# They will be loaded at boot time in the order below.
#
# Syntax:  module_name [args ...]
#
# You must run update-initramfs(8) to effect this change.
#
# Examples:
#
# raid1
# sd_mod

# Other settings...
nvidia
nvidia-drm
nvidia-modeset

I have tried to add parameters to the grub such as acpi_backlight=vendor, acpi_backlight=video, acpi_backlight=none, acpi_backlight=native, video.use_native_backlight=1 but none of them work.

So here are few relevant outputs if someone requires it:

sudo lshw -C display
  *-display                 
       description: VGA compatible controller
       product: NVIDIA Corporation
       vendor: NVIDIA Corporation
       physical id: 0
       bus info: pci@0000:01:00.0
       version: a1
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress vga_controller bus_master cap_list rom
       configuration: driver=nvidia latency=0
       resources: iomemory:fa0-f9f iomemory:fc0-fbf irq:76 memory:d0000000-d0ffffff memory:fa00000000-fbffffffff memory:fc00000000-fc01ffffff ioport:2000(size=128) memory:d1080000-d10fffff

lspci | grep -i vga
01:00.0 VGA compatible controller: NVIDIA Corporation Device 24dd (rev a1)

There is also a bug https://bugs.launchpad.net/ubuntu/+source/nvidia-graphics-drivers-455/+bug/1905591 in the driver which caused people with different laptops to have similar problems but for some, their problem was solved by adding modules to /etc/initramfs-tools/modules but for some it is still not solved. Now here is another thing, I have seen two reports with the same laptop as me mention that it is working for them by following a few combinations of the above-mentioned steps:

  1. This guy uses Regolith Linux 1.5.3 https://www.reddit.com/r/GamingLaptops/comments/ls9k5r/legion_5_pro_other_info_64gb_ram_upgrade_linux/

  2. This guy uses Manjaro https://www.reddit.com/r/LenovoLegion/comments/miqbv4/lenovo_legion_5_pro_actual_linux_experience_and/

I have also tried Kernel 5.11.11 but still, it doesn't work and one final thing, changing the slider or pressing the buttons changes the value of the file /sys/class/backlight/nvidia_0/brightness the other two files always show this :

cat actual_brightness
0
cat max_brightness 
100

So this is everything I have tried and tested. If anyone has any new ideas or pointers regarding this issue, I would be really grateful to know that.

One final thing, I am currently using xrandr --output DP-4 --brightness 0.5 to save my eyes right now. Would be helpful if someone could comment if this would be helpful to reduce (in any way) the strain on the backlight of the screen on the hardware level, since it is normally at max brightness.

1

I have the same Legion and for the moment I managed to control the brightness following this guide (many thanks to u/fkorol, I am using kernel 5.11.16): https://www.reddit.com/r/linux_gaming/comments/mmptqi/lenovo_legion_5_ubuntu_2004_final_guide_dream/

I report here the main part of what is written in the link above in case it will disappear:

First step: In the BIOS (F2 at lenovo screen) must set to HYBRID mode.

1- Install the mainline software to upgrade the kernel version to the latest 5.11.x version:

sudo add-apt-repository ppa:cappelikan/ppa

sudo apt update

sudo apt install mainline

Then open mainline and install the latest availible (5.11.11 at the time of write this post).

Reboot the laptop

2- with 5.11.11 or newer, edit grub and add the entry amdgpu.backlight=0

sudo nano /etc/default/grub

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash amdgpu.backlight=0"

sudo update-grub

Reboot the laptop again

That all!, with 5.11 the touchpad works natively, and with this tweak to the grub the brightness work perfectly in hybrid mode.

and I add few more notes:

  • use always "dynamic" mode in the BIOS settings

  • between point 1) and 2) you can install nvidia-drivers-460

  • if you install the nvidia drivers, after the installation you should launch:

    sudo prime-select on-demand

  • In this status your computer will use the iGPU for all the activities. If you want to use the dGPU for a task, you can define before the command these variables __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia

So for example you can launch glxheads command on dGPU with:

__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia glxheads
0

Faced the same problem. I tried many different ways, but personally helped me roll back the Nvidia driver from 460 to 450. I hope it will help you too.

1
  • Thanks for the answer but I believe that rtx 3070 support arrived with 460, so I can't go back. – paulplusx Apr 18 at 9:00
0

Just managed to make it work after 5 hours trying on my legion 5 pro (5600H, RTX3060, reference 82JQ002KCK).

Adding this line in my xorg.conf, Device section seem to work : Option "RegistryDwords" "EnableBrightnessControl=1"

BUT I have to log out and log in again, or relaunch lightdm / X server for it to work : just after boot, brightness control does not work (the interface works but screen backlight stays at 100%).

My config is latest Mint (based on Ubuntu 20.4) with 5.11 Kernel (installed with mainline, Mint comes with 5.4), Nvidia drivers 460, Secure boot disabled, Bios set to Discrete (Dynamic doesn't work, black screen).

I created the /etc/X11/xorg.conf automatically with the Nvidia driver interface, as the file wasn't there.

Not entirely sure of how and why this works, but spent too much time already, hope it helps. Maybe it works on 5.10, I may try and report back.

1
  • Thank you for your answer and I followed the same steps but it didn't work for me on Ubuntu 20.04 (Kernel 5.11.16). – paulplusx Apr 22 at 20:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.