Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
TensorFlow GPU 1.2+ on MacOS Sierra
# Xcode 8, cudnn 6.1, cuda 8.0,
# bazel 0.5.4, tensorflow r1.3
# takes about 36 min on macbook pro 2.8Ghz, 8GB RAM
# edit *tensorflow/third_party/gpus/cuda/BUILD.tpl*
# [#comment out] linkopts = [“-lgomp”]
$ export DYLD_LIBRARY_PATH=/usr/local/cuda/lib:/usr/local/cuda/extras/CUPTI/lib
$ export LD_LIBRARY_PATH=$DYLD_LIBRARY_PATH\nexport PATH=$DYLD_LIBRARY_PATH:$PATH \
export flags="--config=cuda --config=opt"
$ export CUDA_HOME=/usr/local/cuda
$ PYTHON_BIN_PATH="$HOME/anaconda/envs/gpu36/bin/python" CUDA_TOOLKIT_PATH="/usr/local/cuda" \
CUDNN_INSTALL_PATH="/usr/local/cuda" TF_UNOFFICIAL_SETTING=1 TF_NEED_CUDA=1 TF_CUDA_COMPUTE_CAPABILITIES="6.1" \
TF_CUDNN_VERSION="6" TF_CUDA_VERSION="8.0" TF_CUDA_VERSION_TOOLKIT=8.0 ./configure
$ bazel build $flags --verbose_failures --action_env PATH --action_env LD_LIBRARY_PATH --action_env \
DYLD_LIBRARY_PATH //tensorflow/tools/pip_package:build_pip_package
# Add to profile
export PATH=/Developer/NVIDIA/CUDA-8.0/bin${PATH:+:${PATH}}
export DYLD_LIBRARY_PATH=/Developer/NVIDIA/CUDA-8.0/lib:/usr/local/cuda/lib:/usr/local/cuda/extras/CUPTI/lib:${DYLD_LIBRARY_PATH:+:${DYLD_LIBRARY_PATH}}
export LD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$LD_LIBRARY_PATH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.