Removing HDMI cable causes crash requiring hard power-off

Removing the HDMI cable (while using Ubuntu 20.04.4 and 22.04beta with Gnome on Xorg and laptop + external monitor) causes about 10-20s of dead screens, and errors in the kernel log - see below - and then when it comes to turning the machine off it goes wild at the point where I would expect the power light to go off. i.e. the fans come on and the power light stays on, though the screen is dead. It has to be turned off by holding the power button for 10s.

Linux 5.15.0-23-generic #23-Ubuntu SMP Fri Mar 11 14:54:05 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Apr 01 19:46:12  kernel: i915 0000:00:02.0: [drm] *ERROR* failed to enable link training
Apr 01 19:46:23  kernel: i915 0000:00:02.0: [drm] *ERROR* failed to enable link training

Anyone else found this? And any fixes?

Nb often the complete system freeze is shortly after the unplug.

After further investigation I have narrowed this down:

  • xorg
  • fractional scaling
  • Ubuntu 20.04.4 or 21.10 or 22.04beta,
  • kernels 5.13 - 5.15 (whatever Ubuntu beta uses)

Moving to Wayland seems to avoid the bug.

and/or

Resisting fractional scaling also avoids bug. However, on a framework laptop 100% is too small to see and 200% is too clunky/can’t fit apps on screen.

I think I’m observing something similar with Ubuntu 22.04 LTS, and Wayland currently disabled. I’ll keep this thread updated if I find something actionnable.

Did anyone find a resolution to the issue where Ubuntu 20.04 LTS server crashes when HDMI display cable removed ? i just installed four systems and they all have the exact same issue .