You are not logged in.

#1 2023-07-27 16:37:54

7000k
Member
Registered: 2022-09-29
Posts: 22

Black screen on resume following recent update.

My system used to work fine with suspend/resume until the last update. (my previous update was a month ago). Now, every time I wake up from suspend I'm getting a black screen. I move the mouse/use the keyboard but it doesn't help. I suspected it might have something to do with powering off the screen after long inactivity so I disabled DPMS and the screensaver. There is no improvement. I can switch to a text console with ctrl-alt-f3, but if I switch back to the graphics console I get the black screen again. I have to kill Xorg which drops to the text console and run it again with startx (I don't use a GUI login manager - I login via text console and I run startx when needed). Then it runs fine until I suspend again.
 
This reminds me somewhat of a problem I used to have on this system the first time I built it. My machine wouldn't come back from suspend (similar black screen) until I've created a small script and I placed it in:

/usr/lib/systemd/system-sleep/nvidia

Thats the script content:

{
#!/bin/sh

case "$1" in
    post)
        /usr/bin/nvidia-sleep.sh "resume"
        ;;
esac
}

It simply calls a nvidia supplied script that does this:

{
#!/bin/bash

if [ ! -f /proc/driver/nvidia/suspend ]; then
    exit 0
fi

RUN_DIR="/var/run/nvidia-sleep"
XORG_VT_FILE="${RUN_DIR}"/Xorg.vt_number

PATH="/bin:/usr/bin"

case "$1" in
    suspend|hibernate)
        mkdir -p "${RUN_DIR}"
        fgconsole > "${XORG_VT_FILE}"
        chvt 63
        if [[ $? -ne 0 ]]; then
            exit $?
        fi
        echo "$1" > /proc/driver/nvidia/suspend
        exit $?
        ;;
    resume)
        echo "$1" > /proc/driver/nvidia/suspend 
        #
        # Check if Xorg was determined to be running at the time
        # of suspend, and whether its VT was recorded.  If so,
        # attempt to switch back to this VT.
        #
        if [[ -f "${XORG_VT_FILE}" ]]; then
            XORG_PID=$(cat "${XORG_VT_FILE}")
            rm "${XORG_VT_FILE}"
            chvt "${XORG_PID}"
        fi
        exit 0
        ;;
    *)
        exit 1
esac

}

All it does is, it switches to a text console before suspend and switches back to the graphics consle after resume. So I've tried to do this myself. I switched to a text console, I called systemctl suspend from there. I resumed and then I switched back to the GUI console. Everything appeared to be fine.

So my question is, is there anything that could stop these two scripts from executing following a recent update? As far as I can tell this "echo "$1" > /proc/driver/nvidia/suspend " doesn't really matter as I can sucesfully suspend/resume manually emulating the rest of the script.

For the sake of completness this is my hardware:
I've a Nvidia 2070 GPU and a Asus tuf x570 gaming plus MB with a Ryzen 7 3700X CPU.
NVIDIA-SMI 535.86.05              Driver Version: 535.86.05    CUDA Version: 12.2

Offline

Board footer

Powered by FluxBB