Ubuntu 20.04 Lenovo IdeaPad 5 Ryzen 4800u Display Brightness not working

I cannot get changing the display brightness to work. I have a Lenovo IdeaPad 5 with AMD Ryzen 4800u CPU and integrated Vega graphics.

I tried the following solutions: Grub property acpi_backlight, xbacklight, changing backlight directly in /sys/class/backlight/..., xgamma, xrandr, gdbus and setpci.

I followed instructions on these answers, but none of them worked:

  • How do I set default display brightness?
  • How do I decrease the display brightness an Acer 5830TG?
  • Display brightness cannot be adjusted 18.04
  • How to change LCD brightness from command line (or via script)? script

I can see, that values for e.g. xrandr or xgamma or backlight are set, but they have no effect on the notebooks display.

I guess that it has something to do with AMD drivers but I don't know...

Now I don't know in wich direction to search further. Maybe it's a driver or kernel thingy.

So, can anyone help? :)


Solution 1:

The issue is related to the Renoir graphics in AMD 4000 series processors. Here is a Phoronix article that gives a short description of it. Starting from Linux kernel 5.5, Renoir support was marked as no longer experimental. Kernel 5.7 is the newest kernel, so updating to that provides support for your processor.

I have a laptop with a 4500U. Upgrading to 5.7 helped fix every issue besides the brightness control.

The following steps to install the kernel comes from this answer which is a general version of an ubuntuforums.org post from user lykwydchykyn. The following steps contain some additions that I found useful when installing the kernel:

  1. Go here (sorted by most recent build): https://kernel.ubuntu.com/~kernel-ppa/mainline/?C=N;O=D

  2. Select the build you want, then navigate to the amd64/ directory.

  3. Download 3 (maybe 4) debs to a folder somewhere:

     linux-headers-VERSION-NUMBER_all.deb
     linux-headers-VERSION-NUMBER_amd64.deb
     linux-image-VERSION-NUMBER_amd64.deb
     linux-image-extra-VERSION-NUMBER_amd64.deb    # if available
    
  4. Install the debs with whatever package manager front-end you use, or use these commands:

     cd /path/to/folder/where/you/put/the/debs
     sudo dpkg -i *.deb
    

An additional resource is the Ubuntu wiki which explains how to install an upstream kernel with generic instructions. This is good for learning that you choose either the generic kernel or the lowlatency kernel and don't download all of them (like I did at first): https://wiki.ubuntu.com/Kernel/MainlineBuilds

Solution 2:

I use kernel 5.7.1 on this notebook and display brightness is adjustable. Look at https://wiki.ubuntu.com/Kernel/MainlineBuilds for instructions.

Solution 3:

As mentioned in answers above, you have to update your kernel version to some newer one. I found very handy and free tool - https://github.com/bkw777/mainline

Solution 4:

I also have this problem on a Lenovo ThinkPad T14, AMD Ryzen 5 PRO 4650U and Integrated AMD Radeon Graphics.

The only thing working for me was the Brightness Controller, after trying everything from modifying the GRUB with "acpi_backlight" through updating the BIOS (from 1.05 to 1.09) to some newer kernels (5.8.11 and 5.7.19). Still looking for a proper solution though, since Brightness Controller sort of greys out the screen when dimming (i.e. the contrast is decreasing slightly).

Update 2020_12_04:

Actually, the "5.4.0-54" kernel seems to have this fixed and I don't need Brightness Controller anymore (although it is an awesome little tool for many other purposes). The only problem now was that after a reboot, the brightness level wasn't remembered. To solve that I have two scripts, running as services:

  1. Run just before shutdown - stores the current brightness level into a file: echo $(brightnessctl -c backlight g) > lastBrigh.txt

  2. Run just after the login screen appears:

lastBrigh=$(<"lastBrigh.txt")

for i in {1..200}; do
    if [ $(brightnessctl -c backlight g) = $lastBrigh ]; then
        break
    else
        sudo brightnessctl -c backlight s $lastBrigh
        sleep 0.1
    fi
done

Which keeps trying to set the brightness to the last recorded level for ~20 seconds and then gives up. By the way, the "5.4.0-56" kernel is a doom again (desktop environment won't start), so I'll skip that one.