Ubuntu 14.04 LTS randomly freezes (graphics/unity only) [duplicate]

When I'm just chilling on the desktop or doing whatever, Ubuntu 14.04 LTS will (every 10-20 minutes or so) just randomly freeze. The screen just stops, I can't see my mouse move, etc. However, I can Alt+Ctrl+F1 into a tty terminal (though it's not much use).

However, I noticed that if I close my laptop's lid, re-open it, then enter my password to unlock the lock screen, everything is fine.

What is going on here? How can I fix / stop / prevent this?

Note: My laptop has an nvidia-optimus setup, but Ubuntu 14.04 LTS automatically recognized it and had the nvidia drivers applied.


This may be the cause of your problems: Nvidia-Prime Freeze

Theese two things have worked for me so far; either:

  1. Disable touchpad in: System settings -> Mouse & Touchpad -> "off" and use a regular USB mouse.

  2. Install nvidia-prime sudo apt-get install nvidia-prime, find "Nvidia Settings" in dash, and under "Prime Profiles" choose "Intel(Power saving mode)"

The latter disables your dedicated graphics card, but works well for all the day-to-day tasks. Also, this made my computer a lot quieter (and surely less power consuming) which is comfortable when you are just browsing the web anyway...

Hope this helps :)