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.
Add kernel parameter
This allows the system to generate the nvidia_0 backlight class.
update-grub for Debian systems,
grub-mkconfig -o /boot/grub/grub.cfg for Arch systems
MODULES="nvidia nvidia_modeset nvidia_uvm nvidia_drm"
Notice that @shashank_96 's edit is missing the
On Debian, run
On Arch-based, you need to add hooks for when you rebuild the kernel.
Description=Update Nvidia module in initcpio
Exec=/bin/sh -c ‘while read -r trg; do case $trg in linux) exit 0; esac; done; /usr/bin/mkinitcpio -P’
Third and last:
To enable kbd brightness, edit /usr/share/X11/xorg.conf.d/10-nvidia.conf:
Option “RegistryDwords” “EnableBrightnessControl=1;”
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.