tensorflow: bazel build issue (does not contain a toolchain for CPU 'k8')
System information
- OS Platform and Distribution: Ubuntu 18.04
- TensorFlow installed from (source or binary): source
- TensorFlow version:
master(6798656ce64201afe7d8d9ed5445cd5114bfd9b4) - Bazel version (if compiling from source): 0.20.0
- GCC/Compiler version (if compiling from source): 7.3.0
- CUDA/cuDNN version: 10
Describe the problem
When building branch v1.12.0 or current master (commit 6798656ce64201afe7d8d9ed5445cd5114bfd9b4) I get the following build error:
ERROR: cc_toolchain_suite '@local_config_cuda//crosstool:toolchain' does not contain a toolchain for CPU 'k8', you may want to add an entry for 'local|compiler' into toolchains and toolchain_identifier 'local_linux' into the corresponding cc_toolchain rule (see --incompatible_disable_cc_toolchain_label_from_crosstool_proto).
Provide the exact sequence of commands / steps that you executed before running into the problem
- install bazel as described here: https://docs.bazel.build/versions/master/install-ubuntu.html#install-on-ubuntu
- checkout the
v1.12.0branch or 6798656ce64201afe7d8d9ed5445cd5114bfd9b4 - bazel build --config=opt --config=cuda //tensorflow/tools/pip_package:build_pip_package
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 29 (7 by maintainers)
Commits related to this issue
- Downgrade to bazel 0.19.2 for unit test 0.20.0 fails with: ERROR: cc_toolchain_suite '@local_config_cuda//crosstool:toolchain' does not contain a toolchain for CPU 'ppc', you may want to add an entry... — committed to wdirons/tensorflow by wdirons 6 years ago
- downgrading bazel version from 0.20.0 to 0.19.2 to workaround issue #24124 (in google tensorflow repo) — committed to ROCm/tensorflow-upstream by deven-amd 6 years ago
- Try fix from https://github.com/tensorflow/tensorflow/issues/24124 — committed to DarkDimius/bazel-toolchain by DarkDimius 6 years ago
- Try fix from https://github.com/tensorflow/tensorflow/issues/24124 — committed to DarkDimius/bazel-toolchain by DarkDimius 6 years ago
maybe bazel should have a CI to check that it builds tensorflow before pushing out a release that breaks the biggest user of bazel…
Run the following
Same issue just came up for me too. Works fine with an older version of Bazel.
Downgrading worked. Thanks! Anyone has working solution for bazel 0.20.0?
I am closing this since the build script now won’t proceed without a compatible bazel version. The recommended way is to install the Debian package from https://github.com/bazelbuild/bazel/releases with the corresponding fixed bazel version (
bazel_<version>-linux-x86_64.deb) instead of using the repository which always updates to the latest version.@byronyi Yeah, of course (though 1.12.0 is the newest release, not an older one). I absolutely think the issue lies with Bazel here.
The main problem I see is that they regularly roll out non backwards compatible releases without providing packages for older versions. So I can’t use a package manager to install that older Bazel version, but I have to curl and then manually install it from somewhere - which is at odds with all the documentation of both TF and Bazel. That’s pretty annoying IMHO, because I had to dig through issue reports like this one to find a remedy.
But all of this is definitely not the fault of the TensorFlow team or library. And also, my problem is solved, so this is just me ranting aimlessly. Apologies.
Using bazel 0.19.2 works for the latest master branch, while bazel 0.20.0 has k8 issue mentioned above.
This is my work around; it’s certainly not the right way to do it, but I needed to get it working and this did the trick.