Installing cuda toolkit on ubuntu 14.04

my computer currently has Geforce GTX 970 on my ubuntu 14.04 and I’m trying to install cuda toolkit so i can program in cuda. However, every time i install the cuda toolkit using

sudo apt-get install nvidia-cuda-toolkit

I can’t log in to my computer and end up in infinite login screen. Then I end up purging every nvidia stuff and reinstall my graphics driver.

I’ve tried three times and failed all three and it’s getting very annoying. How do i install cuda without getting stuck in an infinite login screen?

Have you followed the instructions in the cuda linux getting started guide? There’s usually more to installing cuda than just this:

sudo apt-get install nvidia-cuda-toolkit

Have a look:

http://docs.nvidia.com/cuda/cuda-getting-started-guide-for-linux/index.html#abstract

I have the same issue on multiple Ubuntu 14.04 installations. Having very carefully followed the getting started guide I’m not sure what the problem is. I’ve also purged .Xauthority files, etc. On one machine, the only fix is to reinstall the driver every few days.

To be clear, the issue I’m referring to is being kicked back to the Lightdm greeter login screen after entering a valid password, even though you can do ctrl-F2 to get a terminal and login fine that way.