Ubuntu – How to reload video driver after black screen

intel graphicsvideo-driver

I have intel i915 graphic driver. Sometimes I get black screen, I have a shortcut for sudo service lightdm restart but it doesn't fix black screen problem. How can I reload graphic driver?

EDIT: It happens during heavy load of CPU, once it happened while scrolling chromium page.

Output of xrandr:

 xrandr
 Screen 0: minimum 320 x 200, current 1280 x 800, maximum 32767 x 32767
 LVDS1 connected 1280x800+0+0 (normal left inverted right x axis y axis) 331mm x 207mm
    1280x800       60.0*+
    1024x768       60.0  
    800x600        60.3     56.2  
    640x480        59.9  
 VGA1 disconnected (normal left inverted right x axis y axis)
 TV1 disconnected (normal left inverted right x axis y axis)
 VIRTUAL1 disconnected (normal left inverted right x axis y axis)

EDIT2:
Though I accepted the below answer which was posted by terdon , after I tested it many times I must note that it doesn't work.

How can I reload video driver when I get black screen?

Best Answer

I don't know if this will solve your issue, you might have a different problem to mine. In my case, the black screen happens when the computer has been left alone for a while and the screen has turned off. While moving the mouse or pressing a key wakes it up, the screen remains black.

My workaround is to run an xrandr command that sets up my screen again. In your case, the command would be:

xrandr --output LVDS1 --auto

If that does not set up the correct resolution, use this one instead:

xrandr --output LVDS1 --mode 1280x800

However, that's hard to type on a black screen. So, make a little script that runs this command:

echo -e '#!/bin/bash\nxrandr --output LVDS1 --mode 1280x800` > ~/bin/fix_screen.sh

The command above will create a file in your $HOME/bin directory (if the directory does not exist, create it with mkdir ~/bin) called fix_screen. Now, make the script executable:

chmod +x ~/bin/fix_screen

Finally, assign a shortcut to it. Open the Settings dialog:

enter image description here

Then, go to Keyboard => Shortcuts => Custom Shirrtcuts and click on the + sign:

enter image description here

And then enter this:

enter image description here

Finally, choose a shortcut for it. Just click on Disabled and then type the shortcut you want:

enter image description here

Now, the next time you have this black screen issue, just use the keyboard shortcut and everything should be fine.

Related Question