Login loop Ubuntu 14.04 after installing CUDA 8.0


I recently installed CUDA 8.0 on my Ubuntu 14.04 and everything was working fine until I rebooted the computer and it is now stuck in a login loop. I heard that there is some incompatibility between Nvidia drivers and ubuntu which causes this problem. I have an GeForce GT 650M GPU I would appreciate any help.

To add a bit more information, when I execute sudo lshw -C display it says that my 650M is UNCLAIMED. and when I do nvidia-setting it shows an error saying that the control display is undefined.


I’m facing the same issue on Ubuntu 16.04. It would be great if NVIDIA can provide a trusted solution for this nagging problem.

For any mobile GPUs, (e.g. GTX 650M, GT 740M, etc) you should install nvidia-prime along with the desired nvidia driver version and the relevant CUDA libraries.

For example, for installing nvidia driver version 381 via the package manager version on Ubuntu, you would do:

sudo apt-get install nvidia-381 nvidia-prime libcuda1-381

You might have to explicitely enable the nvidia card via


after it is installed.

Please reference the Linux installer guide in general:

If the driver was installed via run-file method, you MUST uninstall it before issuing the above commands.