tensorflow: no such package '@local_config_cuda//cuda'
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
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 15
- Comments: 34 (13 by maintainers)
Commits related to this issue
- PR #11859: [XLA:GPU] Add cuDNN Flash Attention Padding Mask Generation & Skipping computation on padded tokens in XLA Imported from GitHub PR https://github.com/openxla/xla/pull/11859 * Follow up PR... — committed to tensorflow/tensorflow by Cjkkkk 2 months ago
- PR #11859: [XLA:GPU] Add cuDNN Flash Attention Padding Mask Generation & Skipping computation on padded tokens in XLA Imported from GitHub PR https://github.com/openxla/xla/pull/11859 * Follow up PR... — committed to tensorflow/tensorflow by Cjkkkk 2 months ago
- PR #11859: [XLA:GPU] Add cuDNN Flash Attention Padding Mask Generation & Skipping computation on padded tokens in XLA Imported from GitHub PR https://github.com/openxla/xla/pull/11859 * Follow up PR... — committed to tensorflow/tensorflow by Cjkkkk 2 months ago
sudo apt-get purge bazelfollowed by installation from 0.5.2 binaries https://docs.bazel.build/versions/master/install-ubuntu.html(not certain if it’s the “right way”, just how I got it to compile)
Yep bazel 0.5.2 fixed the problem for me as well, very strange
Rolling bazel back to 0.5.2 seems to fix the problem
I solved the issue by editing line 120 in tensorflow/third_party/gpus/cuda_configure.bzl I changed set to depset as recommended in error output.
this problem still exist in bazel 5.3 and 5.4. If you build for the 1.2.1 branch. Going back to 5.2 fixed the problem.
@wentaol Thank you, i have downgraded to 0.5.2 and
bazel build --config=opt --config=cuda //tensorflow/tools/pip_package:build_pip_packageseems to be running.I am facing this issue with bazel 0.11.1 on r1.7
I was just having the same and just wanted to comment and confirm that updating to
masterimmediately fixed it with no other changes needed 👍I have been having this same problem for the last day. I have installed the latest version of bazel (0.5.3). I previously got a build working, but then uninstalled it. When I went back to reinstall, I encountered this error. Two days ago I also was able to get this working on docker, but now it also does not work in docker.
Environment Data
Bazel Build Version
Error Message