cudaErrorInsufficientDriver after installing CUDA 9.1 in Ubuntu 17.10

I have installed cuda_9.1.85_387.26_linux.run in an Ubuntu 17.10 64 bit with NVIDIA driver 384.90 following these instructions: https://askubuntu.com/a/967333/671811

I have compiled two examples without problems but when I try to run it I get on both the following error:

code=35(cudaErrorInsufficientDriver) "cudaGetDeviceCount(&device_count)"

I have ran the command nvidia-smi with the following output:

Thu Dec 14 18:25:02 2017       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 384.90                 Driver Version: 384.90                    |
|-------------------------------+----------------------+----------------------+
| 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 970     Off  | 00000000:01:00.0  On |                  N/A |
| 34%   34C    P0    52W / 250W |    303MiB /  4034MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0      1232      G   /usr/lib/xorg/Xorg                            16MiB |
|    0      1274      G   /usr/bin/gnome-shell                          51MiB |
|    0      1518      G   /usr/lib/xorg/Xorg                           112MiB |
|    0      1654      G   /usr/bin/gnome-shell                         115MiB |
|    0      2230      G   /usr/lib/firefox/firefox                       3MiB |
+-----------------------------------------------------------------------------+

I have also ran the following command ldconfig -p | grep -E ‘cuda|nvidia’ with the following output:

