Public bug reported:

# Black screen after resume: Xorg never processes logind's ResumeDevice
signals

## Summary

On resume from S3, Xorg stays in `LeaveVT` state forever: the screen stays black
("no video signal" on the monitor), all input devices are disabled, and any 
later
`chvt` blocks indefinitely. The session and the X server are alive and answer
clients; only the console ownership is lost. Recovery requires
`systemctl restart gdm`; a reboot is not needed.

4 of 10 resumes failed over two weeks. Successful and failed resumes differ by
exactly one thing in the journal: whether the X server processed the
`ResumeDevice` signals. logind emitted them in **all 10** cases - 9 signals 
every
time, without exception.

## Environment

- Ubuntu 24.04.5 LTS
- kernel 7.0.0-38-generic (HWE); also reproduced on 7.0.0-31 and 7.0.0-34
- systemd 255.4-1ubuntu8.17
- xserver-xorg-core 2:21.1.12-1ubuntu1.8; also reproduced on 1ubuntu1.6
- gdm3 46.2-1ubuntu1~24.04.9, X11 session (WaylandEnable=false)
- nvidia-driver-595-open 595.91.07-0ubuntu0.24.04.1, prebuilt modules (no DKMS)
- GPU: NVIDIA GeForce RTX 5060 Ti [10de:2d04], single DisplayPort monitor
- `NVreg_UseKernelSuspendNotifiers=1`, `NVreg_PreserveVideoMemoryAllocations=1`
  (so `/proc/driver/nvidia/suspend` does not exist and `nvidia-sleep.sh` exits
  immediately - the userspace `chvt 63` is NOT involved)

## Evidence from a failed resume (2026-09-29 11:36:50)

State captured over ssh while the failure was live:

```
XFree86_has_VT             = 0        (1 when healthy)
xset q                     -> Monitor is Off
xinput list                -> 10 devices as "floating slave", masters hold only 
XTEST
/sys/class/drm/card1/card1-DP-1/dpms -> Off
/sys/class/tty/tty0/active -> tty2    (the VT Xorg runs on)
xdpyinfo                   -> answers normally, X server alive
```

With `SYSTEMD_LOG_LEVEL=debug` on systemd-logind, logind behaves **correctly** 
on
both edges of the suspend:

```
Sep 28 22:39:33          VT changed to 63
Sep 28 22:39:33          PauseDevice  -> :1.92   (x11)
Sep 29 11:36:50.328928   VT changed to 2
Sep 29 11:36:50.331592   ResumeDevice -> :1.92   (x9, signature uuh)
```

But the X server logs only the first half:

```
got pause  : 10
got resume : 0
```

So `ResumeDevice` is emitted to a live D-Bus connection and never acted upon by
Xorg. The X server is not wedged in general - confirmed on every failed resume:

- it keeps logging (45 lines after the 2026-10-06 resume);
- it keeps handling udev events (input device add/remove);
- it keeps making **method calls to logind over the same bus**, e.g.
  `systemd-logind: not releasing fd for 13:87, still in use` and
  `systemd-logind: releasing fd for 13:87`, seconds after the resume;
- on an earlier failure it even completed a `TakeDevice` round-trip:
  `systemd-logind: got fd for /dev/input/event23 ... paused 0`;
- it answers clients (`xdpyinfo`, `xwininfo`) normally.

So the D-Bus connection is alive and working in both directions. Only the
inbound `ResumeDevice` signals are not acted upon.

Timing: the kernel finished `Restarting tasks` at 11:36:49; logind sent the
signals 1.3 s later.

Why the signals are not processed is **not established**. Candidates not yet
ruled out: the signals are lost between the bus and the X client, or
`systemd_logind_dbus_filter()` does not dispatch them in this state.

## Statistics (2026-09-24 .. 2026-10-06, logind at debug log level)

Every resume emits exactly 9 `ResumeDevice` signals from logind. Counting them
against the X server's `got resume` lines, per boot:

| boot period   | resumes | logind sent | Xorg processed | ok | failed |
|---------------|---------|-------------|----------------|----|--------|
| Sep 24..Sep 27 | 3      | 27          | 27             | 3  | 0      |
| Sep 28         | 1      | 9           | 0              | 0  | 1      |
| Sep 29         | 1      | 9           | 0              | 0  | 1      |
| Sep 30..Oct 02 | 3      | 27          | 18             | 2  | 1      |
| Oct 03         | 1      | 9           | 9              | 1  | 0      |
| Oct 06         | 1      | 9           | 0              | 0  | 1      |
| **total**      | **10** | **90**      | **54**         | **6** | **4** |

