Laptops with Nvidia Optimus have an Nvidia graphics card for high performance and an Intel one for everything else.
This causes conflicts that result in GLX not working. The solution is to install Bumblebee.
Type this in the terminal:
sudo add-apt-repository ppa:bumblebee/stable
sudo apt-get update
sudo apt-get install bumblebee virtualgl linux-headers-generic
sudo shutdown -r now