无法使用Ubuntu 16.04和CUDA 8.0安装tensorflow

无法使用Ubuntu 16.04和CUDA 8.0安装tensorflow,ubuntu,tensorflow,Ubuntu,Tensorflow,是否有人通过以下组合成功安装TensorFlow Ubuntu 16.04(刚刚安装并升级) Nvidia驱动程序:Nvidia-370(sudo apt安装Nvidia-370) Bazel 0.3.1(从官方软件包安装): gcc:5.4.0(默认为16.04) CUDA 8.0.44(适用于GTX 1070,从官方.run文件安装,无驱动程序) cuDNN 5.1.5(从官方软件包安装) tensorflow主机(从官方github克隆) Python2和Python3(从ubunt

是否有人通过以下组合成功安装TensorFlow

  • Ubuntu 16.04(刚刚安装并升级)
  • Nvidia驱动程序:Nvidia-370(sudo apt安装Nvidia-370)
  • Bazel 0.3.1(从官方软件包安装):

  • gcc:5.4.0(默认为16.04)

  • CUDA 8.0.44(适用于GTX 1070,从官方.run文件安装,无驱动程序)

  • cuDNN 5.1.5(从官方软件包安装)

  • tensorflow主机(从官方github克隆)
  • Python2和Python3(从ubuntu官方源代码安装)
然后运行tensorflow/配置:

./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"]: 
管理大楼:

bazel build -c opt --config=cuda
立即发生了一些错误:

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.
...
我试图:

  • 多次重新安装Ubuntu
  • 多次重新安装Bazel(来自第三方来源)
  • 尝试不同的Bazel版本(0.3.1、0.3.0、frome官方软件包)
  • 切换到较旧的CUDA版本8.0.27(CUDA 7不支持GTX 1070)
  • 尝试不同的cuda路径“/usr/local/cuda”和“/usr/local/cuda-8.0”(它们都存在)
  • 重新运行./configure多次并重新运行bazel build-c opt--config=cuda
  • 在重新运行之前运行“bazel clean”。/configure
  • 重新下载官方tensorflow软件包或重新克隆官方tensorflow github repo
  • 在./configure之前删除路径~/.config/bazel
  • 蟒蛇2和蟒蛇3
  • 我已经尝试了所有可能与此错误相关的操作
但是错误总是发生,并且带有相同的消息

我尝试使用tensorflow r0.10包(从git hub下载),错误消息如下:

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.
对于tensorflow r0.10,上述尝试的操作对这两条错误消息没有影响

四天的失败让我很沮丧。有人能帮我吗?谢谢

我还将此问题发布到github:

CUDA 8是几天前发布的。你真的确定tensorflow支持CUDA 8吗据我所知,CUDA 8.0.27已经发布了好几个月了。该发布候选版本自5月底以来就已经公开发布了。但官方发布只是在过去几周内。日期无关紧要。你确定支持CUDA 8吗?抱歉,我不确定官方报道中是否支持CUDA 8,但是有很多人展示了他们使用CUDA 8成功安装tensorflow,而我的GTX 1070不支持CUDA 7.5。我只是安装了它,它工作正常。您需要做的一件事是修补crosstool文件:(它现在在tensorflow master中的名称略有不同,我认为是crosstool.tpl),但这似乎不像您所遇到的错误。也许您想在运行configure之前清除~/.cache。
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.
...
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.