[Solved?] Removing screen from Xorg server results in Xorg not updating content on screen

I currently have two screens connected to my machine (one via HDMI, one via DP), on a RTX 2080 Super from Aorus (does the maker and model even matter ?)

When I turn off one screen, with xrandr --output $OUTPUT --off, no matter if the display targeted was the HDMI or DP one, it takes a second then turns black (same behaviour as on Windows, no problems here) and when the video feed comes back up, the X server just … refuses to update the content on screen. Except for the mouse, which still moves and changes shape according to the content that is supposed to be behind it (text selector for terminal and text editors, pointer for GUI applications/programs).

I’m wondering if the issue could caused by the nvidia drivers, or the X server somehow not updating ? (in which case, I’ll submit a bug report to the maintainers of X11)

I have no problems on my laptop using a GTX 1070 MaxQ, but then again it has a different config file, and different outputs (since it shares them with an integrated Intel GPU). A slight note, I sometimes plug in an HMD for a personal project of mine, but the issue appears whether it is connected or not.

I’m running on archlinux 5.5.13, with nvidia drivers v440.64-9 from the official archlinux repos. Here is my config file, generated with nvidia-xconfig :

# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 440.64

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

Section "Files"
EndSection

Section "InputDevice"

    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"

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

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "ForceCompositionPipeline" "On"
    Option         "ForceFullCompositionPipeline" "On"
    Option         "AllowHMD" "On"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

EDIT : I was abler to solve the problem by updating the nvidia drivers and my kernel, but I have no clue on how to solve it on the drivers v440.64-9.

Please run nvidia-bug-report.sh as root and attach the resulting nvidia-bug-report.log.gz file to your post. You will have to rename the file ending to something else since the forum software doesn’t accept .gz files (nifty!).

Should I run it anytime after the X server has been started, or right after the display error ?

EDIT : Here’s the file requested :) nvidia-bug-report.log (283.9 KB)

Looks like the GL driver is crashing, also discord segfaulting on waiting for vsync.
#6 0x00007fca1b166ebb n/a (libnvidia-glcore.so.440.64 + 0xe54ebb)

Does this also happen if you

  • remove Option “AllowHMD” completely
  • use a driver version <=440.36

I could not downgrade the drivers, since they were published before my desktop computer was setup (I assembled it in late february, the driver <= 440.36 were published in late 2019). It would have meant downgrading my whole system to linux-5.3.xx, which I currently cannot do since I also use this machine for work, and need it to function properly.

However, completely upgrading my system (new linux kernel, new nvidia drivers) did the trick. So, I guess it’s solved ?

EDIT : by re-adding the option AllowHMD after the system upgrade was done, I was not able to reproduce the bug. I guess it was an issue with nvidia drivers on the specific 440.64-8 version :/

Also, I just noticed updating my nvidia driver made the system detect my connected screens the other way around : before, the DP one was selected as the primary output (connected on DP-2) and the HDMI the secondary output (connected on HDMI-0) and now they’re inverted, causing the wrong DPI to be selected. Any idea why that might have happened ?