Reputation: 313
Installing TensorFlow with GPU on Ubuntu 14.04. Fairly new to the Ubuntu/UNIX environment so lots of things I don't get. When searching this issue, I came across instances of being unable to import CUDA 7.0 when they have CUDA 7.5 installed (since TensorFlow doesn't support 7.5). I have CUDA 7.0 installed, but it seems to be looking for 7.5 - why is this? I have in my .bashrc file the following lines:
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda-7.0/lib64"
export CUDA_HOME=/usr/local/cuda-7.0
But I'm still seeing the issue below... Anyone have any advice?
>>> import tensorflow as tf
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/ford/tensorflow/local/lib/python2.7/site-packages/tensorflow/__init__.py", line 23, in <module>
from tensorflow.python import *
File "/home/ford/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/__init__.py", line 49, in <module>
from tensorflow import contrib
File "/home/ford/tensorflow/local/lib/python2.7/site-packages/tensorflow/contrib/__init__.py", line 23, in <module>
from tensorflow.contrib import layers
File "/home/ford/tensorflow/local/lib/python2.7/site-packages/tensorflow/contrib/layers/__init__.py", line 68, in <module>
from tensorflow.contrib.layers.python.layers import *
File "/home/ford/tensorflow/local/lib/python2.7/site-packages/tensorflow/contrib/layers/python/layers/__init__.py", line 22, in <module>
from tensorflow.contrib.layers.python.layers.initializers import *
File "/home/ford/tensorflow/local/lib/python2.7/site-packages/tensorflow/contrib/layers/python/layers/initializers.py", line 24, in <module>
from tensorflow.python.ops import random_ops
File "/home/ford/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/ops/random_ops.py", line 23, in <module>
from tensorflow.python.framework import ops
File "/home/ford/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 39, in <module>
from tensorflow.python.framework import versions
File "/home/ford/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/framework/versions.py", line 22, in <module>
from tensorflow.python import pywrap_tensorflow
File "/home/ford/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 28, in <module>
_pywrap_tensorflow = swig_import_helper()
File "/home/ford/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow', fp, pathname, description)
ImportError: libcudart.so.7.5: cannot open shared object file: No such file or directory
Upvotes: 7
Views: 13183
Reputation: 2827
If you're using the latest r0.7 binaries, in my experience they are now built to support CUDA 7.5 by default...whereas r0.6 binaries worked with CUDA 7.0
You can build tensorflow from source to work with CUDA 7.0 instead, see the documentation here Configure TensorFlow's canonical view of Cuda libraries
$ ./configure
Please specify the location of python. [Default is /usr/bin/python]:
Do you wish to build TensorFlow with GPU support? [y/N] y
GPU support will be enabled for TensorFlow
Please specify the Cuda SDK version you want to use, e.g. 7.0. [Leave
empty to use system default]: 7.0
Please specify the location where CUDA 7.0 toolkit is installed. Refer to
README.md for more details. [default is: /usr/local/cuda]: /usr/local/cuda
Please specify the Cudnn version you want to use. [Leave empty to use system
default]: 4.0.4
Please specify the location where the cuDNN 4.0.4 library is installed. Refer to
README.md for more details. [default is: /usr/local/cuda]: /usr/local/cudnn-r4-rc/
Please specify a list of comma-separated Cuda compute capabilities you want to
build with. You can find the compute capability of your device at:
https://developer.nvidia.com/cuda-gpus.
Please note that each additional compute capability significantly increases your
build time and binary size. [Default is: \"3.5,5.2\"]: 3.5
Setting up Cuda include
Setting up Cuda lib64
Setting up Cuda bin
Setting up Cuda nvvm
Configuration finished
Upvotes: 0
Reputation: 26
You need to install tensorflow from SOURCE to configure the settings. Installing by pip or easy_install will not work.
I have the same problem after upgrading tensorflow from 0.6.0 to 0.7.1 using pip.
Upvotes: 1
Reputation: 1
I had the same issue. Have you tried installing CUDA 7.5 alongside 7? That worked for me, and I changed my PATH variables to include 7.5 instead of 7.0
Upvotes: 0