On Ubuntu 18.04 I have a dual monitor setup that becomes unusable after waking up. The larger (secondary) monitor just displays "no signal". The smaller primary monitor displays as expected, and the mouse cursor moves around as normal, but both mouse and keyboard clicks have no effect. Other than the mouse movement I can't directly interact with the machine, and can only reboot it without a hardware reset by logging in from another computer by ssh.
The primary monitor is at 2560x1440 (2k) resolution at 60 hz and the larger, secondary monitor is at 3840x2160 (4k) resolution at 30 hz. These are driven by an ASUS GeForce GTX 1080 8GB graphics card.
I have read suggestions to work around this with xrandr commands, but I cannot try these because of the disabled mouse and keyboard clicks. It seems that xrandr does not work via ssh. I get a "Can't open display" error when I try. The shortcuts to open a virtual terminal (Ctrl-Alt-F1 through -F6) never work on this machine, even right after boot when everything else is working, so I don't have that option.
When the system is working and I try any modifications with xrandr, it causes both monitors to go blank and disables the mouse clicks (though as above I can still move the mouse cursor when this happens). I have been attempting to scale the 4k monitor to match the 2k monitor in this way, without success. Because of this I'm not optimistic about the xrandr solutions, though I'll be happy to try them if I can figure out how.
When it sleeps, the 4k secondary monitor turns itself off. If I leave it off and only turn on the 2k primary monitor, the system wakes successfully and I can use the mouse and keyboard normally on the primary screen. When I then turn on the 4k secondary monitor, the primary monitor goes dark for a few moments and then displays again, but now the mouse and keyboard clicks are disabled.
In an attempt to see if the high resolutions contribute to the problem I used display settings to change the resolution of the 4k secondary monitor to 1920x1080 resolution. This caused the primary monitor to go blank, and the 4k secondary monitor to successfully change to 1920x1080 resolution for a few seconds, and then it went blank too. Again, I can still move the mouse cursor, but have to reboot via ssh.
This system is fully updated with the Software Updater. Is there a way to tell whether this is a software or hardware problem?
I would appreciate any suggestions on how to debug this. Thanks.