Ubuntu – Brightness control keys don’t work on Lenovo Y540 but xrandr does

brightnessdriverslenovonvidia

I recently bought a Lenovo Legion Y540, and most options work except for the brightness control keys, the computer starts with 100% brightness and the keys (F5 and F6) seemingly do nothing, the brightness pop-up also does not show up. I have found that the following command seems to work
xrandr --output DP-4 --brightness 0.6 to lower the brightness.
I tried setting GRUB_CMDLINE_LINUX="acpi_backlight=vendor" in the GRUB settings but that did not help things either. I did the installation with nouveau.modeset=0 and I do remember the keys to be working. Its after installing nvidia drivers that this problem seems to have risen (not absolutely sure). Any help would be appreciated.

Best Answer

I have This Issue with Lenovo Y540 that comes with NVIDIA GeForce GTX 1660Ti Graphics Card

Ubuntu version: 19.10

Also, I have upgraded to version 20.04 and working fine

you need to edit or create this file

sudo nano /usr/share/X11/xorg.conf.d/10-nvidia.conf

and add this line

Option "RegistryDwords" "EnableBrightnessControl=1;"

after this line Option "AllowEmptyInitialConfiguration"

so the file 10-nvidia.conf will look like this:

Section "OutputClass"
    Identifier "nvidia"
    MatchDriver "nvidia-drm"
    Driver "nvidia"
    Option "AllowEmptyInitialConfiguration"
    Option "RegistryDwords" "EnableBrightnessControl=1;"  # Line need to be added
    ModulePath "/usr/lib/x86_64-linux-gnu/nvidia/xorg"
EndSection

and save the restart your laptop

and the brightness control keys will work