Help with Freezing Issue

Ok so instead of typing up the issue, I'm having the exact same problem as this guy (the shutting the laptop lid and reopening also works for me).

Quoted from: http://askubuntu.com/questions/464534/ubuntu-14-04-lts-randomly-freezes-graphics-unity-only

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.

However the solution posted is basically a work around more than a solution (use a usb mouse instead of touchpad). I recently managed to get my nvidia gtx 860m to actually work within ubuntu (after about 2 days of frustration) and trying to install other drivers doesn't seem to work at all. I currenlly have the following packages installed:

  • nvidia-331
  • nvidia-settings
  • nvidia-prime

The GPU is being used for graphics processing as shown in this screen shot.

Has anybody had this issue and have a permanent solution ? Or can help me solve it, its driving me mad the system logs show nothing useful. I'm going to continue to research this problem if I find a solution I'll be sure to update.