Install CUDA-9 on Ubuntu 16.04 with the runfile and pre-installed drivers

Hello everybody,

I am trying desperatly to install cuda on my computer. The computer has a GTX 1060 graphic card. I have installed the drivers via the Software Center > Additional software.

As stated by the command:

cat /proc/driver/nvidia/version
NVRM version: NVIDIA UNIX x86_64 Kernel Module  384.81  Sat Sep  2 02:43:11 PDT 2017
GCC version:  gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.5)

The version 384.81 is installed.

But when I execute the runfile for CUDA-9

wget 'https://developer.nvidia.com/compute/cuda/9.0/Prod/local_installers/cuda_9.0.176_384.81_linux-run' -O cuda-run
sudo sh cuda-run
Do you accept the previously read EULA?
accept/decline/quit: accept

Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 384.81?
(y)es/(n)o/(q)uit: n

Install the CUDA 9.0 Toolkit?
(y)es/(n)o/(q)uit: y

Enter Toolkit Location
 [ default is /usr/local/cuda-9.0 ]: 

Do you want to install a symbolic link at /usr/local/cuda?
(y)es/(n)o/(q)uit: y

Install the CUDA 9.0 Samples?
(y)es/(n)o/(q)uit: n

Installing the CUDA Toolkit in /usr/local/cuda-9.0 ...

===========
= Summary =
===========

Driver:   Not Selected
Toolkit:  Installed in /usr/local/cuda-9.0
Samples:  Not Selected

Please make sure that
 -   PATH includes /usr/local/cuda-9.0/bin
 -   LD_LIBRARY_PATH includes /usr/local/cuda-9.0/lib64, or, add /usr/local/cuda-9.0/lib64 to /etc/ld.so.conf and run ldconfig as root

To uninstall the CUDA Toolkit, run the uninstall script in /usr/local/cuda-9.0/bin

Please see CUDA_Installation_Guide_Linux.pdf in /usr/local/cuda-9.0/doc/pdf for detailed information on setting up CUDA.

***WARNING: Incomplete installation! This installation did not install the CUDA Driver. A driver of version at least 384.00 is required for CUDA 9.0 functionality to work.
To install the driver using this installer, run the following command, replacing <CudaInstaller> with the name of this run file:
    sudo <CudaInstaller>.run -silent -driver

Logfile is /tmp/cuda_install_12582.log

CUDA is never installed because the script does not detect the NVidia driver. I don’t know what to do more…

CUDA is installed.

Set your PATH and LD_LIBRARY_PATH variables correctly.

This is not completely installed, see this command:

./bin/x86_64/linux/release/deviceQuery
./bin/x86_64/linux/release/deviceQuery Starting...

 CUDA Device Query (Runtime API) version (CUDART static linking)

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

I have compiled the samples and this is the output when I try to execute simply the deviceQuery

I have linked CUDA with ldconfig by doing this

This is my ldconfig output:

sudo ldconfig -p | grep libcuda
echo '/usr/local/cuda-9.0/lib64' | sudo tee -a /etc/ld.so.conf.d/cuda.conf
sudo ldconfig
libcudart.so.9.0 (libc6,x86-64) => /usr/local/cuda-9.0/lib64/libcudart.so.9.0
libcudart.so (libc6,x86-64) => /usr/local/cuda-9.0/lib64/libcudart.so

And this is my $PATH:

/home/paul/bin:/home/paul/.local/bin:/usr/local/cuda/bin:/home/paul/bin:/home/paul/.local/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin

One last output:

