Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save VV0JC13CH/ff9c19325650b5f88c611653b6d3698e to your computer and use it in GitHub Desktop.
Save VV0JC13CH/ff9c19325650b5f88c611653b6d3698e to your computer and use it in GitHub Desktop.

This is a collection of Ubuntu fixes for Lenovo Legion 5i

Tested on: Lenovo Legion 5i with below specs:
AMD® Ryzen 7 4800h with radeon graphics × 16
NVIDIA Corporation / NVIDIA GeForce RTX 2060/PCIe/SSE2

1. GPU ISSUES for RTX 2060:

nvidia-driver-470 - HDMI doesn't have to work from the beginning
nvidia-driver-495 - HDMI works from the beginning, unstable (random reboots)
recommended way to install nvidia drivers:
sudo ubuntu-drivers autoinstall

1.1 How to fix external display (HDMI) - no signal

sudo prime-select nvidia
reboot

1.2 How to fix brightness control

sudo nano /etc/default/grub

1.2.1 BIOS in switchable mode:

Add video.use_native_backlight=1 to GRUB_CMDLINE_LINUX_DEFAULT like below:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash video.use_native_backlight=1"

sudo update-grub2
reboot

1.2.2 BIOS in descrete mode:

Replace content of GRUB_CMDLINE_LINUX_DEFAULT with nvidia-drm.modeset=1 acpi_backlight=native nvidia.NVreg_RegistryDwords=EnableBrightnessControl=1, like below:

GRUB_CMDLINE_LINUX="nvidia-drm.modeset=1 acpi_backlight=native nvidia.NVreg_RegistryDwords=EnableBrightnessControl=1"

sudo update-grub2
reboot

1.3 Fix backlight error logs during boot

Example: systemd-backlight[897]: Failed to get backlight or LED device 'backlight:acpi_video1': No such device Edit service file: sudo nano /lib/systemd/system/systemd-backlight@.service Replace content with:

[Unit]
Description=Set lower brightness on startup
After=systemd-backlight@backlight:amdgpu_bl0.service

[Service]
Type=oneshot
ExecStart=/bin/bash -c 'echo 25 > /sys/class/backlight/amdgpu_bl0/brightness'
ExecStart=systemctl start --now systemd-backlight@backlight:amdgpu_bl0

[Install]
WantedBy=systemd-backlight@backlight:amdgpu_bl0.service
WantedBy=multi-user.target

1.4 Fix amdgpu: Unsupported power profile mode 0

to-do (I don't know how to fix it currently, but doesn't look critical)

2. BIOS oriented issues:

2.1 Fix "Integrity: problem loading X.509 certificate -65"

1. Go to bios during boot by pressing F2
2: Disable the Secure Boot in bios
3: Reset Setup Mode ( this function is in Bios )
4: Launch Ubuntu
5: Enable the Secure Boot in bios

Sources:
https://askubuntu.com/a/1378613 (author: Pierre)
https://forums.developer.nvidia.com/t/ubuntu-doesnt-detect-my-second-hdmi-display/75076/62?page=4
https://www.linux.org/threads/failed-to-start-load-save-screen-backlight-brightness-of-amdgpu_bl1.31998/
https://itectec.com/ubuntu/ubuntu-integrity-problem-loading-x-509-certificate-65-before-login/

@mhosnyessa
Copy link

got a solution for black screen after waking up from "systemctl suspend".
and also the system is not detecting wifi adapter at all

@VV0JC13CH
Copy link
Author

VV0JC13CH commented Jun 23, 2022

got a solution for black screen after waking up from "systemctl suspend". and also the system is not detecting wifi adapter at all

I switched to Pop!_OS and since then I have no issues with Legion Lenovo at all. As I remember issue with black screen was related to specific kernel version. Its hard for me to verify this currently.

Few months ago my laptop was restarting randomly and it was diagnosed that integrated wi-fi was broken. Lenovo replaced my motherboard and there are no issues since then. By adapter you mean usb adapter or integrated network card?

@dantheperson
Copy link

This worked great on 20.04, but i can't get the backlight controls to work with discrete graphics on 22.04. Real killer is that the backlight does not come back on after sleep.

@lucas-veiga
Copy link

lucas-veiga commented Nov 23, 2022

this fix for external display hdmi - no signal didn't work for me...
the external display is never shown when using nvidia, only using x.org x server - nouveau display driver from xserver-xorg-video-nouveau it works 😞

will probably switch to PopOS soon

@fljlk
Copy link

fljlk commented Mar 20, 2023

The fix for external display coming from Nvidia forum https://forums.developer.nvidia.com/t/hanging-on-black-screen-after-sleep-hibernates-on-legion-5-15iah7h-nvidia-rtx-3070-laptop/246451/7

is to download the firmware from intel and install it manually with the script provided inside the archive :
https://packages.ubuntu.com/en/source/lunar/firmware-sof

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment