Skip to content

Latest commit

 

History

History
25 lines (20 loc) · 1.09 KB

install_tensorflow.md

File metadata and controls

25 lines (20 loc) · 1.09 KB

1.12 with CUDA 9.2 in Centos7

upgrade setuptools

pip3 install --upgrade setuptools

bazel

  • download bazel 0.15.0 (the newest may not work)
  • ./compile.sh --cxxopt="-D_GLIBCXX_USE_CXX11_ABI=0"
  • cp output/bazel /opt/apps/bazel/0.15.0/

bazel >= 0.18 has issues with http_proxy

TF

  • export PATH+=:/opt/apps/bazel/0.18.0; export TEST_TMPDIR=/tmp/TMP_BZL

  • ./configure # setup cuda, cudnn

  • Edit third_party/gpus/crosstool/CROSSTOOL_hipcc.tpl, in the top of "cxx_flag: "-std=c++11" cxx_builtin_include_directory: "/usr/lib/gcc/x86_64-redhat-linux/4.8.5/include"
    cxx_builtin_include_directory: "/lstr/applications/ava/libs/cuda/8.0/include"

  • Edit third_party/gpus/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc.tpl, CPU_COMPILER = ('/usr/bin/gcc')
    GCC_HOST_COMPILER_PATH = ('/usr/bin/gcc')

  • bazel build --config=opt --config=mkl --copt=-march=native --config=cuda --verbose_failures //tensorflow/tools/pip_package:build_pip_package

  • ./bazel-bin/tensorflow/tools/pip_package/build_pip_package ./WHEEL

  • pip3 install ./WHEEL/tensorflow-1.12.0-cp36-cp36m-linux_x86_64.whl