How to restart GPU without reboot (softreset)?

Solution 1:

Run one of the next commands in terminal or, better, in TTY# using Ctrl+Alt+F#, where # is a number from 1 to 6:

sudo /etc/init.d/lightdm restart

or

sudo service lightdm restart

This will restart the graphics environment.

I don't know yet from what reason, but these commands worked for me only in TTY. Anyway, if you are stuck in a black screen after you are running one of these commands in terminal, just go in TTY and run next command:

sudo service lightdm start

From http://en.wikipedia.org/wiki/LightDM:

LightDM is the default display manager for Ubuntu, Edubuntu, Xubuntu and Mythbuntu since 11.10 release, for Lubuntu since 12.04 release, and for Kubuntu beginning with 12.10.

So, restarting LightDM entail restarting the GDM without rebooting the machine

Solution 2:

Try if switching back and forth from the graphic screen to a virtual tty works. I mean, when you have the black screen, try to press Ctrl+Alt+F1 and, if and when you have the login screen, Alt+F7. If the graphic screen doesn't come back, stop reading...

If the screen comes back you can try to add this to your sleep scripts (kudos to the forum entry http://ubuntuforums.org/showthread.php?t=1978290:)

#!/bin/sh
# 

case "${1}" in
        hibernate|suspend)

        chvt 1 
        ;;
        resume|thaw)

        chvt 7
        ;;
esac

Put this script in a file in your /etc/pm/sleep.d/ directory, for example 99_vthack, and make it executable:

sudo chmod 755 /etc/pm/sleep.d/99_vthack 

The 99_ means that this script is run at the end of the resume sequence.

This hack seems to work in a series of AMD-based laptops. YMMV...