No Brightness Control with Nvidia Driver

Hi all,

old problem revisited: brightness control works on text console but not in X session.

I tried setting “EnableBrightnessControl=1” in Device section of xorg.conf as this has worked previously (older leaps). But not anymore.

joachim@job2:~> cat /etc/X11/xorg.conf
# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 340.107  (buildmeister@swio-display-x64-rhel04-13)  Thu May 24 22:29:58 PDT 2018

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0"
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
EndSection

Section "Files"
EndSection

Section "InputDevice"
    # generated from data in "/etc/sysconfig/mouse"
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "IMPS/2"
    Option         "Device" "/dev/input/mice"
    Option         "Emulate3Buttons" "yes"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    HorizSync       28.0 - 33.0
    VertRefresh     43.0 - 72.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    Option         "RegistryDwords"  "EnableBrightnessControl=1"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

and like this (with and without xorg.conf removed)

joachim@job2:~> cat /etc/X11/xorg.conf.d/50-device.conf  
Section "Device"
  Identifier "Nvidia Device"
  Option  "RegistryDwords"  "EnableBrightnessControl=1"
EndSection

Is there a new way of doing this?

I might be wrong, but isn’t that an MS thing for their “Registry”? If so, I don’t see how that can work on linux. Like I said, I may be wrong.

I agree it looks strange. And it is strange that this option exists in the first place. Why would anyone not want brightness control?
But this is traditional xorg.conf syntax and it was definitively required and working in a previous opensuse version.
Anyways, any hint welcome!

Hi
I would suggest a boot option for the nvidia driver;


nvidia.NVreg_EnableBacklightHandler=1

If you boot and edit the grub boot line and add, else YaST bootloader and add to the kernel boot options.

Before you try that, are any of the backlight services failed or interfering;


systemctl status systemd-back*

Hi malcolmlewis,

Backlight service looks good to me (but never seen it before - dont really know what it is supposed to look like):

joachim@job2:~> sudo systemctl status systemd-backlight@backlight\:acpi_video0.service  
**●** systemd-backlight@backlight:acpi_video0.service - Load/Save Screen Backlight Brightness of backlight:acpi_video0
   Loaded: loaded (/usr/lib/systemd/system/systemd-backlight@.service; static; vendor preset: disabled)
   Active: **active (exited)** since Sat 2019-08-17 10:37:36 CEST; 2min 3s ago
     Docs: man:systemd-backlight@.service(8)
 Main PID: 1346 (code=exited, status=0/SUCCESS)

Aug 17 10:37:34 job2 systemd[1]: Starting Load/Save Screen Backlight Brightness of backlight:acpi_video0...
Aug 17 10:37:36 job2 systemd[1]: Started Load/Save Screen Backlight Brightness of backlight:acpi_video0.

But I tried startx with this service stopped as well. No change
I also tried other windowmanagers (twm, icewm). No influence. In Plasma I can at least see the bar going up and down, but no effect on brightness,

Regarding the parameter nvidia.NVreg_EnableBacklightHandler=1: No effect.
But you made me realize this is a kernel module parameter, not directly related to xorg - it just passes it on. So I did a modinfo and could not find the parameter. But I saw this:

joachim@job2:~> sudo modinfo nvidia | grep Dword
parm:           NVreg_Registry**Dword**s:charp

So I tried this kernel command line:

joachim@job2:~> cat /proc/cmdline  
BOOT_IMAGE=/boot/vmlinuz-4.12.14-lp151.28.10-default root=/dev/mapper/ssdvg-root151 video=1680x1050 **nvidia.NVreg_RegistryDwords=
EnableBacklightHandler=1** resume=/dev/disk/by-uuid/c16ac26d-2072-425d-bf59-d96f461bc8b3 mitigations=auto

Looks a bit strange with the 2 equal signs … and did not work as well.

Out of options again…

video.use_native_backlight=1

this helped me.

That’s good to hear. Thank you for sharing the solution.