libvdpau_nvidia.so (libc6,x86-64, ABI del SO: Linux 2.3.99) => /usr/lib/libvdpau_nvidia.so
	libvdpau_nvidia.so (libc6, ABI del SO: Linux 2.3.99) => /usr/lib32/libvdpau_nvidia.so
	libnvrtc.so.9.1 (libc6,x86-64) => /usr/local/cuda-9.1/lib64/libnvrtc.so.9.1
	libnvrtc.so (libc6,x86-64) => /usr/local/cuda-9.1/lib64/libnvrtc.so
	libnvrtc-builtins.so.9.1 (libc6,x86-64) => /usr/local/cuda-9.1/lib64/libnvrtc-builtins.so.9.1
	libnvrtc-builtins.so (libc6,x86-64) => /usr/local/cuda-9.1/lib64/libnvrtc-builtins.so
	libnvidia-wfb.so.1 (libc6,x86-64) => /usr/lib/nvidia-384/libnvidia-wfb.so.1
	libnvidia-wfb.so.1 (libc6) => /usr/lib32/nvidia-384/libnvidia-wfb.so.1
	libnvidia-tls.so.384.90 (libc6,x86-64, hwcap: 0x8000000000000000, ABI del SO: Linux 2.3.99) => /usr/lib/nvidia-384/tls/libnvidia-tls.so.384.90
	libnvidia-tls.so.384.90 (libc6,x86-64, ABI del SO: Linux 2.2.5) => /usr/lib/nvidia-384/libnvidia-tls.so.384.90
	libnvidia-tls.so.384.90 (libc6, hwcap: 0x8000000000000000, ABI del SO: Linux 2.3.99) => /usr/lib32/nvidia-384/tls/libnvidia-tls.so.384.90
	libnvidia-tls.so.384.90 (libc6, ABI del SO: Linux 2.2.5) => /usr/lib32/nvidia-384/libnvidia-tls.so.384.90
	libnvidia-ptxjitcompiler.so.1 (libc6,x86-64) => /usr/lib/nvidia-384/libnvidia-ptxjitcompiler.so.1
	libnvidia-ptxjitcompiler.so.1 (libc6) => /usr/lib32/nvidia-384/libnvidia-ptxjitcompiler.so.1
	libnvidia-opencl.so.1 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libnvidia-opencl.so.1
	libnvidia-ml.so.1 (libc6,x86-64) => /usr/lib/nvidia-384/libnvidia-ml.so.1
	libnvidia-ml.so.1 (libc6) => /usr/lib32/nvidia-384/libnvidia-ml.so.1
	libnvidia-ml.so (libc6,x86-64) => /usr/lib/nvidia-384/libnvidia-ml.so
	libnvidia-ml.so (libc6) => /usr/lib32/nvidia-384/libnvidia-ml.so
	libnvidia-ifr.so.1 (libc6,x86-64) => /usr/lib/nvidia-384/libnvidia-ifr.so.1
	libnvidia-ifr.so.1 (libc6) => /usr/lib32/nvidia-384/libnvidia-ifr.so.1
	libnvidia-ifr.so (libc6,x86-64) => /usr/lib/nvidia-384/libnvidia-ifr.so
	libnvidia-ifr.so (libc6) => /usr/lib32/nvidia-384/libnvidia-ifr.so
	libnvidia-gtk3.so.384.90 (libc6,x86-64) => /usr/lib/libnvidia-gtk3.so.384.90
	libnvidia-gtk2.so.384.90 (libc6,x86-64) => /usr/lib/libnvidia-gtk2.so.384.90
	libnvidia-glsi.so.384.90 (libc6,x86-64) => /usr/lib/nvidia-384/libnvidia-glsi.so.384.90
	libnvidia-glsi.so.384.90 (libc6) => /usr/lib32/nvidia-384/libnvidia-glsi.so.384.90
	libnvidia-glcore.so.384.90 (libc6,x86-64) => /usr/lib/nvidia-384/libnvidia-glcore.so.384.90
	libnvidia-glcore.so.384.90 (libc6) => /usr/lib32/nvidia-384/libnvidia-glcore.so.384.90
	libnvidia-fbc.so.1 (libc6,x86-64) => /usr/lib/nvidia-384/libnvidia-fbc.so.1
	libnvidia-fbc.so.1 (libc6) => /usr/lib32/nvidia-384/libnvidia-fbc.so.1
	libnvidia-fbc.so (libc6,x86-64) => /usr/lib/nvidia-384/libnvidia-fbc.so
	libnvidia-fbc.so (libc6) => /usr/lib32/nvidia-384/libnvidia-fbc.so
	libnvidia-fatbinaryloader.so.384.90 (libc6,x86-64) => /usr/lib/nvidia-384/libnvidia-fatbinaryloader.so.384.90
	libnvidia-fatbinaryloader.so.384.90 (libc6) => /usr/lib32/nvidia-384/libnvidia-fatbinaryloader.so.384.90
	libnvidia-encode.so.1 (libc6,x86-64) => /usr/lib/nvidia-384/libnvidia-encode.so.1
	libnvidia-encode.so.1 (libc6) => /usr/lib32/nvidia-384/libnvidia-encode.so.1
	libnvidia-encode.so (libc6,x86-64) => /usr/lib/nvidia-384/libnvidia-encode.so
	libnvidia-encode.so (libc6) => /usr/lib32/nvidia-384/libnvidia-encode.so
	libnvidia-eglcore.so.384.90 (libc6,x86-64) => /usr/lib/nvidia-384/libnvidia-eglcore.so.384.90
	libnvidia-eglcore.so.384.90 (libc6) => /usr/lib32/nvidia-384/libnvidia-eglcore.so.384.90
	libnvidia-egl-wayland.so.1.0.1 (libc6,x86-64) => /usr/lib/nvidia-384/libnvidia-egl-wayland.so.1.0.1
	libnvidia-egl-wayland.so.1.0.1 (libc6) => /usr/lib32/nvidia-384/libnvidia-egl-wayland.so.1.0.1
	libnvidia-compiler.so.384.90 (libc6,x86-64) => /usr/lib/nvidia-384/libnvidia-compiler.so.384.90
	libnvidia-compiler.so.384.90 (libc6) => /usr/lib32/nvidia-384/libnvidia-compiler.so.384.90
	libnvidia-compiler.so (libc6,x86-64) => /usr/lib/nvidia-384/libnvidia-compiler.so
	libnvidia-compiler.so (libc6) => /usr/lib32/nvidia-384/libnvidia-compiler.so
	libnvidia-cfg.so.1 (libc6,x86-64) => /usr/lib/nvidia-384/libnvidia-cfg.so.1
	libnvidia-cfg.so.1 (libc6) => /usr/lib32/nvidia-384/libnvidia-cfg.so.1
	libnvidia-cfg.so (libc6,x86-64) => /usr/lib/nvidia-384/libnvidia-cfg.so
	libnvidia-cfg.so (libc6) => /usr/lib32/nvidia-384/libnvidia-cfg.so
	libnvgraph.so.9.1 (libc6,x86-64) => /usr/local/cuda-9.1/lib64/libnvgraph.so.9.1
	libnvgraph.so (libc6,x86-64) => /usr/local/cuda-9.1/lib64/libnvgraph.so
	libnvcuvid.so.1 (libc6,x86-64) => /usr/lib/nvidia-384/libnvcuvid.so.1
	libnvcuvid.so.1 (libc6) => /usr/lib32/nvidia-384/libnvcuvid.so.1
	libnvcuvid.so (libc6,x86-64) => /usr/lib/nvidia-384/libnvcuvid.so
	libnvcuvid.so (libc6) => /usr/lib32/nvidia-384/libnvcuvid.so
	libnvblas.so.9.1 (libc6,x86-64) => /usr/local/cuda-9.1/lib64/libnvblas.so.9.1
	libnvblas.so (libc6,x86-64) => /usr/local/cuda-9.1/lib64/libnvblas.so
	libnvToolsExt.so.1 (libc6,x86-64) => /usr/local/cuda-9.1/lib64/libnvToolsExt.so.1
	libnvToolsExt.so (libc6,x86-64) => /usr/local/cuda-9.1/lib64/libnvToolsExt.so
	libnpps.so.9.1 (libc6,x86-64) => /usr/local/cuda-9.1/lib64/libnpps.so.9.1
	libnpps.so (libc6,x86-64) => /usr/local/cuda-9.1/lib64/libnpps.so
	libnppitc.so.9.1 (libc6,x86-64) => /usr/local/cuda-9.1/lib64/libnppitc.so.9.1
	libnppitc.so (libc6,x86-64) => /usr/local/cuda-9.1/lib64/libnppitc.so
	libnppisu.so.9.1 (libc6,x86-64) => /usr/local/cuda-9.1/lib64/libnppisu.so.9.1
	libnppisu.so (libc6,x86-64) => /usr/local/cuda-9.1/lib64/libnppisu.so
	libnppist.so.9.1 (libc6,x86-64) => /usr/local/cuda-9.1/lib64/libnppist.so.9.1
	libnppist.so (libc6,x86-64) => /usr/local/cuda-9.1/lib64/libnppist.so
	libnppim.so.9.1 (libc6,x86-64) => /usr/local/cuda-9.1/lib64/libnppim.so.9.1
	libnppim.so (libc6,x86-64) => /usr/local/cuda-9.1/lib64/libnppim.so
	libnppig.so.9.1 (libc6,x86-64) => /usr/local/cuda-9.1/lib64/libnppig.so.9.1
	libnppig.so (libc6,x86-64) => /usr/local/cuda-9.1/lib64/libnppig.so
	libnppif.so.9.1 (libc6,x86-64) => /usr/local/cuda-9.1/lib64/libnppif.so.9.1
	libnppif.so (libc6,x86-64) => /usr/local/cuda-9.1/lib64/libnppif.so
	libnppidei.so.9.1 (libc6,x86-64) => /usr/local/cuda-9.1/lib64/libnppidei.so.9.1
	libnppidei.so (libc6,x86-64) => /usr/local/cuda-9.1/lib64/libnppidei.so
	libnppicom.so.9.1 (libc6,x86-64) => /usr/local/cuda-9.1/lib64/libnppicom.so.9.1
	libnppicom.so (libc6,x86-64) => /usr/local/cuda-9.1/lib64/libnppicom.so
	libnppicc.so.9.1 (libc6,x86-64) => /usr/local/cuda-9.1/lib64/libnppicc.so.9.1
	libnppicc.so (libc6,x86-64) => /usr/local/cuda-9.1/lib64/libnppicc.so
	libnppial.so.9.1 (libc6,x86-64) => /usr/local/cuda-9.1/lib64/libnppial.so.9.1
	libnppial.so (libc6,x86-64) => /usr/local/cuda-9.1/lib64/libnppial.so
	libnppc.so.9.1 (libc6,x86-64) => /usr/local/cuda-9.1/lib64/libnppc.so.9.1
	libnppc.so (libc6,x86-64) => /usr/local/cuda-9.1/lib64/libnppc.so
	libicudata.so.57 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libicudata.so.57
	libicudata.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libicudata.so
	libcusparse.so.9.1 (libc6,x86-64) => /usr/local/cuda-9.1/lib64/libcusparse.so.9.1
	libcusparse.so (libc6,x86-64) => /usr/local/cuda-9.1/lib64/libcusparse.so
	libcusolver.so.9.1 (libc6,x86-64) => /usr/local/cuda-9.1/lib64/libcusolver.so.9.1
	libcusolver.so (libc6,x86-64) => /usr/local/cuda-9.1/lib64/libcusolver.so
	libcurand.so.9.1 (libc6,x86-64) => /usr/local/cuda-9.1/lib64/libcurand.so.9.1
	libcurand.so (libc6,x86-64) => /usr/local/cuda-9.1/lib64/libcurand.so
	libcuinj64.so.9.1 (libc6,x86-64) => /usr/local/cuda-9.1/lib64/libcuinj64.so.9.1
	libcuinj64.so (libc6,x86-64) => /usr/local/cuda-9.1/lib64/libcuinj64.so
	libcufftw.so.9.1 (libc6,x86-64) => /usr/local/cuda-9.1/lib64/libcufftw.so.9.1
	libcufftw.so (libc6,x86-64) => /usr/local/cuda-9.1/lib64/libcufftw.so
	libcufft.so.9.1 (libc6,x86-64) => /usr/local/cuda-9.1/lib64/libcufft.so.9.1
	libcufft.so (libc6,x86-64) => /usr/local/cuda-9.1/lib64/libcufft.so
	libcudart.so.9.1 (libc6,x86-64) => /usr/local/cuda-9.1/lib64/libcudart.so.9.1
	libcudart.so (libc6,x86-64) => /usr/local/cuda-9.1/lib64/libcudart.so
	libcuda.so.1 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libcuda.so.1
	libcuda.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libcuda.so
	libcublas.so.9.1 (libc6,x86-64) => /usr/local/cuda-9.1/lib64/libcublas.so.9.1
	libcublas.so (libc6,x86-64) => /usr/local/cuda-9.1/lib64/libcublas.so
	libaccinj64.so.9.1 (libc6,x86-64) => /usr/local/cuda-9.1/lib64/libaccinj64.so.9.1
	libaccinj64.so (libc6,x86-64) => /usr/local/cuda-9.1/lib64/libaccinj64.so
	libOpenGL.so.0 (libc6,x86-64) => /usr/lib/nvidia-384/libOpenGL.so.0
	libOpenGL.so (libc6,x86-64) => /usr/lib/nvidia-384/libOpenGL.so
	libOpenCL.so.1 (libc6,x86-64) => /usr/local/cuda-9.1/lib64/libOpenCL.so.1
	libOpenCL.so (libc6,x86-64) => /usr/local/cuda-9.1/lib64/libOpenCL.so
	libGLdispatch.so.0 (libc6,x86-64) => /usr/lib/nvidia-384/libGLdispatch.so.0
	libGLdispatch.so.0 (libc6) => /usr/lib32/nvidia-384/libGLdispatch.so.0
	libGLX_nvidia.so.0 (libc6,x86-64) => /usr/lib/nvidia-384/libGLX_nvidia.so.0
	libGLX_nvidia.so.0 (libc6) => /usr/lib32/nvidia-384/libGLX_nvidia.so.0
	libGLX.so.0 (libc6,x86-64) => /usr/lib/nvidia-384/libGLX.so.0
	libGLX.so.0 (libc6) => /usr/lib32/nvidia-384/libGLX.so.0
	libGLX.so (libc6,x86-64) => /usr/lib/nvidia-384/libGLX.so
	libGLX.so (libc6) => /usr/lib32/nvidia-384/libGLX.so
	libGLESv2_nvidia.so.2 (libc6,x86-64) => /usr/lib/nvidia-384/libGLESv2_nvidia.so.2
	libGLESv2_nvidia.so.2 (libc6) => /usr/lib32/nvidia-384/libGLESv2_nvidia.so.2
	libGLESv2.so.2 (libc6,x86-64) => /usr/lib/nvidia-384/libGLESv2.so.2
	libGLESv2.so.2 (libc6) => /usr/lib32/nvidia-384/libGLESv2.so.2
	libGLESv2.so (libc6,x86-64) => /usr/lib/nvidia-384/libGLESv2.so
	libGLESv2.so (libc6) => /usr/lib32/nvidia-384/libGLESv2.so
	libGLESv1_CM_nvidia.so.1 (libc6,x86-64) => /usr/lib/nvidia-384/libGLESv1_CM_nvidia.so.1
	libGLESv1_CM_nvidia.so.1 (libc6) => /usr/lib32/nvidia-384/libGLESv1_CM_nvidia.so.1
	libGLESv1_CM.so.1 (libc6,x86-64) => /usr/lib/nvidia-384/libGLESv1_CM.so.1
	libGLESv1_CM.so.1 (libc6) => /usr/lib32/nvidia-384/libGLESv1_CM.so.1
	libGLESv1_CM.so (libc6,x86-64) => /usr/lib/nvidia-384/libGLESv1_CM.so
	libGLESv1_CM.so (libc6) => /usr/lib32/nvidia-384/libGLESv1_CM.so
	libGL.so.1 (libc6,x86-64) => /usr/lib/nvidia-384/libGL.so.1
	libGL.so.1 (libc6) => /usr/lib32/nvidia-384/libGL.so.1
	libGL.so (libc6,x86-64) => /usr/lib/nvidia-384/libGL.so
	libGL.so (libc6) => /usr/lib32/nvidia-384/libGL.so
	libEGL_nvidia.so.0 (libc6,x86-64) => /usr/lib/nvidia-384/libEGL_nvidia.so.0
	libEGL_nvidia.so.0 (libc6) => /usr/lib32/nvidia-384/libEGL_nvidia.so.0
	libEGL.so.1 (libc6,x86-64) => /usr/lib/nvidia-384/libEGL.so.1
	libEGL.so.1 (libc6) => /usr/lib32/nvidia-384/libEGL.so.1
	libEGL.so (libc6,x86-64) => /usr/lib/nvidia-384/libEGL.so
	libEGL.so (libc6) => /usr/lib32/nvidia-384/libEGL.so

It seems that there is a problem with the driver.

Do I need something else to make it work?

384.90 will not work with CUDA 9.1 You need a r387 driver for CUDA 9.1

Get your installers here:

http://www.nvidia.com/getcuda

Follow the instructions here:

http://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html

Thanks but I cannot install the NVIDIA 387 in my Ubuntu 17.10. There is a problem that I don’t understand.

Hi

Have a look at https://launchpad.net/~graphics-drivers/+archive/ubuntu/ppa .

I was able to update to NVIDIA 387 on Ubuntu 17.10, and even CUDA 9.1.

Bent, Oslo, Norway