ls /usr/local/cuda-9.0/lib64/
libaccinj64.so          libcufft.so.9.0        libcurand_static.a      libnppial.so.9.0       libnppidei_static.a  libnppist.so.9.0      libnpps_static.a              libnvToolsExt.so
libaccinj64.so.9.0      libcufft.so.9.0.176    libcusolver.so          libnppial.so.9.0.176   libnppif.so          libnppist.so.9.0.176  libnvblas.so                  libnvToolsExt.so.1
libaccinj64.so.9.0.176  libcufft_static.a      libcusolver.so.9.0      libnppial_static.a     libnppif.so.9.0      libnppist_static.a    libnvblas.so.9.0              libnvToolsExt.so.1.0.0
libcublas_device.a      libcufftw.so           libcusolver.so.9.0.176  libnppicc.so           libnppif.so.9.0.176  libnppisu.so          libnvblas.so.9.0.176          libOpenCL.so
libcublas.so            libcufftw.so.9.0       libcusolver_static.a    libnppicc.so.9.0       libnppif_static.a    libnppisu.so.9.0      libnvgraph.so                 libOpenCL.so.1
libcublas.so.9.0        libcufftw.so.9.0.176   libcusparse.so          libnppicc.so.9.0.176   libnppig.so          libnppisu.so.9.0.176  libnvgraph.so.9.0             libOpenCL.so.1.0
libcublas.so.9.0.176    libcufftw_static.a     libcusparse.so.9.0      libnppicc_static.a     libnppig.so.9.0      libnppisu_static.a    libnvgraph.so.9.0.176         libOpenCL.so.1.0.0
libcublas_static.a      libcuinj64.so          libcusparse.so.9.0.176  libnppicom.so          libnppig.so.9.0.176  libnppitc.so          libnvgraph_static.a           stubs
libcudadevrt.a          libcuinj64.so.9.0      libcusparse_static.a    libnppicom.so.9.0      libnppig_static.a    libnppitc.so.9.0      libnvrtc-builtins.so
libcudart.so            libcuinj64.so.9.0.176  libnppc.so              libnppicom.so.9.0.176  libnppim.so          libnppitc.so.9.0.176  libnvrtc-builtins.so.9.0
libcudart.so.9.0        libculibos.a           libnppc.so.9.0          libnppicom_static.a    libnppim.so.9.0      libnppitc_static.a    libnvrtc-builtins.so.9.0.176
libcudart.so.9.0.176    libcurand.so           libnppc.so.9.0.176      libnppidei.so          libnppim.so.9.0.176  libnpps.so            libnvrtc.so
libcudart_static.a      libcurand.so.9.0       libnppc_static.a        libnppidei.so.9.0      libnppim_static.a    libnpps.so.9.0        libnvrtc.so.9.0
libcufft.so             libcurand.so.9.0.176   libnppial.so            libnppidei.so.9.0.176  libnppist.so         libnpps.so.9.0.176    libnvrtc.so.9.0.176

I don’t see libcuda there, so I think that cuda is not fully installed.

libcuda isn’t supposed to be installed there. It gets placed somewhere else by the driver installer.

Your driver install is broken. You did this:

“I have installed the drivers via the Software Center > Additional software.”

When you should have installed the driver that came with the toolkit installer.

read the linux install guide

Ok I will try that tomorrow probably. Come back to you soon.

read the linux install guide carefully. Now that you have installed drivers via the package manager method (effectively what the Software Center does) you either need to install the CUDA toolkit using the package manager method, or if you install via the runfile installer, you will need to carefully back out the package manager install of the driver, before switching to the CUDA runfile installer (what you have indicated above).

I effectively had to remove the nvidia drivers from the package manager, that means to go back to the “Nouveau” ones.

After that I have blacklisted the “Nouveau” drivers and restarted without graphical interface with this command:

systemctl set-default multi-user.target

Then I have installed the NVidia drivers and CUDA with the installation script and it worked.

Thank you very much.

tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module(’_pywrap_tensorflow_internal’, fp, pathname, description)
ImportError: libcublas.so.9.0: cannot open shared object file: No such file or directory

Failed to load the native TensorFlow runtime.

os :ubuntu17.10
drive :390.25
cuda-9.1
python 2.7
tensorflow 1.5 or 1.6

