First of, Legion 7 seems to be extremely similar to Legion 5 pro, having only cosmetic differences and RGB-lit keyboard in addition. Most of, if not all of what's written here should apply to Legion 7. This is for the AMD 16ACH6H version, however most of it must apply to bothe AMD and Intel versions.
I successfully installed Gentoo on a Legion 5 pro with AMD Ryzen CPU with integrated Radeon graphics and NVIDIA RTX 30xx video card.
I read there were different WiFi chips, including Intel and Realtek(that might not have been accurate), unfortunately mine turned out to be Mediatek, which has some quirks. There are also problems with secure boot, brightness control, touchpad(that's solved already, read on).
UPDATE: This seems to be relevant to the touchpad. Ignore the language if you don't know it, just follow the configuration.
Otherwise everything's good and the laptop seems to be great for now. There are only minor things I don't like. There's no way to set limits for battery charge start and stop levels. There are out of the tree kernel hwmon modules: Zenmonitor and Zenmonitor3. The later compiles and works. It is a fork of the former. The former doesn't seem to do anything more than causing the kernel to log a line about tainting kernel with out of tree modules. It seems to be unmaintained.
K10temp works but it only outputs Tctl, whatever that temperature is, while zenpower3 outputs two temperatures Tdie and Tctl, and zanmonitor displays temperature plus power plus frequency in addition, the last two are reported per physical core too.
UPDATE: There's something called conservation mode which can be enabled through /sys/bus/platform/drivers/ideapad_acpi/VPC2004\:00/conservation_mode. There are gnome-shell extensions that can be used to do that as well. They only require additional configuration as root, so be careful what you authorize.
UPDATE: Battery life is affected by NVIDIA drivers. It looks like the adapter drains energy and the drivers are capable of stopping that when on battery in hybrid mode. At first I thought it was something in the kernel that changed, but at this moment I just emerged the drivers again and use the laptop on battery and see how the estimation changes in a positive way. You should enable the nvidia hibernation, suspend and resume systemd services as the proprietary drivers need special care when the computer is suspended.
UPDATE: according to another post in the thread, in 5.16 backlight works through nvidia_wmi_ec_backlight driver found in Device Drivers > X86 Platform Specific Device Drivers. I think it's only valid for the Intel version though. It didn't change anything for me, although I didn't try too much. The older drivers up to 495 which is now out of tree worked for me with only the change described above with using the Fn keys.
So how to approach this:
First, disable secure boot. You still need to do it, even if you want to have it configured. One place to look for is Sakaki's guide, but it's unmaintained since October 2020. Do it if you're an adventurous soul or you know what you're doing. I would have tried it had I had enough time to play. I might give it a try if a better moment comes.
Second, set your video to dynamic mode for the brightness control to work. It'll only works under X, so don't bother with it for now. But it remembers it after that. NVIDIA driver needs to be at least 470.82, because brightness control doesn't work out of the box with previous versions.
Many people point out multiple monitors are only possible in discrete mode, because the outputs are wired to the NVIDIA gpu, so make your mind. I don't know how reliable that information is. Those with Intel processors and therefore Intel iGPU say that the output is somehow routed through the iGPU, but I didn't go deeper as I'm not interested in that (for now). Might be the case with radeon iGPU, and if I find out, I might update this thread.
I am currently unable to boot in discrete mode with gentoo-kernel. It might be because of SIMPE_DRM is enabled. I'm not even sure the dGPU kicks in or it's just the AMD GPU working. I will investigate later.
UPDATE: After 5.18.something I think 17, CONFIG_FB_SIMPLE is broken with NVIDIA and after some version of GDM 42 it won't start Gnome in Wayland mode with hybrid graphics because of NVIDIA drivers. That's why I resorted to Arch Wiki's trick to fully power down discrete GPU to aid battery life. Up to this moment the proprietary driver did the power management of the card and without it, the battery life suffers, with it - Wayland doesn't start. This is how I got to know the external video output is routed through the dGPU. At least the HDMI output, but I guess this applies to the UCB-C with display port outputs. So NVIDIA driver must be loaded whenever you want to use external displays.
Then go as normal - download and write/burn an install image, follow the handbook and so on. Be aware that you need to partition your drive with GTP because of the EFI boot environment.
I went straight for systemd as I had already migrated once, so I thought it wouldn't be that hard to do it on my own from scratch and it wasn't. I just followed the systemd wiki and paused somewhere in the configuration part as I figured I needed to emerge the packages first.
For the kernel - go with gentoo-kernel-bin. Why? Just don't waste time playing with your own kernel or at least leave it for when you're all set up. Better get why is that later than earlier.
Regarding the boot, you can use GRUB, easier and more maintainable option in my opinion. If you're sure you will not change kernels often, you can setup the EFI bootloader to boot your kernel directly with efibootmgr. There's some space for improvisation, for example to add a second option for <your old kernel>.old kernel image, but I prefer to deal with grub-mkconfig rather than messing with the efi bootloader options.
Touchpad and brightness control now work out of the box with gentoo-kernel >= 5.15.3. If you run in hybrid graphics mode, than you need to do nothing. It'll work on the amdgpu only though. I still haven't configured a working hybrid mode(fixed, see below). In discrete graphics mode, you need to add the following to /etc/modprobe.d/nvidia.conf:
Code: Select all
# Brightness control
options nvidia \
NVreg_RegistryDwords=EnableBrightnessControl=1
Code: Select all
nvidia.NVreg_RegistryDwords=EnableBrightnessControl=1
UPDATE: you can emerge sys-power/vgaswitcheroo and run applications on the dGPU with drivers version 500, this will work and since the iGPU controls the brightness, you won't have any issue with that.
Sleep under Wayland won't work though. To enable it to work, you need to use systemd's suspend/resume services, which will require the following change in /etc/modprobe.d/nvidia.conf, as described in the commented section:
Code: Select all
# Suspend options. Allocations=0 recommended over =1 unless enable nvidia's
# systemd sleep services (nvidia-hibernate, nvidia-resume, nvidia-suspend).
options nvidia \
NVreg_PreserveVideoMemoryAllocations=1 \
NVreg_TemporaryFilePath=/var/tmp
Sometimes it might happen that Wayland doesn't start and a X session is started instead. In this situation, the touchpad doesn't fully function. You can't tap to click. You need to manually restart GDM. This used to happen with gentoo-kernel(-bin) version 5.15.1. With 5.15.6 I haven't encountered such behavior. It works out of the box.
WiFi is quirky, as I said earlier. First, you need newer kernel (>=5.12, preferably current 5.15 version). It uses 7921 driver. It's very unstable and even doesn't work, until the moment you power up your laptop while unplugged. Then it starts working. That's a workaround I found out on the Internet.
If WiFi doesn't recover after suspend, you need to repeat the above workaround as if the laptop was shutdown. Just unplug it before waking it up. If it doesn't work after a couple of tries, you need to power off and power on the laptop while unplugged. I tried reloading the modules and restarting NetworkManager to no avail.
UPDATE: That might be fixed in 5.17, but please if you can verify that, drop a replay so we know for sure.
If the touchpad doesn't work in the EFI BIOS environment, use this tip I found from Lenovo support on their forums - unplug the laptop and hold the power button pressed for full 60 seconds. When you suspect some hardware is misconfigured and it won't forget this misconfiguration, because you can't unplug the battery, this trick might help.
UPDATE: according to a recent post in this thread, the touchpad might have been disabled by pressing Fn+F10. Try this before anything else. However it might not work until X11/Wayland starts.
You might want to blacklist snd_pcsp and pcpkr modules. They make a really annoying digital beep in the console which cannot be adjusted by volume. Also, the snd_pcsp is buggy and produces really unpleasant noise from time to time.
If you want to configure the radeon graphics video acceleration, follow the AMDGPU page on the Wiki. It gives significantly longer battery life. The NVIDIA driver has no configurable power management at all. Also if you intend to use the iGPU and want a splash screen or animation, blacklist the NVIDIA modules or just don't install them or remove the dist-kernel use flag and don't reemerge them when you upgrade the kernel.
UPDATE: I swapped the Mediatek with Intel AX200 and the packet loss disappeared. However if you have older 802.11 n or ac router, you might want to add this to=/etc/modprobe.d/iwlwifi.conf :
Code: Select all
options iwlmvm power_scheme=1
#some might also need one of those, depending on what standard your router supports and how it acts
#options iwlwifi disable_11ax=Y
#options iwlwifi disable_11ac=Y
#options iwlwifi power_save=0
#options iwlwifi 11n_disable=1
Regards,
Georgi



