Issue 1:
System information

Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No

OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Ubuntu 16.04.4

TensorFlow installed from (source or binary): source

TensorFlow version (use command below):

Python version:

Bazel version (if compiling from source): 0.5.3

CUDA/cuDNN version: 6.0.21

GPU model and memory:

Exact command to reproduce: bazel build --config=opt --config=cuda //tensorflow/tools/pip_package:build_pip_package

Describe the problem

I know someone had reported the same issue. Their solution is to roll back bazel to 0.5.2. But it does not work on my machine. Does anyone know how to fix this problem without the need of rolling back bazel? Thx!

tensorflow-git$ sudo bazel build --config=opt --config=cuda //tensorflow/tools/pip_package:build_pip_package

WARNING: ignoring http_proxy in environment.

.......

ERROR: Skipping '//tensorflow/tools/pip_package:build_pip_package': error loading package 'tensorflow/tools/pip_package': Encountered error while reading extension file 'cuda/build_defs.bzl': no such package '@local_config_cuda//cuda': Traceback (most recent call last):

File "/home/intel/DevLib/tensorflow-git/third_party/gpus/cuda_configure.bzl", line 1039

_create_local_cuda_repository(repository_ctx)

File "/home/intel/DevLib/tensorflow-git/third_party/gpus/cuda_configure.bzl", line 976, in _create_local_cuda_repository

_host_compiler_includes(repository_ctx, cc)

File "/home/intel/DevLib/tensorflow-git/third_party/gpus/cuda_configure.bzl", line 145, in _host_compiler_includes

get_cxx_inc_directories(repository_ctx, cc)

File "/home/intel/DevLib/tensorflow-git/third_party/gpus/cuda_configure.bzl", line 120, in get_cxx_inc_directories

set(includes_cpp)

depsets cannot contain mutable items

WARNING: Target pattern parsing failed.

ERROR: error loading package 'tensorflow/tools/pip_package': Encountered error while reading extension file 'cuda/build_defs.bzl': no such package '@local_config_cuda//cuda': Traceback (most recent call last):

File "/home/intel/DevLib/tensorflow-git/third_party/gpus/cuda_configure.bzl", line 1039

_create_local_cuda_repository(repository_ctx)

File "/home/intel/DevLib/tensorflow-git/third_party/gpus/cuda_configure.bzl", line 976, in _create_local_cuda_repository

_host_compiler_includes(repository_ctx, cc)

File "/home/intel/DevLib/tensorflow-git/third_party/gpus/cuda_configure.bzl", line 145, in _host_compiler_includes

get_cxx_inc_directories(repository_ctx, cc)

File "/home/intel/DevLib/tensorflow-git/third_party/gpus/cuda_configure.bzl", line 120, in get_cxx_inc_directories

set(includes_cpp)

depsets cannot contain mutable items

INFO: Elapsed time: 4.064s

FAILED: Build did NOT complete successfully (0 packages loaded)

currently loading: tensorflow/tools/pip_package

Issue 2:
Please go to Stack Overflow for help and support:

System information

Have I written custom code (as opposed to using a stock example script provided in TensorFlow):

No

OS Platform and Distribution (e.g., Linux Ubuntu 16.04):

Linux — Ubuntu Server 16.04 LTS

Linux PowerEdge-R810 4.4.0-87-generic #110-Ubuntu SMP Tue Jul 18 12:55:35 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

TensorFlow installed from (source or binary):

Source

TensorFlow version (use command below):

master, r1.3, r1.2.1

Python version:

2.7

Bazel version (if compiling from source):

Build label: 0.5.3

Build target: bazel-out/local-fastbuild/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar

Build time: Fri Jul 28 08:34:59 2017 (1501230899)

Build timestamp: 1501230899

Build timestamp as int: 1501230899

CUDA/cuDNN version:

CUDA 8, cuDNN 6

GPU model and memory:

GTX 1080, 8gb

Exact command to reproduce:

./configure;bazel build -c opt —config=cuda //tensorflow/tools/pip_package:build_pip_package

-Premade script:

