Article 6QW1D [Plasma] X crash when external monitor unplugged with NVIDIA PRIME

[Plasma] X crash when external monitor unplugged with NVIDIA PRIME

by
rinza
from LinuxQuestions.org on (#6QW1D)
I've been using NVIDIA gpu as the default device for X, and plugging and unplugging external monitor in HDMI was no problem on my laptop with -current + KDE5/Plasma. Recently, I moved to PRIME offload, driving X on Intel integrated gpu and running specific applications on NVIDIA with special environment variables.

It does seems to work regarding offloading to dGPU, but I noticed that on unplugging hdmi cable the X server crashes, returning to console with a frozen screen. I have to reboot with SysRq + Alt + B, though no output is actually shown in the console and other commands are unresponsive (changing tty, CTRL + C, etc).

The scenario of unplugging: Laptop lid is closed with the cable on and the external monitor on. I open the lid, both screens are ok, mirroring each other. I remove the cable, laptop monitor keep showing the desktop for a brief moment, then crashes to unusable console with no apparent error lines.

My kernel boot strings:
Code:root=/dev/mapper/[redacted] vga=normal ro resume=UUID=[redacted] resume_offset=[redacted] threadirqs psmouse.synaptics_intertouch=1 acpi_osi='Windows 2015' acpi_osi='Linux' nogpumanager pcie_port_pm=off intel_iommu=on iommu=pt zswap.enabled=1 zswap.zpool=zsmalloc zswap.compressor=zstdI'm also running on modprobe.d:
Code:options nvidia-drm modeset=1Xorg.conf, simplified:
Code:Section "ServerLayout"
Identifier "Layout0"
Screen 0 "intel"
#Inactive "intel"
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Mouse0" "CorePointer"
Option "AllowNVIDIAGPUScreens"
EndSection

Section "Module"
Load "type1"
Load "freetype"
Load "glx" #loads dri3
EndSection

....

Section "Monitor"
Identifier "Monitor0"
VendorName "Unknown"
ModelName "[redacted]"
HorizSync 26.0 - 81.0
VertRefresh 24.0 - 75.0
Option "DPI" "96 x 96"
EndSection

Section "Monitor"
Identifier "Monitor1"
VendorName "Unknown"
HorizSync 26.0 - 81.0
VertRefresh 24.0 - 75.0
Option "DPI" "96 x 96"
EndSection

Section "Device"
Identifier "card_nvidia"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BoardName "[redacted]"
BusID "PCI:01:00:0"
Option "HardDPMS" "false"
EndSection

Section "Device"
Identifier "intel"
Driver "modesetting"
Option "AsyncFlipSecondaries" "on"
BusID "PCI:00:02:0"
Option "DRI3" "1"
EndSection

Section "Screen"
Identifier "screen_nvidia"
Device "card_nvidia"
DefaultDepth 24
Option "Stereo" "0"
Option "AllowNVIDIAGPUScreens"
Option "Coolbits" "13"
Option "AllowEmptyInitialConfiguration" "True"
Option "ForceFullCompositionPipeline" "on"
Option "metamodes" "1920x1080_60i +0+0"
EndSection

Section "Screen"
Identifier "intel"
Device "intel"
DefaultDepth 24
Option "Stereo" "0"
EndSectionxorg.log when it crashes:
Code:(--) NVIDIA(GPU-0): [redacted] (DFP-0): connected
(--) NVIDIA(GPU-0): [redacted] (DFP-0): Internal TMDS
(--) NVIDIA(GPU-0): [redacted] (DFP-0): 600.0 MHz maximum pixel clock
(--) NVIDIA(GPU-0):
(II) event7 - .... Wireless Radio Control: device removed
(II) event3 - Power Button: device removed
(II) event14 - Video Bus: device removed
(II) event13 - Video Bus: device removed
(II) event2 - Power Button: device removed
(II) event1 - Sleep Button: device removed
(II) event6 - Logitech ....: device removed
(II) event4 - AT Translated Set 2 keyboard: device removed
(II) event5 - Logitech .....: device removed
(II) UnloadModule: "libinput"
(II) UnloadModule: "synaptics"
(II) UnloadModule: "libinput"
(II) UnloadModule: "libinput"
(II) UnloadModule: "libinput"
(II) UnloadModule: "libinput"
(II) UnloadModule: "libinput"
(II) UnloadModule: "libinput"
(II) UnloadModule: "libinput"
(II) UnloadModule: "libinput"
(II) UnloadModule: "libinput"
(II) NVIDIA(GPU-0): Deleting GPU-0
(WW) xf86CloseConsole: KDSETMODE failed: Input/output error
(WW) xf86CloseConsole: VT_GETMODE failed: Input/output error
(WW) xf86OpenConsole: VT_GETSTATE failed: Input/output error
(II) Server terminated successfully (0). Closing log file.NVIDIA driver (tried with previous versions, same results):
560.35.03

Anyone seen something like this before?
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments