6

My computer seems to have issues suspending and resuming properly. Most recently, it resumed from hibernate, was working fine until I started logging in, and then X froze completely. I can log in via SSH (and it works flawlessly when I do), and I'd love to reset it without restarting the whole computer, and preferably without crashing all my open applications.

Is this doable? If I have to crash the open apps, that's OK too, I suppose, but not preferred.

5 Answers 5

4

I know hibernation still has a lot of issues with a wide variety of hardware in Ubuntu. You can restart X I believe with service gdm restart (or /etc/init.d/gdm restart) you should be able to get X reset. If you use Kubuntu or KDE you'll want to use service kdm restart (or /etc/init.d/kdm restart)

2
  • in 10.04 you can do service gdm restart
    – Joshua
    Aug 9, 2010 at 19:08
  • I suppose that is correct - service has been around for a while but Ubuntu is trying to push people away from using /etc/init.d/ in favor of service I'll update my answer. Aug 9, 2010 at 19:14
4

Since the computer is not locked up, Alt+SysRq+k should kill/restart your X server. Type it on the X VT not on a console VT.

2
  • Good answer, SysRq is designed to work, regardless of system state - en.wikipedia.org/wiki/Magic_SysRq_key
    – invert
    Aug 10, 2010 at 10:46
  • 1
    SysRq is often located on the Print Screen (or "Prnt Scrn") key, especially on laptops, so you might have to press Alt + PrntScrn + k. Aug 11, 2010 at 17:49
0

Technically, with these kinds of "X freeze" issues, it's actually not that X itself froze up, but rather that the GPU on the video card locked up for some reason, and thus X could no longer update graphics on it.

So because of that, resetting X generally isn't going to solve the problem. Like the prior two commenters mentioned, several easy ways exist to restart X such as restarting gdm or kdm, or turning on ctrl-alt-backspace and using that key combo. But next time "X freezes", go ahead and try them, and I'll bet it has no effect.

The problem really is deeper down in the stack, at the kernel level. Possibly if you closed X, unloaded and reloaded all the kernel graphics drivers, then restarted X it'd come up. But in restarting X you lose all your apps. So other than an interesting test, it's probably faster and safer to just do a full reboot.

You didn't mention which video driver you're using, but with for instance the Intel video driver, the GPU is handled by code in the Linux kernel itself. Some developers have been experimenting with adding a "GPU reset" feature in the kernel that will automatically clear the GPU's memory and re-initialize it when it seems to no longer be responding to graphics commands. This reset functionality is new and doesn't always work in all cases for various reasons, and isn't (yet) available for the nouveau or ati open source video drivers. Hopefully it'll be coming soon.

If you're using a proprietary driver like nvidia or fglrx, well all bets are off. Check the forums for those drivers for tips.

0

Btw, you said "X froze completely" which if true my previous answer applies. However, a common failure mode I've seen is a problem where when the lid closes the screen goes blank and doesn't come back, however X is not frozen in this case - all the GUI apps still run and produce noise and so on. You just don't see anything on the screen.

In this case, it's a very different problem - the graphics card is able to send graphics to several different "outputs" (E.g. LVDS, DVI, VGA, TV-out) but only two "pipes" at one time. Sometimes it chooses the wrong output to send data to. So initially graphics is sent to the laptop panel (LVDS), you close the lid, reopen it, and now graphics are being sent to the TV-out output, even if you don't actually have a physical TV-out port in the laptop itself!

The fix in this case is generally to force-off the wayward output. It used to be you could just put something in your xorg.conf to do this, but now with kernel mode-setting it's not so easy. In any case, I've documented both methods at https://wiki.ubuntu.com/X/Quirks if you want to know the gritty details of how to do it.

1
  • Luckily, in this case, it's not a laptop, but this is interesting. I didn't know this was ever a problem.
    – mlissner
    Aug 9, 2010 at 16:27
0

If you need to restart X frequently you can do it with the Key combo Control + Alt + Backspace. It used to be enabled by default on Ubuntu but they have disabled it since 9.04 version I guess.

To re-enable it:

  • Select “System”->”Preferences”->”Keyboard”
  • Select the “Layouts” tab and click on the “Options” button.
  • Select “Key sequence to kill the X server” and enable Control + Alt + Backspace.

I suggest you keep looking to find the root of your problem since this is just a paliative, but should help you for now.

1
  • 1
    If I'm not mistaken that won't work since the X session (and the keyboard commands) are locked up. Aug 9, 2010 at 1:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .