Recently, my laptop screen suddenly goes black at random moments, while PC is in active use. Used to happen about 2-3 times a day, but now has progressed and is very regular.
It is not like when PC enters sleep mode. I have an external display attached, and luckily it stays on, when the laptop one goes blank. So it is still possible to use applications on that display, and move the windows partially or fully to the (blank) laptop display. As a quickfix, I switch to one of text terminal sessions (Ctrl+Alt+F1), and then back to X session (Ctrl+Alt+F7). When the problem started, that used to restores the laptop display to normal. Now it doesn't help anymore. Another "fix" is to put the computer to sleep, and then right after wakeup the display would stay on for some seconds, before going blank.
This behavior has turned up since some update around beginning of 2018, but it's hard to pinpoint which exactly, because I'd have to boot older kernels and use each one for longer time period to find out.
If that's relevant, the Video adapter is NVIDIA GeForce GTX 860M.
New findings: When the "Blank screen" setting in Settings-Power is set to "Never", the random switch-off of the laptop screen appears to go away. With the "side effect" that computer never goes to sleep mode, so that's not acceptable solution. I am thinking now maybe this switching happens when the system is under heavy load. Given my typical use, Chrome with many tabs, a VM or two running, this PC is under constant strain. Maybe the system misinterprets the situation and decides to save some power by switching off the laptop's display.
Another new finding: If the laptop display is kept empty, then it never is switched off. But it is enough to open Chrome with few tabs there, and soon enough the display will be switched off. I know, this sounds like random magic criteria, but what one can do if they are forced not to use one of two displays?
Extra details: The laptop display auto-switching off gets more intense when the laptop is running from battery. And, it appears to ease off, when I closed Chrome with several (many) open tabs. So I hold to the hypothesis that this behavior is related to the power management.
More details: I have selected the external display as my primary display now. This at least gives access to OS functions when the laptop display does blank. This going blank behavior is definitely connected to what programs are opened in that display. I know for sure that if I'll open one certain program on that display, it will go blank. It does not necessarily have to be a heavy program. If I then tab to that program (not visible now, because display went blank), Alt+F4 to exit, and then open settings, the laptop display goes on again. Something with X then...
Finale (I hope): I think I have found the cause of the laptop screen blanking. I changed the GeForce GT 860M driver (in Sowfware&Updates -> Additional Drivers) from "Using X.Org X server -- Nouveau display driver" to "Using NVIDIA binary driver - version 384.130", and the screen has not went blank since. My guess is that blanking was the result of system trying to dial the screen brightness down a notch (to save power?), and the Nouveau driver fails to do this properly for the given hardware.
Post finale: The problem turned out to be a very weird hardware failure. A mix of screen brightness, battery level, current power consumption level, and how recently the laptop has been switched on. Can't blame me for repeated falling for false positives. Preparing to submit the laptop for servicing. For the fellow people who happen to own the same model: it is MSI GS60.