Installation of cuda 9 under 384 fails

Hello together, I do have an issue since I updated my linux kernel to 4.15. I’m using the 384.130 for my 940mx and also cuda 9.0 was working. But now once I run the samples I get the follwoing error:

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

uname -a output :

Linux ecke 4.15.0-39-generic #42~16.04.1-Ubuntu SMP Wed Oct 24 17:09:54 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

nvidia-smi output:

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 384.130                Driver Version: 384.130                   |
|-------------------------------+----------------------+----------------------+
| 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 940MX       Off  | 00000000:01:00.0 Off |                  N/A |
| N/A   37C    P0    N/A /  N/A |    174MiB /  2002MiB |      5%      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0      1073      G   /usr/lib/xorg/Xorg                           124MiB |
|    0      1824      G   cinnamon                                      48MiB |
+-----------------------------------------------------------------------------+

lspci -v | grep -i nvidia output:

01:00.0 3D controller: NVIDIA Corporation GM108M [GeForce 940MX] (rev a2)
	Kernel driver in use: nvidia
	Kernel modules: nvidiafb, nouveau, nvidia_384_drm, nvidia_384

Can someone help me out of here ?

Thanks and kind regards, Sven

Updating a linux kernel means that any previous GPU driver install is now broken (unless you have enabled DKMS and it is working properly).

Probably the simplest solution is just to reinstall. If there are things you haven’t mentioned, like tried to install other CUDA versions, or other drivers in the meantime, that will certainly negate any of my suggestions. In that case, the simplest solution is probably a full clean and reinstall.

Thanks for your answer. I already reinstalled the driver. That’s part of the output:

nvidia_384:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/4.15.0-39-generic/kernel/drivers/char/drm/

nvidia_384_modeset.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/4.15.0-39-generic/kernel/drivers/char/drm/

nvidia_384_drm.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/4.15.0-39-generic/kernel/drivers/char/drm/

nvidia_384_uvm.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/4.15.0-39-generic/kernel/drivers/char/drm/

depmod....

DKMS: install completed.
Processing triggers for libc-bin (2.23-0ubuntu10) ...
Processing triggers for initramfs-tools (0.122ubuntu8.13) ...
update-initramfs: Generating /boot/initrd.img-4.15.0-39-generic
W: Possible missing firmware /lib/firmware/i915/kbl_guc_ver9_14.bin for module i915
W: Possible missing firmware /lib/firmware/i915/bxt_guc_ver8_7.bin for module i915
Warning: No support for locale: en_US.utf8

So the display driver works, but running the ./deviceQuery file produces still the same error
Running Tensorflow produces the error

ImportError: libcuda.so.1: cannot open shared object file: No such file or directory

Have you done a search on this last error?
It is still indicating problem with the driver:

[url]cuda - Tensorflow cannot open libcuda.so.1 - Stack Overflow
[url]16.04 - libcuda.so.1 not found despite installing CUDA? - Ask Ubuntu

Try booting with the previous kernel image and see if deviceQuery runs. Both links show possible solutions.