I have the following Nvidia graphics card in my laptop

ant@Anthill ~> lspci -k | grep -EA2 'VGA|3D'
00:02.0 VGA compatible controller: Intel Corporation 4th Gen Core Processor Integrated Graphics Controller (rev 06)
    Subsystem: Lenovo 4th Gen Core Processor Integrated Graphics Controller
    Kernel driver in use: i915
07:00.0 3D controller: NVIDIA Corporation GK208M [GeForce GT 740M] (rev a1)
    Subsystem: Lenovo GK208M [GeForce GT 740M]
    Kernel modules: nvidiafb, nouveau

I have installed drivers the following way

sudo apt-add-repository ppa:graphics-drivers/ppa
sudo apt-get install nvidia-370 nvidia-prime

And cuda toolkit by downloading cuda-7.5 binary from nvidia official site

sudo ./NVidia-cuda-7.5.run

All these installations were done after shifting to tty and stopping XOrg

sudo service lightdm stop

Now after restarting

ant@Anthill ~> nvidia-smi
NVIDIA-SMI couldn't find libnvidia-ml.so library in your system. Please make sure that the NVIDIA Display Driver is properly installed and present in your system.
Please also try adding directory that contains libnvidia-ml.so to your system PATH.

libnvidia-ml.so is present here

ant@Anthill ~> ls /usr/lib/nvidia-370
alt_ld.so.conf                 libGLX_indirect.so.0@            libnvidia-fatbinaryloader.so.370.28
bin/                           libGLX_nvidia.so.0@              libnvidia-fbc.so.370.28
ld.so.conf                     libGLX_nvidia.so.370.28          libnvidia-glcore.so.370.28
libEGL_nvidia.so.0@            libGLX.so@                       libnvidia-glsi.so.370.28
libEGL_nvidia.so.370.28        libGLX.so.0                      libnvidia-ifr.so@
libEGL.so@                     libnvcuvid.so@                   libnvidia-ifr.so.1@
libEGL.so.1                    libnvcuvid.so.1@                 libnvidia-ifr.so.370.28
libGLdispatch.so.0             libnvcuvid.so.370.28             libnvidia-ml.so@
libGLESv1_CM_nvidia.so.1@      libnvidia-cfg.so@                libnvidia-ml.so.1@
libGLESv1_CM_nvidia.so.370.28  libnvidia-cfg.so.1@              libnvidia-ml.so.370.28
libGLESv1_CM.so@               libnvidia-cfg.so.370.28          libnvidia-ptxjitcompiler.so.370.28
libGLESv1_CM.so.1              libnvidia-compiler.so@           libnvidia-tls.so.370.28
libGLESv2_nvidia.so.2@         libnvidia-compiler.so.1@         libnvidia-wfb.so.370.28
libGLESv2_nvidia.so.370.28     libnvidia-compiler.so.370.28     libOpenGL.so@
libGLESv2.so@                  libnvidia-eglcore.so.370.28      libOpenGL.so.0
libGLESv2.so.2                 libnvidia-egl-wayland.so.370.28  tls/
libGL.so@                      libnvidia-encode.so@             vdpau/
libGL.so.1@                    libnvidia-encode.so.1@           xorg/
libGL.so.1.0.0                 libnvidia-encode.so.370.28

I tried adding this dir to the PATH and LD_LIBRARY_PATH also. Both did not work.


ls /dev | grep nvidia

Yields nothing. That is no devices are present with /dev/nivida*

Any suggestion to get this working? Where does nvidia-smi try to find the libnvidia-ml.so?

  • Not really sure, but I think you should check with the command prime-select. This command will alter the lookup paths for the graphics library for Intel and Nvidia. – Thomas Oct 6 '16 at 18:29
LD_PRELOAD=/usr/lib/nvidia-367/libnvidia-ml.so nvidia-smi
  • I tried to use LD_PRELOAD=/usr/lib/nvidia-375/libnvidia-ml.so nvidia-smi but got NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running. – Rodolfo Jun 20 '17 at 0:23

I was having the same problem.

I realized it was because the nvidia drivers where not loaded during boot, as I was using bumblebee. I found out it ran ok when using optirun.

First make sure that you are using Nvidia drivers not Nouveau, and that you have removed and blacklisted Nouveau drivers

If you have Nvidia drivers already installed switch graphics card by launching NVIDIA X Server Settings and select your Nvidia GPU at PRIME Profiles tab. You might have to restart your session after doing that.


cat /proc/acpi/bbswitch

to make sure that your gpu is switched on if your are using bbswitch, you should get something like:

0000:02:00.0 ON

I think it should run now.


I faced this problem after a driver upgrade.

I fixed it changing the LDCONFIG file:

sudo vi /etc/ld.so.conf.d/cuda-8-0.conf 

With the content


I encountered this problem after some nvidia-docker containers crashed. libnvidia-ml.so presented at /usr/lib/nvidia-<version>, but nvidia-smi kept complaining.

I fixed the problem by sudo ldconfig.real

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.