logind's side is 100% consistent. The failure is entirely on whether those
signals reach and are dispatched by the X server. In every failed case the count
is exactly 0, never partial.

Counting method (avoids time-window mistakes - the switch to VT 63 is logged at
suspend time, hours before the resume, so a window around the resume misses it):

```
journalctl -b N | grep -c 'PM: suspend exit'
journalctl -b N -u systemd-logind | grep -c 'member=ResumeDevice'
journalctl -b N | grep 'gdm-x-session' | grep -c 'got resume'
```

## Mechanism (up to the point of failure)

1. The NVIDIA driver requests a VT switch around suspend:
   `pm_vt_switch_required(nvl->dev, NV_TRUE)` in `nvidia/nv-pci.c`.
2. The kernel runs `pm_prepare_console()` -> `vt_move_to_console(63, 1)`
   (`kernel/power/console.c`, `CONFIG_VT_CONSOLE_SLEEP=y`) and switches back on
   resume.
3. Xorg holds the VT in `VT_PROCESS` mode, gets the release signal, runs
   `xf86VTLeave()`: input devices disabled, screens released, `VT_RELDISP, 1`.
4. On the way back, `xf86VTSwitch()` in `hw/xfree86/common/xf86Events.c`
   deliberately does nothing when logind manages the session:
   ```c
   if (xf86VTOwner())        xf86VTLeave();
   else if (!systemd_logind_controls_session()) xf86VTEnter();
   ```
   `xf86VTEnter()` - the only path that acknowledges the acquire with
   `VT_RELDISP, VT_ACKACQ` - is reachable only from `systemd_logind_vtenter()`,
   i.e. from the `ResumeDevice` handler in 
`hw/xfree86/os-support/linux/systemd-logind.c`.
5. Since that handler never runs, the acquire is never acknowledged. Input stays
   disabled, screens stay released, and any later `chvt` hangs because leaving
   tty2 needs an acknowledgement Xorg will no longer give.

Intermittency: on successful resumes the same log shows 9 `got resume` lines in
the X server, i.e. the signals do get through.

## Reproduce

1. Ubuntu 24.04, GNOME on X11 under gdm3, NVIDIA proprietary/open driver.
2. Suspend to RAM, wait several hours, wake.
3. Roughly one in three attempts: black screen, dead input, live ssh.
4. Check `DISPLAY=:1 xprop -root XFree86_has_VT` (0 = hit) and
   `journalctl -b 0 | grep gdm-x-session | grep -c 'got resume'` (0 = hit).

## Workaround

`sudo systemctl restart gdm` over ssh restores the session without a reboot:
terminating Xorg puts the VT back into `VT_AUTO` mode.

## Already ruled out

- Kernel modesetting: enabled and working (`fb0 = nvidia-drmdrmfb`, connectors
  present). An earlier `nvidia-drm.modeset=0` in GRUB was a separate, now-fixed
  problem.
- The userspace `chvt 63` in `/usr/bin/nvidia-sleep.sh`: eliminated via
  `NVreg_UseKernelSuspendNotifiers=1`; the failure persists because the kernel
  performs the switch itself.
- Driver version: reproduced on 580.173.02, 595.84 and 595.91.07. The 595.91.07
  changelog entry about "black screen when console switching on Linux v7.0" does
  not cover this case.
- xserver-xorg-core version: reproduced on 2:21.1.12-1ubuntu1.6 and -1ubuntu1.8.
- Kernel version: reproduced on 7.0.0-31, 7.0.0-34 and 7.0.0-38.
- DKMS-built modules: the machine uses Canonical's prebuilt modules.
- Hardware/link: the monitor is detected, the mode is set, `xrandr` reports the
  output as connected and active throughout the failure.

## Related

- LP #2139645 "Black screen on resume since NVIDIA 580.126.09 update" 
(Confirmed,
  no assignee) - same symptom, also tagged xorg-server.
- xorg-server issue 1271 / MR 829 (2022) is already in 21.1.12; 
`systemd-logind.c`
  and `xf86Events.c` are byte-identical between 21.1.12 and 21.1.22.

ProblemType: Bug
DistroRelease: Ubuntu 24.04
Package: xserver-xorg-core 2:21.1.12-1ubuntu1.8
ProcVersionSignature: Ubuntu 7.0.0-38.38~24.04.4-generic 7.0.14
Uname: Linux 7.0.0-38-generic x86_64
.proc.driver.nvidia.capabilities.fabric-imex-mgmt:
 DeviceFileMinor: 4323
 DeviceFileMode: 256
 DeviceFileModify: 1
