I’ve happily been running Fedora 36 for the past few weeks, but one issue on my work laptop still needs to be resolved. The Gnome desktop brightness control is not having any affect on the screen brightness.
I am able to adjust the brightness from the command line using the following command:
echo 255 | sudo tee /sys/class/backlight/amdgpu_bl0/brightness
This is not ideal, so to mitigate, I created a function in my .zshrc as follows:
function set_brightness() {
echo $1 | sudo tee /sys/class/backlight/amdgpu_bl0/brightness;
}
This allows me to set the brightness with something like set_brightness 128
. Less painful, but having the slider or keyboard brightness control shortcuts work would be preferrable.
There are two backlight folders that can be found on my laptop, one for each GPU:
/sys/class/backlight/amdgpu_bl0
/sys/class/backlight/nvidia_0
What I did noticed is that the brightness slider/keyboard brightness controls actively changes the brightness setting in the file at /sys/class/backlight/nvidia_0/brightness
, however, this has no visual effect. This setting, seemingly just needs to get synchronized with /sys/class/backlight/amdgpu_bl0/brightness
, scaled to whatever value can be found in max_brightness
off course.
I experimented a bit by watching the nvidia_0/brightness
for changes, and simply overriding amdgpu_bl0/brightness
with its value when a filesystem change event occurs, and this works. This could work if implemented as a service, but it feels rather hacky, there must be a better way.
Let me provide some machine details, I have a Lenovo ThinkBook with the following specs:
If I run lspci -k | grep -A 3 VGA
I get the following output:
01:00.0 VGA compatible controller: NVIDIA Corporation GA106M [GeForce RTX 3060 Mobile / Max-Q] (rev a1)
Subsystem: Lenovo Device 3801
Kernel driver in use: nvidia
Kernel modules: nouveau, nvidia_drm, nvidia
--
05:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Cezanne (rev c5)
Subsystem: Lenovo Device 3804
Kernel driver in use: amdgpu
Kernel modules: amdgpu
uname -r
reports kernel version 5.19.4-200.fc36.x86_64
My Nvidia drivers seem to be installed correctly, I used the following commands to install them:
sudo dnf install akmod-nvidia
sudo dnf install xorg-x11-drv-nvidia-cuda
nvidia-smi
reports the following
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 515.65.01 Driver Version: 515.65.01 CUDA Version: 11.7 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 NVIDIA GeForce ... Off | 00000000:01:00.0 Off | N/A |
| N/A 37C P0 N/A / N/A | 3MiB / 6144MiB | 0% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| 0 N/A N/A 6570 G /usr/bin/gnome-shell 2MiB |
+-----------------------------------------------------------------------------+
I hope I’ve provided adequate details. I’ve been reading around a bit to try and resolve this issue for the past few days, with no luck at all.
I tried suggestions like trying to edit the grub configuration by adding acpi_backlight
amongst some other things. None of these so far, worked for me.
Another suggestion I got was to mount the nvidia_0 folder right over the amdgpu_bl0, this seems to work if I do the mount from the command line, but it’s rather risky and once again, quite a makeshift way to try and fix the problem. I had some challenges getting this to mount at boot, something was overriding the changes, and restoring the original amdgpu_bl0
folder.
I also tried switching between Wayland and X11, but this had no effect at all.
One last noteworthy mention is that my boot log reports Failed to start nvidia-power.service
, but I doubt that this service is the cause.
Any ideas how I can fix the screen brightness control?