alex@PowerEdge-R810:~$ sh tf_env_collect.sh
Collecting system information...
tf_env_collect.sh: 39: [: Linux: unexpected operator
tf_env_collect.sh: 41: [: Linux: unexpected operator
Traceback (most recent call last):
File "/tmp/check_tf.py", line 1, in <module>
import tensorflow as tf;
ImportError: No module named tensorflow
Wrote environment to tf_env.txt. You can review the contents of that file.
and use it to populate the fields in the github issue template.

cat tf_env.txt

alex@PowerEdge-R810:~$ cat tf_env.txt

== cat /etc/issue ===============================================
Linux PowerEdge-R810 4.4.0-87-generic #110-Ubuntu SMP Tue Jul 18 12:55:35 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

== are we in docker =============================================
No

== compiler =====================================================
c++ (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

== uname -a =====================================================
Linux PowerEdge-R810 4.4.0-87-generic #110-Ubuntu SMP Tue Jul 18 12:55:35 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

== check pips ===================================================
numpy (1.11.0)

== check for virtualenv =========================================
False

== tensorflow import ============================================
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named tensorflow

== env ==========================================================
LD_LIBRARY_PATH /usr/local/cuda-8.0/lib64
DYLD_LIBRARY_PATH is unset

== nvidia-smi ===================================================
Fri Jul 28 18:12:37 2017
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 384.59 Driver Version: 384.59 |
|-------------------------------+----------------------+----------------------+
| 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 1080 Off | 00000000:0E:00.0 Off | N/A |
| 37% 32C P0 32W / 180W | 0MiB / 8105MiB | 0% Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| No running processes found |
+-----------------------------------------------------------------------------+

== cuda libs ===================================================
/usr/local/cuda-8.0/lib64/libcudart_static.a
/usr/local/cuda-8.0/lib64/libcudart.so.8.0.61
/usr/local/cuda-8.0/doc/man/man7/libcudart.7
/usr/local/cuda-8.0/doc/man/man7/libcudart.so.7

Describe the problem

I am trying to compile tensorflow from source. When I run the above command, the bazel build fails. This is the configuration I used as well as the error. It seems like some other people had this issue but the threads were for much older versions and none of the solutions fixed it:

Please specify the location of python. [Default is /usr/bin/python]:
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
Do you wish to build TensorFlow with jemalloc as malloc support? [Y/n]:
jemalloc as malloc support will be enabled for TensorFlow.

Do you wish to build TensorFlow with Google Cloud Platform support? [y/N]: y
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.

Do you wish to build TensorFlow with XLA JIT support? [y/N]:
No XLA JIT support will be enabled for TensorFlow.

Do you wish to build TensorFlow with VERBS support? [y/N]:
No VERBS support will be enabled for TensorFlow.

Do you wish to build TensorFlow with OpenCL support? [y/N]: y
OpenCL support will be enabled for TensorFlow.

Please specify which C++ compiler should be used as the host C++ compiler. [Default is /usr/bin/g++]:
Please specify which C compiler should be used as the host C compiler. [Default is /usr/bin/gcc]:
Please specify the location where ComputeCpp for SYCL 1.2 is installed. [Default is /usr/local/computecpp]:
Do you wish to build TensorFlow with CUDA support? [y/N]: y
CUDA support will be enabled for TensorFlow.

Please specify the CUDA SDK version you want to use, e.g. 7.0. [Leave empty to default to CUDA 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 default to cuDNN 6.0]:
Please specify the location where cuDNN 6 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: 6.1]
Do you want to use clang as CUDA compiler? [y/N]:
nvcc will be used as CUDA compiler.

Please specify which gcc should be used by nvcc as the host compiler. [Default is /usr/bin/gcc]:
Do you wish to build TensorFlow with MPI support? [y/N]:
No MPI support will be enabled for TensorFlow.

Please specify optimization flags to use during compilation when bazel option "--config=opt" is specified [Default is -march=native]:
Add "--config=mkl" to your bazel command to build with MKL support.
Please note that MKL on MacOS or windows is still not supported.
If you would like to use a local MKL instead of downloading, please set the environment variable "TF_MKL_ROOT" every time before build.
Configuration finished
...............
ERROR: Skipping '//tensorflow/tools/pip_package:build_pip_package': error loading package 'tensorflow/tools/pip_package': Encountered error while reading extension file 'cuda/build_defs.bzl': no such package '@local_config_cuda//cuda': Traceback (most recent call last):
File "/home/alex/tensorflow/third_party/gpus/cuda_configure.bzl", line 1039
_create_local_cuda_repository(repository_ctx)
File "/home/alex/tensorflow/third_party/gpus/cuda_configure.bzl", line 976, in _create_local_cuda_repository
_host_compiler_includes(repository_ctx, cc)
File "/home/alex/tensorflow/third_party/gpus/cuda_configure.bzl", line 145, in _host_compiler_includes
get_cxx_inc_directories(repository_ctx, cc)
File "/home/alex/tensorflow/third_party/gpus/cuda_configure.bzl", line 120, in get_cxx_inc_directories
set(includes_cpp)
depsets cannot contain mutable items
WARNING: Target pattern parsing failed.
ERROR: error loading package 'tensorflow/tools/pip_package': Encountered error while reading extension file 'cuda/build_defs.bzl': no such package '@local_config_cuda//cuda': Traceback (most recent call last):
File "/home/alex/tensorflow/third_party/gpus/cuda_configure.bzl", line 1039
_create_local_cuda_repository(repository_ctx)
File "/home/alex/tensorflow/third_party/gpus/cuda_configure.bzl", line 976, in _create_local_cuda_repository
_host_compiler_includes(repository_ctx, cc)
File "/home/alex/tensorflow/third_party/gpus/cuda_configure.bzl", line 145, in _host_compiler_includes
get_cxx_inc_directories(repository_ctx, cc)
File "/home/alex/tensorflow/third_party/gpus/cuda_configure.bzl", line 120, in get_cxx_inc_directories
set(includes_cpp)
depsets cannot contain mutable items
INFO: Elapsed time: 13.663s
FAILED: Build did NOT complete successfully (0 packages loaded)
currently loading: tensorflow/tools/pip_package