Ubuntu – Ubuntu 14.04 and Nvidia GeForce (840M) compatability on 64-bit laptop

14.04driversgraphicslaptopnvidia

My laptop diagnostic shows several pre-fails and has other issues so I am urgently shopping for a new laptop, my second using Ubuntu. I need a laptop with good graphics capabilities and have come across a couple with the Nvidia GeForce 840M graphics card. In other words, I do not have a problem now and am hoping to avoid one.

My research on Ask Ubuntu and elsewhere shows that there have been some bugs with Ubuntu 14.04 and Nvidia drivers (not just for the 840M driver) but that fixes were made or a least suggested. But I have seen nothing definitive, e.g. the Ubuntu Certification for laptops is barely starting with 14.04.

I am about to spend a 1000 dollars and would love a little more assurance before I proceed — my understanding is that a Live CD cannot perform a full simulation. Are there easy-to-recognize concrete factors which make compatibility (more) predictable, such as specific models of computer and their processors?

I am a considering a MSI GP60 with an Intel i5 4200M and an ASUS n56jn-mb71 with an Intel i7 4700HQ. Both use an Nvidia 840M graphics card.

Best Answer

I had a very similar problem and spent several days trying to get my card working.

I have an ASUS X550LN which has an Intel Graphics Driver on the CPU and a dedicated NVIDIA GEFORCE GT 840M.

First, installing the nvidia-340 drivers would cause Unity and Gnome to fail when launching. I could drop to a shell Ctrl + Alt + F1 and remove the driver sudo apt-get remove nvidia* to get things back to running solely on the Intel Graphics Driver.

After some research, I discovered that having both these interfaces made the system an NVIDIA Optimus (which is actually good just not well supported on Linux yet). Luckily, there is a project called Bumblebee which will help. More info here: https://wiki.ubuntu.com/Bumblebee

Here is what finally worked for me:

  1. Install bumbleebee

    • Add bumblebee repository: add-apt-repository ppa:bumblebee/stable
    • Update repository information: apt-get update
    • Install packages: apt-get install bumblebee bumblebee-nvidia virtualgl linux-headers-generic
    • Reboot

For me, at this point bumblebee was installed but the nvidia-304 package was installed as this is what is installed with nvidia-current. Looking online I found that I needed Driver 337+. At the time of writing this, the best driver for me was nvidia-340. This however is not in the default repo so you will need to add another one.

  1. Install correct nvidia driver

    • Add xorg-edgers repository: add-apt-repository ppa:xorg-edgers/ppa
    • Update repository information: apt-get update
    • Install nvidia-xxx drivers (for 840m it was nvidia-340): apt-get install nvidia-xxx

For me I got an error message the first time I ran apt-get install nvidia-xxx. However, simply running it again worked fine. I'm not 100% sure what happened.

  1. Configure bumblebee to use latest driver

    • Using your favorite text editor open /etc/bumblebee/bumblebee.conf
    • Find the line starting with Driver and change it to Driver=nvidia
    • Find the line starting with KernelDriver and change it to KernelDriver=nvidia-xxx
    • Find the line starting with LibraryPath and change it to LibraryPath=/usr/lib/nvidia-xxx:/usr/lib32/nvidia-xxx
    • Find the line starting with XorgModulePath and change it to XorgModulePath=/usr/lib/nvidia-xxx/xorg,/usr/lib/xorg/modules

Basically, replace all of the nvidia bits with the nvidia driver you installed in step 2.

  1. Reboot

After rebooting, hopefully you are able to access Unity, Gnome, or whatever display manager you're using.

  1. Test that everything is working
    • First test without using NVIDIA card: glxspheres
    • Second test with NVIDIA card: optirun glxspheres

I hope this works for the next person!