Skip to content

Instantly share code, notes, and snippets.

@inscapist
Created December 6, 2021 12:57
Show Gist options
  • Save inscapist/31688e14b3b56a6823fb9c49a55bddc6 to your computer and use it in GitHub Desktop.
Save inscapist/31688e14b3b56a6823fb9c49a55bddc6 to your computer and use it in GitHub Desktop.
Fixes broken brightness control in Arch Linux, on systems with Intel and Nvidia

My machine Spec:

  • Alienware X15 R1
  • QHD w/ GSync
  • RTX3070 MaxQ

It is definitely not an easy process, as everyone is posting this issue yet there is virtually no one posting their config when their setup is working. So I hope this helps someone with a setup like mine: Intel + Nvidia + Advanced Optimus.

I will list the steps I do here:

  1. Disable Advanced Optimus through BIOS (mine is V1.4.0), use only dGPU mode (until Nvidia fixes hybrid)
  2. Ensure there is nvidia_0 under /sys/class/backlight. (I will expand on this in the later section)
  3. Ensure that in /usr/share/X11/xorg.conf.d/**-nvidia**.conf, The option Option "RegistryDWords" "EnableBrightnessControl=1" is added.

How to ensure acpi interface is setup

If you are on manjaro and Nvidia driver 460.xx, nvidia_0 should already be the default.

For an installation using archinstall or via EndeavourOS ISO, I initially had acpi_video0, acpi_video1, acpi_video2 under /sys/class/backlight, and that doesn't work. In kernel parameter, I changed nvidia-drm.modeset=1 to nvidia-drm.modeset=0 and nvidia_0 is detected again.

On arch linux, run sudo grub-mkconfig -o /boot/grub/grub.cfg after changing /etc/default/grub. On ubuntu it should be something like sudo update-grub-??. Reboot.

The FN keys should be working now!


What did not work for me

  • all the acpi_osi and acpi_backlight kernel flags
  • i915 dpcd flags
  • Nvidia driver/kernel changes
  • PopOS? <-- it didn't work on PopOS as well, which is famous for their graphic compat capabilities
  • various xorg server layouts
  • anything to do with intel (modesetting driver, xf86-intel-video etc)
  • optimus-manager or bumblebee (suggest that you avoid this)

xrandr --brightness .2 makes my eyes less sore, but it is not a real fix


I also had to fix audio by installing sof-firmware - sudo pacman -S sof-firmware pavucontrol, and use Pavucontrol to find the correct output.

Hope this helps someone!

@inscapist
Copy link
Author

inscapist commented Aug 24, 2022

Refer to https://gist.github.com/sagittaros/96e76b96f325e3c24c88f9de45a55d0f

  • press "e" in grub boot screen to edit kernel parameter

ibt=off seems to be required

When system fails to boot, try ctrl+alt+f2 or ctrl+alt+f6 to enter cli mode. Most of the time nvidia and kernel aren't in friendly terms after an upgrade.

Refer to this when stuck https://wiki.archlinux.org/title/NVIDIA

Also, make sure to always have the lts kernal as an extra option

@inscapist
Copy link
Author

▲ tlp-stat -s
--- TLP 1.5.0 --------------------------------------------

+++ System Info
System = Alienware 1.9.0 Alienware x15 R1
BIOS = 1.9.0
OS Release = Kernel = 5.19.3-arch1-1 #1 SMP PREEMPT_DYNAMIC Sun, 21 Aug 2022 18:55:22 +0000 x86_64
/proc/cmdline = BOOT_IMAGE=/boot/vmlinuz-linux root=UUID=9b13cbb3-4479-41bc-8aa8-eb25db2d804b rw loglevel=3 nowatchdog nvme_load=YES nvidia-drm.modeset=1 ibt=off nvidia.NVreg_RegistryDwords=EnableBrightnessControl=1
Init system = systemd
Boot mode = UEFI

+++ TLP Status
State = enabled
RDW state = enabled
Last run = 09:37:29 +08, 361 sec(s) ago
Mode = AC
Power source = AC

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