How to stop my 12.04 randomly loging me out?

After upgrading from 11.10 to 12.04 I find I am randomly logged out while I am working.

I have no idea why this is happening.

Can anyone suggest why this is happening and perhaps a method to fix this most unproductive of issues?

Thanks.


I had this same issue in Ubuntu 10.10. It was caused by X (the graphical window system) crashing. What graphics card are you using? A good first step is to check if there are proprietary drivers available for your graphics card. Click System Settings -> Additional Drivers.

The thing that finally got it working for me was to enable the X-Updates repo, which has newer drivers, etc.

sudo add-apt-repository ppa:ubuntu-x-swat/x-updates
sudo apt-get update
sudo apt-get upgrade

Reboot.