.proc.driver.nvidia.capabilities.gpu0: Error: path was not a regular file.
.proc.driver.nvidia.capabilities.mig: Error: path was not a regular file.
.proc.driver.nvidia.gpus.0000.01.00.0: Error: path was not a regular file.
.proc.driver.nvidia.registry: Binary: ""
.proc.driver.nvidia.suspend_depth: default modeset uvm
.proc.driver.nvidia.version:
 NVRM version: NVIDIA UNIX Open Kernel Module for x86_64  595.91.07  Release 
Build  (dvs-builder@U22-I3-B08-02-2)  Wed Jul 29 03:01:16 UTC 2026
 GCC version:  gcc version 13.3.0 (Ubuntu 13.3.0-6ubuntu2~24.04.1)
ApportVersion: 2.28.3-0ubuntu0.1
Architecture: amd64
BootLog: Error: [Errno 13] Permission denied: '/var/log/boot.log'
CasperMD5CheckResult: pass
CompositorRunning: None
CurrentDesktop: ubuntu:GNOME
Date: Tue Oct  6 11:35:34 2026
DistUpgraded: Fresh install
DistroCodename: noble
DistroVariant: ubuntu
ExtraDebuggingInterest: Yes
GraphicsCard:
 NVIDIA Corporation Device [10de:2d04] (rev a1) (prog-if 00 [VGA controller])
   Subsystem: Micro-Star International Co., Ltd. [MSI] Device [1462:5365]
InstallationDate: Installed on 2026-04-05 (184 days ago)
InstallationMedia: Ubuntu 24.04.4 LTS "Noble Numbat" - Release amd64 (20260210)
MachineType: Micro-Star International Co., Ltd. MS-7D98
ProcEnviron:
 LANG=ru_RU.UTF-8
 PATH=(custom, no user)
 SHELL=/bin/bash
 TERM=xterm-256color
 XDG_RUNTIME_DIR=<set>
ProcKernelCmdLine: BOOT_IMAGE=/vmlinuz-7.0.0-38-generic 
root=/dev/mapper/ubuntu--vg-ubuntu--lv ro quiet splash vt.handoff=7
SourcePackage: xorg-server
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 08/06/2025
dmi.bios.release: 5.32
dmi.bios.vendor: American Megatrends International, LLC.
dmi.bios.version: H.C0
dmi.board.asset.tag: Default string
dmi.board.name: B760 GAMING PLUS WIFI (MS-7D98)
dmi.board.vendor: Micro-Star International Co., Ltd.
dmi.board.version: 3.0
dmi.chassis.asset.tag: Default string
dmi.chassis.type: 3
dmi.chassis.vendor: Micro-Star International Co., Ltd.
dmi.chassis.version: 3.0
dmi.modalias: 
dmi:bvnAmericanMegatrendsInternational,LLC.:bvrH.C0:bd08/06/2025:br5.32:svnMicro-StarInternationalCo.,Ltd.:pnMS-7D98:pvr3.0:rvnMicro-StarInternationalCo.,Ltd.:rnB760GAMINGPLUSWIFI(MS-7D98):rvr3.0:cvnMicro-StarInternationalCo.,Ltd.:ct3:cvr3.0:skuDefaultstring:pfaDefaultstring:
dmi.product.family: Default string
dmi.product.name: MS-7D98
dmi.product.sku: Default string
dmi.product.version: 3.0
dmi.sys.vendor: Micro-Star International Co., Ltd.
version.compiz: compiz N/A
version.libdrm2: libdrm2 2.4.125-1ubuntu0.1~24.04.2
version.libgl1-mesa-dri: libgl1-mesa-dri 25.2.8-0ubuntu0.24.04.2
version.libgl1-mesa-glx: libgl1-mesa-glx N/A
version.nvidia-graphics-drivers: nvidia-graphics-drivers-* N/A
version.xserver-xorg-core: xserver-xorg-core 2:21.1.12-1ubuntu1.8
version.xserver-xorg-input-evdev: xserver-xorg-input-evdev N/A
version.xserver-xorg-video-ati: xserver-xorg-video-ati 1:22.0.0-1build1
version.xserver-xorg-video-intel: xserver-xorg-video-intel 
2:2.99.917+git20210115-1build1
version.xserver-xorg-video-nouveau: xserver-xorg-video-nouveau 
1:1.0.17-2ubuntu0.1

** Affects: xorg-server (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug noble ubuntu

** Attachment added: "nvidia-suspend-logs.txt"
   
https://bugs.launchpad.net/bugs/2169660/+attachment/6006138/+files/nvidia-suspend-logs.txt

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2169660

Title:
  Black screen after resume: Xorg never processes logind's ResumeDevice
  signals

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/2169660/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to