Failed to install tensorflow with Ubuntu 16.04 and CUDA 8.0
NickName:Devymex Ask DateTime:2016-09-29T19:29:25

Failed to install tensorflow with Ubuntu 16.04 and CUDA 8.0

Does anyone successed install TensorFlow with following combination?

  • Ubuntu 16.04 (Just newly installed and apt upgraded)
  • Nvidia Driver: nvidia-370 (sudo apt install nvidia-370)
  • Bazel 0.3.1 (install from official package):

    chmod +x bazel-0.3.1-installer-linux-x86_64.sh
    ./bazel-0.3.1-installer-linux-x86_64.sh --user
    
  • gcc: 5.4.0 (default with 16.04)

  • CUDA 8.0.44 (for GTX 1070, installed from official .run file without driver)

    export CUDA_HOME=/usr/local/cuda-8.0
    export LD_LIBRARY_PATH="$CUDA_HOME/lib64:$LD_LIBRARY_PATH"
    export PATH="$CUDA_HOME/bin:$PATH"
    
  • cuDNN 5.1.5 (installed from official package)

  • tensorflow master (clone from official github)
  • python 2 and python 3 (install from ubuntu official source)

Then run the tensorflow/configure:

./configure
Please specify the location of python. [Default is /usr/bin/python]: /usr/bin/python3
Do you wish to build TensorFlow with Google Cloud Platform support? [y/N] N
No Google Cloud Platform support will be enabled for TensorFlow
Do you wish to build TensorFlow with Hadoop File System support? [y/N] 
No Hadoop File System support will be enabled for TensorFlow
Found possible Python library paths:
  /usr/local/lib/python2.7/dist-packages
  /usr/lib/python2.7/dist-packages
Please input the desired Python library path to use.  Default is [/usr/local/lib/python2.7/dist-packages]
/usr/lib/python3/dist-packages
Do you wish to build TensorFlow with GPU support? [y/N] y
GPU support will be enabled for TensorFlow
Please specify which gcc should be used by nvcc as the host compiler. [Default is /usr/bin/gcc]: 
Please specify the Cuda SDK version you want to use, e.g. 7.0. [Leave empty to use system default]: 8.0
Please specify the location where CUDA 8.0 toolkit is installed. Refer to README.md for more details. [Default is /usr/local/cuda]: 
Please specify the Cudnn version you want to use. [Leave empty to use system default]: 5.1.5
Please specify the location where cuDNN 5.1.5 library is installed. Refer to README.md for more details. [Default is /usr/local/cuda]: 
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"]: 

and run the building:

bazel build -c opt --config=cuda

some error occured immediately:

ERROR: /home/devymex/.cache/bazel/_bazel_devymex/05af4cc48fb50d1cc8f7e879f4c1ce83/external/local_config_cuda/crosstool/BUILD:4:1: Traceback (most recent call last):
    File "/home/devymex/.cache/bazel/_bazel_devymex/05af4cc48fb50d1cc8f7e879f4c1ce83/external/local_config_cuda/crosstool/BUILD", line 4
        error_gpu_disabled()
    File "/home/devymex/.cache/bazel/_bazel_devymex/05af4cc48fb50d1cc8f7e879f4c1ce83/external/local_config_cuda/crosstool/error_gpu_disabled.bzl", line 3, in error_gpu_disabled
        fail("ERROR: Building with --config=c...")
ERROR: Building with --config=cuda but TensorFlow is not configured to build with GPU support. Please re-run ./configure and enter 'Y' at the prompt to build with GPU support.
...

