Unable to break cycle starting with systemd-backlight@backlight:nvidia_0.service/start

  • Ubuntu 22.04.4 LTS with kernel 5.15.0-100-generic
$ lspci -nn | grep VGA
00:02.0 VGA compatible controller [0300]: Intel Corporation Alder Lake-P Integrated Graphics Controller [8086:46a6] (rev 0c)
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GA106M [GeForce RTX 3060 Mobile / Max-Q] [10de:2560] (rev a1)

$ nvidia-smi
Fri Mar 15 16:07:21 2024       
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 535.161.07             Driver Version: 535.161.07   CUDA Version: 12.2     |
|-----------------------------------------+----------------------+----------------------+
| 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 RTX 3060 ...    Off | 00000000:01:00.0 Off |                  N/A |
| N/A   38C    P8               9W /  80W |      8MiB /  6144MiB |      0%      Default |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+
                                                                                         
+---------------------------------------------------------------------------------------+
| Processes:                                                                            |
|  GPU   GI   CI        PID   Type   Process name                            GPU Memory |
|        ID   ID                                                             Usage      |
|=======================================================================================|
|    0   N/A  N/A      1055      G   /usr/lib/xorg/Xorg                            4MiB |
+---------------------------------------------------------------------------------------+
  • Problem
$ journalctl -b -p err..alert
systemd[1]: systemd-backlight@backlight:nvidia_0.service: Unable to break cycle starting with systemd-backlight@backlight:nvidia_0.service/start

$ journalctl -b | grep -i 'backlight:nvidia'
systemd[1]: systemd-backlight@backlight:nvidia_0.service: Found ordering cycle on nvidia-persistenced.service/start
systemd[1]: systemd-backlight@backlight:nvidia_0.service: Found dependency on basic.target/start
systemd[1]: systemd-backlight@backlight:nvidia_0.service: Found dependency on paths.target/start
systemd[1]: systemd-backlight@backlight:nvidia_0.service: Found dependency on acpid.path/start
systemd[1]: systemd-backlight@backlight:nvidia_0.service: Found dependency on sysinit.target/start
systemd[1]: systemd-backlight@backlight:nvidia_0.service: Found dependency on systemd-backlight@backlight:nvidia_0.service/start
systemd[1]: systemd-backlight@backlight:nvidia_0.service: Unable to break cycle starting with systemd-backlight@backlight:nvidia_0.service/start
systemd[1]: systemd-backlight@backlight:nvidia_0.service: Found ordering cycle on nvidia-persistenced.service/start
systemd[1]: systemd-backlight@backlight:nvidia_0.service: Found dependency on basic.target/start
systemd[1]: systemd-backlight@backlight:nvidia_0.service: Found dependency on paths.target/start
systemd[1]: systemd-backlight@backlight:nvidia_0.service: Found dependency on acpid.path/start
systemd[1]: systemd-backlight@backlight:nvidia_0.service: Found dependency on sysinit.target/start
systemd[1]: systemd-backlight@backlight:nvidia_0.service: Found dependency on systemd-backlight@backlight:nvidia_0.service/start
systemd[1]: systemd-backlight@backlight:nvidia_0.service: Unable to break cycle starting with systemd-backlight@backlight:nvidia_0.service/start
systemd[1]: Starting Load/Save Screen Backlight Brightness of backlight:nvidia_0...
systemd[1]: Finished Load/Save Screen Backlight Brightness of backlight:nvidia_0.
sudo[14622]:  charlie : TTY=pts/1 ; PWD=/var/lib/systemd/backlight ; USER=root ; COMMAND=/usr/bin/cat pci-0000:01:00.0:backlight:nvidia_0

I have found nvidia-persistenced.service is come from package nvidia-compute-utils-535, but what
make it cycle dependency?

After some tech-dig and search, I found a way to make alert message out.
I think nvidia-persistenced.service file for some reason(or just a bug) missing DefaultDependencies=no

  • View the service content systemctl cat systemd-backlight@.service
  • List service dependencies
    • systemctl list-dependencies systemd-backlight@backlight:intel_backlight
    • systemctl list-dependencies systemd-backlight@backlight:nvidia_0.service

Fix by creating custom systemd drop-in service

$ sudo systemctl edit nvidia-persistenced.service
# Input file content with
#     [Unit]   
#     DefaultDependencies=no
# Save

# View service again
$ systemctl cat nvidia-persistenced.service
# /lib/systemd/system/nvidia-persistenced.service
[Unit]
Description=NVIDIA Persistence Daemon
Wants=syslog.target
StopWhenUnneeded=true
Before=systemd-backlight@backlight:nvidia_0.service
[Service]
Type=forking
ExecStart=/usr/bin/nvidia-persistenced --user nvidia-persistenced --no-persistence-mode --verbose
ExecStopPost=/bin/rm -rf /var/run/nvidia-persistenced

# /etc/systemd/system/nvidia-persistenced.service.d/override.conf
[Unit]
DefaultDependencies=no

Now, reboot, the alert message from journalctl -b -p err..alert is gone~

I do not known if it have other effects after add DefaultDependencies=no, if anyone knowns, please have a reply, thanks!

NOTE KDE Plasma v5.25 bugfix about backlighthelper

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.