14.04 login loop after cuda installation

1- First, you must uninstall nvidia packages. apt-get purge nvidia-*
2- Try re-install ubuntu-desktop.
3- Reconfigure lightdm package. (dpkg-reconfigure lightdm)
4- Reboot

It must work, if not; try modprobe nouveau to load nouveau kernel module


I also encounter the same problem. So I switch to TTY (Ctrl+Alt+F1) and created a new user and found out that I can login using the new user. Then I realize that if I use the new user's $HOME/.profile, I can login too. Finally, the problem lies in the $HOME/.profile, LD_LIBRARY_PATH=\*/cuda\*:\*/nvidia\*:$LD_LIBRARY_PATH

It turns out that if your current graphics card is not compatible with the Nvidia driver or CUDA library, login will crash the X session. It seems like a bug in the gnome-session.

Your case might be different though.

My problem now solved.