Can't install NVIDIA driver to run CUDA

I have installed cuda8 on my GTX 950m Ubuntu 16.04 Laptop.

Running deviceQuery returned:

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

I checked and there was no nvidia folder in the /dev/ directory.

whereis nvidia yields:

nvidia: /usr/lib/nvidia /usr/share/nvidia /usr/src/nvidia-378-378.13/nvidia

Is nvidia driver installed already? I tried installing ./, after doing:

kill your current X server session by typing sudo service lightdm stop or sudo lightdm stop
Enter runlevel 3 by typing sudo init 3 and install your *.run file.
You might be required to reboot when the installation finishes. If not, run sudo service lightdm       
start or sudo start lightdm to start your X server again.

But it caused a login loop, where I couldn’t login again.
I then typed the following comands:

sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update
sudo ubuntu-drivers autoinstall
sudo reboot

I was able to login now, but I am back on square one.
Is Nvidia Driver not installed? what do i do now?

I am in a similar situation. Did you get this resolved?

For Optimus-enabled GPUs (on laptops/ultrabooks,etc) installing nvidia-prime will fix the issue of no display after reboot of installing driver. You might need to remove the driver before attempting to re-install it with prime:

See for example:

My installation already has Nvidia prime. I tried running running that instruction and it shows that the requirements are already satisfied

@Rob, No I haven’t been able to resolve it yet.

My guess is that the CUDA library in the system is an older one.

Try a simple:

sudo apt-get install libcuda1-378

(replace the last 3 digits with whatever driver version you currently have installed)