CUDA on Ubuntu 14.04 installation problems

Hi.
I am having trouble installing and running CUDA on my 64-bit Ubuntu 14.04.
In the beginning I installed the packages cuda and nvidia-331 from the standard repository but the deviceQuery sample would return that I have more than 14 Million GPU devices running.
Then I tried to install the drivers directly from the NVIDIA website following the description in the according pdf which didn’t work.
Then I followed the description given here:
http://askubuntu.com/questions/451672/installing-and-testing-cuda-in-ubuntu-14-04
which actually worked, but after a few reboots I got a weird black border around my screen which I couldn’t get rid of. Only installing the Ubuntu packages again helped. But then I again got an error from the deviceQuery sample code:

cudaGetDeviceCount returned 35
-> CUDA driver version is insufficient for CUDA runtime version
Result = FAIL

So, now I am kind of lost how to setup and run CUDA on my PC.
Any help is appreciated.

What device? Is it a laptop? In that case ypu need to install bumblee or nvidia primus and run cuda programs with optirun ./cudaprog.