Cuda 9.0 doesn't work with nvidia drivers 390?

For a specific github repo, I need to have Cuda 9.0 installed, but after installing cuda 9.0, I have the following error :

WARNING (theano.sandbox.cuda): CUDA is installed, but device gpu is not available  (error: Unable to get the number of gpus available: CUDA driver version is insufficient for CUDA runtime vers

ion)

Running

dkms status

gives me

nvidia, 390.116, 4.15.0-20-generic, x86_64: installed

while on this page CUDA Compatibility :: NVIDIA Data Center GPU Driver Documentation it’s written that cuda 9.0 should work with any driver higher than 384.81. How to resolve this problem ?

Also, nvidia-smi gives me this :
±----------------------------------------------------------------------------+
| NVIDIA-SMI 390.116 Driver Version: 390.116 |
|-------------------------------±---------------------±---------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce GTX 960M Off | 00000000:01:00.0 Off | N/A |
| N/A 47C P0 N/A / N/A | 229MiB / 2004MiB | 1% Default |
±------------------------------±---------------------±---------------------+

±----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 1000 G /usr/lib/xorg/Xorg 134MiB |
| 0 1351 G cinnamon 39MiB |
| 0 7164 G …quest-channel-token=9804398768622531560 54MiB |
±----------------------------------------------------------------------------+

and I downloaded “cuda_9.0.176_384.81_linux.run”

Thank you for your replies

nvcc -V

returns

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2017 NVIDIA Corporation
Built on Fri_Sep__1_21:08:03_CDT_2017
Cuda compilation tools, release 9.0, V9.0.176

Snooping around, my problem seems to be similar to this even though I’m not using tensorflow :
https://devtalk.nvidia.com/default/topic/1042575/cuda-driver-version-is-insufficient-for-cuda-runtime-version/?offset=2#5289688

They mentioning updating my drivers to 396, or downgradind the drivers to 384 but here’s the issue :

running

ubuntu-drivers list

returns only :

nvidia-driver-390

and in driver manager, the only avaiable driver is also nvidia-driver-390. Obviously, running

sudo apt install nvidia-driver-396 l

returns

Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package nvidia-driver-396

and running this, which I don’t understand but was talked about :

sudo add-apt-repository ppa:graphics-drivers/ppa

returns this :

Executing: /tmp/apt-key-gpghome.KA5eDwEJ87/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys 2388FF3BE10A76F638F80723FCAE110B1118213C
gpg: key FCAE110B1118213C: 12 signatures not checked due to missing keys
gpg: key FCAE110B1118213C: "Launchpad PPA for Graphics Drivers Team" not changed
gpg: Total number processed: 1
gpg:              unchanged: 1

which again I don’t understand. Please help me ! I desperately need to be able to do this for my master thesis.

So I have finally figured out how to install drivers 396 (actually I haven’t figured it out, it magically worked at some point), but it’s still the same error… Gonna keep trying but it’s hard not to give up

I never recommend installing NVIDIA drivers from ppa or other sources that are not managed by NVIDIA. It is possible for a NVIDIA driver to be modified by a 3rd party (removing components) with the result that certain kinds of functionality won’t work.

In addition, it seems you are installing on a laptop. Most NVIDIA GPU laptops nowadays are Optimus laptops, which means that they have both an intel “iGPU” and nvidia “dGPU” that together are controlling the display. This makes driver install more complicated. It also makes runtime usage of the dGPU more complicated.

You’re welcome to do what you wish of course. But there are plenty of instructions on how to install a NVIDIA GPU driver available on the web, so I’m not going to repeat that here.

If you think you have everything installed correctly, but its not working on a Optimus laptop, it may be because the dGPU is shut off. You can investigate methods to turn it on, either using your laptop system BIOS, or by investigating methods such as nvidia-prime for linux.