I got Cuda6 working on Lubuntu 14.04. This already had build-essentials installed, so if you're using a fresh install, you should probably install it:
apt-get install build-essential
Download the cuda6 run package (6.0.37 at the current time of writing) to ~/Downloads: http://developer.download.nvidia.com/compute/cuda/6_0/rel/installers/cuda_6.0.37_linux_64.run
Open up a terminal and extract the separate installers via:
(I tried running the .run file directly, but it kept screwing up my Xorg install and would never let X run. I believe it is a config issue between driver versions: those installed by apt-get nvidia-331-updates and the cuda*.run driver.)
Completely uninstall anything in the ubuntu repositories with nvidia-*. I used synaptic and did a purge, AKA completely uninstall programs and configuration.
sudo apt-get --purge remove nvidia-*
Have these instructions handy as we need to kill X install the driver.
Hit CTL+ALT+F1 to drop to the physical terminal and log in.
sudo service lightdm stop
sudo killall Xorg
Accept the EULA and install the driver. I would recommend letting it update Xorg config files.
After that installer finishes, turn on the nvidia module and install CUDA.
sudo modprobe nvidia
test if the drivers are working by going to your sample directory
sudo chown -R <username>:<usergroup> .
Worked for me at this point.
Now restart X
sudo service lightdm start
You should be able to do
lsmod | grep nv
and see a line with nvidia listed.
Don't forget to log back out of your physical terminal if it all worked.
In my case it was necessary to add the folder that contains the executable to your $PATH.
One way of doing it is to edit the ~/.bashrc file in your Home folder.
Add a line to your .bashrc (modify the location if you changed the default CUDA installation folder)
Save the file and then source your .bashrc by typing
when in your home folder.