Restarting KDE gracefully from commandline terminal

I have a situation where my graphics driver occasionally messes up (usually when I drag a chrome window), and I need to re-start KDE somewhat gracefully from the Ctl-Alt-F1 terminal. I cannot see what is going on on the screen anymore, so using the GUI is out of the question. I would prefer to not have to reboot every time this happens.

Fixing the issue on why the graphics driver screw up is a separate issue - what I am looking for here is a work-around until I can fix the other. This is also useful when something like nepomuk misbehaves and has a memory leak - running out of memory also cripples a KDE session beyond recovery.

I currently use kdm stop followed by kdm start, but have to Ctl-Alt-Backspace to get things going again. Applications also don’t get shut down gracefully (I suspect).

I guess there really is two questions here:

  1. Is there a more graceful way to restart KDE from the terminal? ($DISPLAY is not set, so qdbus does not work)
  2. Is there a way to re-load or re-initialize the graphics driver without re-starting KDE?

Some background information: I use opensuse 13.1 with an ATI Radeon HD 5700 graphics card. I use the ATI proprietary driver (13.25) so I can get 3D acceleration.

Any ideas and/or suggestions?

Thanks!

Update:
I can reliably reproduce the error by dragging a chrome window.

You shouldn’t have to shutdown and restart KDM.
To kill the KDE session, just kill ksmserver. You should return to KDM then (this has approximately the same effect as pressing Ctrl+Alt+Backspace).
I can’t think of a more graceful way right now when DBUS is out of question.

  1. Is there a way to re-load or re-initialize the graphics driver without re-starting KDE?

Have you tried pressing Shift+Alt+F12 to disable the Desktop effects?

You could also try to kill kwin only:

killall -KILL kwin

Does the display in the KDE session come back then?

Some background information: I use opensuse 13.1 with an ATI Radeon HD 5700 graphics card. I use the ATI proprietary driver (13.25) so I can get 3D acceleration.

13.25? That must be a typo. The current version is 13.12 (13.251). Is that what you have installed?

Update:
I can reliably reproduce the error by dragging a chrome window.

Does the crash also happen if Desktop Effects are disabled?
If not, you could create a Kwin rule to disable Compositing for Chrome as a workaround I guess.