os :ubuntu17.10
drive :390.25
cuda-9.1
cudnn-7 or 7.1
python 2.7
tensorflow 1.5 or 1.6

why?

tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module(’_pywrap_tensorflow_internal’, fp, pathname, description)
ImportError: libcublas.so.9.0: cannot open shared object file: No such file or directory

Failed to load the native TensorFlow runtime.

you’ve got CUDA 9.1 but TF is looking for CUDA 9.0

you actually need CUDA 9.0 not CUDA 9.1

I had the same problem so i 1st removed all my drivers and then i tried to reinstall them s given in the guide but then it gets stuck at
*** sudo add-apt-repository ppa:graphics-drivers/ppa ***
after i run this it doesnt move ahead at all it just remain there
what should i do ??!!? pls help

That’s not part of any NVIDIA provided or suggested install procedure.

  1. Do a clean load of the OS
  2. Get your installers from http://www.nvidia.com/getcuda
  3. Follow the instructions in the NVIDIA linux install guide (carefully):

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

I am getting this error:

Installing the NVIDIA display driver…
The driver installation has failed due to an unknown error. Please consult the driver installation log located at /var/log/nvidia-installer.log.

===========
= Summary =

Driver: Installation Failed
Toolkit: Installation skipped
Samples: Installation skipped

Logfile is /tmp/cuda_install_9849.log

this is my result from nvidia-smi
nvidia-smi
Sat Oct 13 16:35:34 2018
±----------------------------------------------------------------------------+
| NVIDIA-SMI 396.54 Driver Version: 396.54 |
|-------------------------------±---------------------±---------------------+
| 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 47C P8 N/A / N/A | 181MiB / 2004MiB | 14% Default |
±------------------------------±---------------------±---------------------+

±----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 1180 G /usr/lib/xorg/Xorg 82MiB |
| 0 1356 G /usr/bin/gnome-shell 87MiB |
| 0 1936 G /usr/lib/firefox/firefox 1MiB |
| 0 2164 G /usr/lib/firefox/firefox 1MiB |
| 0 3290 G gnome-control-center 5MiB |
±----------------------------------------------------------------------------+

Hi,
I installed Nvidia driver 390.77 on my system successfully via the Software Center > Additional software. Now when I try to install CUDA, the following error occurs:
Warning: Incomplete installation! This installation did not install the CUDA driver. A driver of version at least 384.00 is required for CUDA 9.1 functionality to work.

And I’m sure that the version of installed Nvidia driver is greater than 384.00!! Because when I use nvidia-smi command, it shows that the version of my my Nvidia driver is 390.77

Any suggestion? :(
Thanks in advance

Ubuntu: 18.04
Geforce GTX 750Ti
Nvidia driver: 390.77
CUDA: 9.1.85

I use ubuntu 16.04 after downloading cuda 10.1 from here https://developer.nvidia.com/cuda-10.1-download-archive-base?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1604&target_type=runfilelocal
I find this

Driver:   Not Selected
Toolkit:  Installed in /usr/local/cuda-10.1/
Samples:  Installed in /home/hp/, but missing recommended libraries

Please make sure that
 -   PATH includes /usr/local/cuda-10.1/bin
 -   LD_LIBRARY_PATH includes /usr/local/cuda-10.1/lib64, or, add /usr/local/cuda-10.1/lib64 to /etc/ld.so.conf and run ldconfig as root

To uninstall the CUDA Toolkit, run cuda-uninstaller in /usr/local/cuda-10.1/bin

Please see CUDA_Installation_Guide_Linux.pdf in /usr/local/cuda-10.1/doc/pdf for detailed information on setting up CUDA.
***WARNING: Incomplete installation! This installation did not install the CUDA Driver. A driver of version at least 418.00 is required for CUDA 10.1 functionality to work.
To install the driver using this installer, run the following command, replacing <CudaInstaller> with the name of this run file:
    sudo <CudaInstaller>.run --silent --driver

Logfile is /var/log/cuda-installer.log