I have had the same problem for a long time and I think I have found the solution. I have Ubuntu 14.04 LTS, my graphic card is Nvidia GTX 860M. The problem of black screen or freezing on the splash screen is related to nvidia-drivers and openGL libraries that cuda installs alongside.
So here what happens:
- First you install the graphic card driver which has 3xx.yy version. For me it was 346.82 (proprietary, tested). Usually, after this step you should not have OS loading problems.
- Next when you take the .deb package which has all dependencies. This dependency is really huge and long, so nobody bothers to look what actually it tries to install. What it does is it installs nvidia drivers again. For me it was the same version 346. Here the subtle difference comes up. It installs 346.00 version and overrides previous installation of the 346.82. Usually, xxx.something means that it was patched several times and bugs were fixed. Cuda installation rolls back to initial 346.00 where a lot of bugs exist.
- Alongside with Nvidia drivers it also installs lib-mesa which overrides the openGL files installed by previous Nvidia driver installation.
This problem is described here:
http://developer.download.nvidia.com/compute/cuda/7_0/Prod/doc/CUDA_Getting_Started_Linux.pdf
in the section "RUNFILE INSTALLATION" subsection 4.2. Here what it says:
"Installing Mesa may overwrite the /usr/lib/libGL.so that was previously
installed by the NVIDIA driver, so a reinstallation of the NVIDIA driver might be
required after installing these libraries."
This made me dig into that direction and find out the problem causing all this crap with freezing OS.
THE BOTTOM LINE
Whenever you install cuda either by *.deb or *.run files, make sure you apply correct nvidia driver before restarting your PC. After this OS should load properly + you can use nvcc compiler to compile and run cuda programs. (g++ installation may be required separately, depends how you install cuda).
For me it worked well. Hope it will help you too.
Additional steps:
If you have discrepancy between Nsight versions that you run from terminal and application launcher. Here are the steps to fix this:
ls ~/.local/share/
in my case I have got
chrome-aohghmighlieiainnegkcijnfilokake-Default.desktop
chrome-apdfllckaahabafndbhieahigkjlhalf-Default.desktop
chrome-blpcfgokakmgnkcojhhkbfbldkacnbeo-Default.desktop
chrome-coobgpohoikkiipiblmjeljniedjpjpf-Default.desktop
chrome-pdabfienifkbhoihedcgeogidfmibmhp-Default.desktop
chrome-pjkljhegncpnkpknbcohdijeoejaedia-Default.desktop
jetbrains-idea.desktop
mimeapps.list
**nsight.desktop**
nvvp.desktop
**org_eclipse_equinox_launcher_1_3_0_v20120522-1813_jar.desktop**
Make sure that Exec=/usr/local/cuda/bin/nsight TryExec=/usr/local/cuda/bin/nsight
point to the cuda installation path. Also check if org_eclipse** is not used instead of nsight.
Best Answer
You can install your driver via the package manager :
Open a terminal (Ctrl+Alt+T) and :
Remove old
nvidia
packages :Install
nvidia-340
driver :