The Ubuntu repositories now host CUDA packages. These may not be latest and greatest, but I find them to work well with the NVIDIA drivers from the same place. Also, they are very easy to install compared to the packages from the NVIDIA website.
xyzis the version. Pick the largest number version that is available from the repositories. For example:
$ sudo apt install nvidia-331
The installation process compiles the driver for your particular Linux kernel and deploys that module. Restart the computer once the install is done.
You must be able to see a NVIDIA module when you list the kernel modules. For example, on my computer:
$ dkms status nvidia-331, 331.38, 3.13.0-24-generic, x86_64: installed
nvidia-cuda-toolkitwill pull in all the hundred other CUDA packages and tools that are needed:
$ sudo apt install nvidia-cuda-toolkit
That is it, enjoy your CUDA programming! :)
Tried with: Linux kernel 3.13.0-24-generic, CUDA 5.5, NVIDIA driver 331, NVIDIA GTX Titan and Ubuntu 14.04