tensorflow: bezel build problem for OSX: "No toolchain corresponding to 'local_darwin' found for cpu darwin"

NOTE: Issues that are not bugs or feature requests will be closed. Please ask usage questions on StackOverflow.

You must complete this information or else your issue will be closed

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow)?: No, this is an installation issue.
  • TensorFlow installed from (source or binary)?: Source
  • TensorFlow version: 1.0.1
  • Bazel version (if compiling from source): Build label: 0.4.5-homebrew
  • CUDA/cuDNN version: 8.0.71
  • GPU Model and Memory: NVIDIA GeForce GT 750M, 2048 MB
  • Exact command to reproduce: From Installing Tensorflow from sources (https://www.tensorflow.org/install/install_sources#PrepareMac): bazel build --config=opt --config=cuda //tensorflow/tools/pip_package:build_pip_package

Describe the problem clearly

Receiving the following error when trying to build from source:

  $ bazel build --config=opt --config=cuda //tensorflow/tools/pip_package:build_pip_package  
    ERROR: Inconsistent crosstool configuration; no toolchain corresponding to 'local_darwin' found for cpu 'darwin'.  
    INFO: Elapsed time: 0.101s  

I’m wondering if ‘local_darwin’ is an incorrect parameter in the TensorFlow bazel build setup files. If so, they need to be corrected and updated.

Source Code / Logs

Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full-traceback. Large logs and files should be attached. Try to reproducible test-case code the bare-minimum necessary to generate the problem

Input and output pasted in previous questions.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 32 (10 by maintainers)

Most upvoted comments

As of version 1.2, TensorFlow no longer provides GPU support on Mac OS X.

GPUs are overrated anyway.

@udnaan @BKJackson @cody-code-wy If you say no to the ./configure prompt about using Clang as the CUDA compiler, do things work?

Thanks @mattiasarro! I’ve updated that work a bit in my own tutorial covering TensorFlow 1.3.0, CUDA 8.0 and cuDNN 6.0 – hopefully it’ll be of use to others as well.

https://metakermit.com/2017/compiling-tensorflow-with-gpu-support-on-a-macbook-pro/

BTW, here’s hoping you reintroduce the tensorflow-gpu package! 🙂

@BKJackson 我的是imac和你一样的问题 在./configure时候Do you want to use clang as CUDA compiler? [y/N] N选N,不用clang用gcc就行了

I managed to compile and successfully run TensorFlow 1.2 on macOS with GPU support. This thread has been useful in resolving it, thanks guys!

I wrote a little tutorial on it, as a “note to self” for later, but maybe it’s also useful to someone else. https://medium.com/@mattias.arro/installing-tensorflow-1-2-from-sources-with-gpu-support-on-macos-4f2c5cab8186

Since there is no supported combination of hardware from Apple and software by NVIDIA (there are currently no NVIDIA drivers that actually work reliably on a MacOS platform), we have stopped supporting native CUDA/GPU support on MacOS. It appears to us that neither old nor new drivers work reliably with new versions of MacOS.

We have tried both on old hardware (MacBook Pro with NVIDIA GPUs) and using external GPUs (a bizon box with an external GPU via thunderbolt), and have not been able to get even CUDA to work reliably. Without the ability to test and build on MacOS+GPU, we cannot support it.

I’m sorry about this situation, if the driver situation improves we’d be happy to add support again.

@gunan FYI.

You get around that first error by saying not to use using clang as CUDA Compiler and instead using nvcc which it will do if you say no to that option

Hey all, That’s an unfortunate but understandable decision to remove support GPU for macOS in 1.2.

If we wanted to try to improve the CUDA driver situation in macOS, who should we go to for support? Is the problem an issue with NVidia’s drivers or Apple’s OS?

I presume if there are thousands of tensorflow developers who use macs, all asking either NVidia or Apple to improve the situation, then something might be done about it.

As announced in 1.1 we will drop official support for mac-gpu setups. The reasons are as @martinwicke described. However, the configuration files and all the necessary code is still in there. There were some test failures the last time we ran the tests, but it should not effect most training tasks. If you run into any issues, the contributions are most welcome, and we will consider any PRs fixing mac gpu builds.

@ilyaivensky TF 1.2 doesn’t have GPU support on Mac.

Here is the diff that seems to work the best so far. You have to have Xcode 8.2 for it to work:

@ BUILD:1984 @ tf_kernel_library(
    # and //third_party/libf2c all contain various parts of BLAS, LAPACK,
    # and f2c helper functions in global namespace. Tell the compiler to
    # allow multiple definitions when linking this.
    linkopts = ["-Wl,-zmuldefs"],
    #linkopts = ["-Wl,-zmuldefs"],
    visibility = ["//visibility:private"],
    deps = [
        "//tensorflow/core:framework",
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
modified: third_party/gpus/cuda/BUILD.tpl
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
@ BUILD.tpl:99 @ cc_library(
    data = ["lib/%{cusolver_lib}"],
    includes = ["include/"],
    linkstatic = 1,
    linkopts = ["-lgomp"],
    linkopts = ["-fopenmp"],
    visibility = ["//visibility:public"],
)

 ~/p/a/tensorflow
 ~/p/a/tensorflow   master *  rlwrap ./configure                                                            Thu Apr 13 23:17:40 2017
Please specify the location of python. [Default is /usr/local/bin/python]: /usr/local/bin/python3
Please specify optimization flags to use during compilation when bazel option "--config=opt" is specified [Default is -march=native]:
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 the XLA just-in-time compiler (experimental)? [y/N] y
XLA JIT support will be enabled for TensorFlow
Found possible Python library paths:
  /usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages
Please input the desired Python library path to use.  Default is [/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages]

Using python library path: /usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages
Do you wish to build TensorFlow with OpenCL support? [y/N]
No OpenCL support will be enabled for TensorFlow
Do you wish to build TensorFlow with CUDA support? [y/N] y
CUDA support will be enabled for TensorFlow
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]:
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
Please specify the location where cuDNN 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"]: 6.1
INFO: Starting clean (this may take a while). Consider using --async if the clean takes more than several minutes.
Configuration finished