libcuda.so.1 not found despite installing CUDA?
Sebastian Wright
When running tensorflow on ubuntu 16.04 libcuda.so.1 isn't being found. This file is part of the CUDA tools which I should have installed ; maybe just no the right place? I tried searching for the files via this command:
find / -type f -name "libcuda.so.1
And I get back a list of files (shortened list):
ind: ‘/etc/cups/ssl’: Permission denied
find: ‘/etc/polkit-1/localauthority’: Permission denied
find: ‘/etc/ssl/private’: Permission denied
find: ‘/tmp/systemd-private-bfc953f066c54c8f8989b0585e58681d-colord.service-QhckWW’: Permission denied
find: ‘/tmp/systemd-private-bfc953f066c54c8f8989b0585e58681d-systemd-timesyncd.service-A46ooI’: Permission denied
find: ‘/tmp/systemd-private-bfc953f066c54c8f8989b0585e58681d-rtkit-daemon.service-pZ6U3J’: Permission denied
find: ‘/lost+found’: Permission denied
find: ‘/var/tmp/systemd-private-7216baf4e9e24f4b99aa9cd9d37e9779-rtkit-daemon.service-vEpGYO’: Permission denied
find: ‘/var/tmp/systemd-private-c9508c53c88848febd8d6b9c7758d44d-colord.service-6sVMbw’: Permission denied
find: ‘/var/tmp/systemd-private-7216baf4e9e24f4b99aa9cd9d37e9779-systemd-timesyncd.service-DifcXc’: Permission denied
find: ‘/var/tmp/systemd-private-7216baf4e9e24f4b99aa9cd9d37e9779-colord.service-j5hYyg’: Permission denied
find: ‘/var/tmp/systemd-private-81dcc732570e47799cb04c3cb0c5a2c6-systemd-timesyncd.service-dSg1Cz’: Permission denied
find: ‘/var/tmp/systemd-private-f72e80f0374645bda6c2d99c5628e374-colord.service-FbxlSK’: Permission denied
find: ‘/var/tmp/systemd-private-5065912711c44bfd880f3aca2d0008e7-colord.service-rq0MKq’: Permission denied
find: ‘/var/tmp/systemd-private-bfc953f066c54c8f8989b0585e58681d-rtkit-daemon.service-W2mqTy’: Permission denied
find: ‘/var/tmp/systemd-private-5065912711c44bfd880f3aca2d0008e7-rtkit-daemon.service-Nmhoc5’: Permission denied
find: ‘/var/tmp/systemd-private-bfc953f066c54c8f8989b0585e58681d-colord.service-yD6AKb’: Permission denied
find: ‘/var/tmp/systemd-private-310aa08f8dac48c087fb3d04eb13211d-rtkit-daemon.service-2aRSdk’: Permission denied
find: ‘/var/tmp/systemd-private-cc0e6bd6ee4c4e5a8e66d39c662b4262-systemd-timesyncd.service-cR7tKn’: Permission denied
find: ‘/var/tmp/systemd-private-81dcc732570e47799cb04c3cb0c5a2c6-colord.service-RpnOff’: Permission denied
find: ‘/var/tmp/systemd-private-93e35b4b8e084692829998454c625032-rtkit-daemon.service-FPP0C0’: Permission denied
find: ‘/var/tmp/systemd-private-f72e80f0374645bda6c2d99c5628e374-rtkit-daemon.service-KSb7II’: Permission denied
find: ‘/var/tmp/systemd-private-93e35b4b8e084692829998454c625032-colord.service-umcrrr’: Permission denied
find: ‘/var/tmp/systemd-private-bfc953f066c54c8f8989b0585e58681d-systemd-timesyncd.service-zCbfRG’: Permission denied
find: ‘/var/tmp/systemd-private-cc0e6bd6ee4c4e5a8e66d39c662b4262-rtkit-daemon.service-YUHCBb’: Permission denied
find: ‘/var/tmp/systemd-private-f72e80f0374645bda6c2d99c5628e374-systemd-timesyncd.service-3gwsBe’: Permission denied
find: ‘/var/tmp/systemd-private-c9508c53c88848febd8d6b9c7758d44d-systemd-timesyncd.service-9KAj0J’: Permission denied
find: ‘/var/tmp/systemd-private-81dcc732570e47799cb04c3cb0c5a2c6-rtkit-daemon.service-Lua60R’: Permission denied
find: ‘/var/tmp/systemd-private-cc0e6bd6ee4c4e5a8e66d39c662b4262-colord.service-9wRZuD’: Permission denied
find: ‘/var/tmp/systemd-private-310aa08f8dac48c087fb3d04eb13211d-systemd-timesyncd.service-1IVY9S’: Permission denied
find: ‘/var/tmp/systemd-private-310aa08f8dac48c087fb3d04eb13211d-colord.service-BcEhRd’: Permission deniedI'm not really sure what most of these files mean. Are these files part of the "libcuda" ? Or does this mean libcuda isn't installed.
Thank you.
After listening to what @ravery suggested:
I tried this:
ls /usr/local/cuda-8.0/doc/man/man7/libcuda.so.7 -lawhich gave me an output of this:
-rw-r--r-- 1 root root 26 Jan 26 2017 /usr/local/cuda-8.0/doc/man/man7/libcuda.so.7And if I run nvidia-smi I get back this:
------------------------------------------------------+
| NVIDIA-SMI 340.104 Driver Version: 340.104 |
|-------------------------------+----------------------+----------------------+
| 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 260 Off | 0000:01:00.0 N/A | N/A |
| 40% 46C P12 N/A / N/A | 226MiB / 895MiB | N/A Default |
+-------------------------------+----------------------+----------------------+ +-----------------------------------------------------------------------------+ | Compute processes: GPU Memory | | GPU PID Process name Usage | |=============================================================================| | 0 Not Supported So I have to link my libdua.os.7 to my graphics card driver?
What's the best way to find this driver. Thank you.
I also tried this:
ln -s /usr/local/cuda-8.0/doc/man/man7/libcuda.so.7 /usr/local/cuda/lib/libcuda.so.1output:
failed to create symbolic link '/usr/local/cuda/lib/libcuda.so.1': No such file or directoryEDIT: After playing around for a few days. I'm still stuck.
More info:
If I browse my computer directory, I noticed that there is a CUDA-8.0 at this location:
/usr/local/I also see a CUDA folder with an arrow on it (which I presume represents a shorcut) here in
/usr/localSecond Update:
Running this command:
export PATH=$PATH:/usr/local/cuda-8.0/binNow nvcc --version returns:
vcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2016 NVIDIA Corporation
Built on Tue_Jan_10_13:22:03_CST_2017
Cuda compilation tools, release 8.0, V8.0.61However,
locate libcuda.so.1still returns an empty screen.
24 Answers
I had the same problem on an NVIDIA GPU Cloud Image on a Standard_NV6 on Azure, running inside Docker. For me, the problem was that I was running
docker run -it tensorflow/tensorflow:latest-gpu-py3 bashand I should have run it with the flag --runtime=nvidia or nvidia-docker instead of docker:
nvidia-docker run -it tensorflow/tensorflow:latest-gpu-py3 bash
docker run --runtime=nvidia -it tensorflow/tensorflow:latest-gpu-py3 bash It should link to /usr/local/lib/cuda/lib64/stubs/libcuda.so.1
There might be various issues. Not only with CUDA but with Nvidia-drivers too.
My advice : Install tensorflow-gpu with conda.
If you have installed CUDA9.0, I don't think there is much you can do. Please check tensorflow website for supported CUDA versions.
1these are not files, they are directories that could not be opened due to permissions. Your file won't be there.
libcuda.so.1 is actually a link not a file. It links to your version file:for example, libcuda.so.1 links to libcuda.so.361.42.
The following commands will print the path where your link has to be located and find your version file.
echo $LD_LIBRARY_PATH #path
sudo find /usr/ -name 'libcuda.so.*' #versionIf you find libcuda.so.1, then copy it into your path. If not make a link in your path that points to the version file.
3