I've tried to:

  • reinstall Ubuntu, many times;
  • reinstall Bazel (from 3party source), many times too.
  • try different Bazel version (0.3.1, 0.3.0, frome official packages)
  • switch to the older CUDA version 8.0.27 (CUDA 7 doesn't support GTX 1070)
  • try different cuda paths "/usr/local/cuda" and "/usr/local/cuda-8.0" (all of them are exist)
  • re-run ./configure many times and re-run bazel build -c opt --config=cuda
  • run "bazel clean" before re-run ./configure
  • re-download offical tensorflow package or re-clone official tensorflow github repo
  • delete path ~/.config/bazel before ./configure
  • python2 and python3
  • I've tried all possible action that may related to this error.

but the error always occured and with identical message.

I've try to use tensorflow r0.10 package (download from git hub), the error message were became to:

ERROR: no such package '@local_config_cuda//crosstool': BUILD file not found on package path.
ERROR: no such package '@local_config_cuda//crosstool': BUILD file not found on package path.

with the tensorflow r0.10, above tried actions has no effect to these two error message.

I'm so frustrated after four days failure. Does someone could help me? Thanks!

I also posted this issue to github: https://github.com/tensorflow/tensorflow/issues/2559

Copyright Notice:Content Author:「Devymex」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/39769050/failed-to-install-tensorflow-with-ubuntu-16-04-and-cuda-8-0

More about “Failed to install tensorflow with Ubuntu 16.04 and CUDA 8.0” related questions

Failed to install tensorflow with Ubuntu 16.04 and CUDA 8.0

Does anyone successed install TensorFlow with following combination? Ubuntu 16.04 (Just newly installed and apt upgraded) Nvidia Driver: nvidia-370 (sudo apt install nvidia-370) Bazel 0.3.1 (install

Show Detail

How to install Tensorflow and Cuda on Ubuntu 16.04 offline?

I am currently looking forward to find the way to install Tensorflow and Cuda on Ubuntu 16.04 offline, but I am not successful yet. The server which I have to manage is in the intranet circumstance...

Show Detail

Failed to build tensorflow 1.4 by bazel on Ubuntu 16.04LTS

Platform: ubuntu 16.04LTS TensorFlow 1.4.0 bazel 0.5.4 cuda 8.0 cudnn 6.0 When I build tensorflow in above conditions as https://www.tensorflow.org/install/install_sources, it occurs such err...

Show Detail

tensorflow-gpu and cuDNN not properly installed on Ubuntu 16.04

I installed CUDA 8.0 on Ubuntu 16.04 (x86_64) with NVidia Geforce GTX 950M (driver 381) in an ASUS K501UX laptop. After CUDA installation, I'm able to run deviceQuery and bandwidthTest, according t...

Show Detail

Install openCV with CUDA toolkit 8.0

I'm trying to install Opencv 3.2.0 and Nvidia CUDA toolkit 8.0 on Ubuntu 16.04 but I can't configure them together. I get the following error when I try to make project using both: CMake Error at ...

Show Detail

Install tensorflow1.2 with CUDA8.0 and cuDNN5.1 shows 'ImportError: libcublas.so.9.0'

I want to install tensorflow1.2 on Ubuntu 16.04 LST, After installing with pip, I test it with import tensorflow as tf in terminal, error shows that ImportError: libcublas.so.9.0: cannot open s...

Show Detail

Installing TensorFlow, where is cuda home on Ubuntu?

Since upgrading to Ubuntu 16.04 I have been forced to use the cuda repository which came with Ubuntu due to issues with new security features in the package manager. I installed cuda using sudo ap...

Show Detail

Tensorflow 1.3 and CUDA 8.1

I am running Tensorflow 1.3 with CUDA 8.0 atop of Ubuntu 16.04 successfully. The setup has been done according the official installation instructions. 1) I am wondering if Tensorflow is compatibl...

Show Detail

Cuda nn path issues in installing Tensorflow gpu on ubuntu 16.04

I am installing latest Tensorflow library in my ubuntu 16.04 machine. For this I downloaded and Installed Latest Cuda toolkits and Cuda nn libraries. After Installation I checked it out using foll...

Show Detail

How to install Tensorflow GPU on ubuntu 16.04

I am using AWS P2 gpu instance with Tesla K80 GPU and Ubuntu 16.04 LTS. Installing Tensorflow for CPU is easy: pip install tensorflow But Installing Tensorflow for GPU doesnt work : pip install

Show Detail