Skip to content

Instantly share code, notes, and snippets.

@chexov
Forked from smitshilu/Tensorflow_Build_GPU.md
Created December 11, 2017 23:54
Show Gist options
  • Save chexov/cefb960264d1c7b17a8ebe9e7da98f0b to your computer and use it in GitHub Desktop.
Save chexov/cefb960264d1c7b17a8ebe9e7da98f0b to your computer and use it in GitHub Desktop.

Revisions

  1. @smitshilu smitshilu revised this gist Nov 29, 2017. 1 changed file with 9 additions and 9 deletions.
    18 changes: 9 additions & 9 deletions Tensorflow_Build_GPU.md
    Original file line number Diff line number Diff line change
    @@ -94,14 +94,14 @@
    * export LD_LIBRARY_PATH=$DYLD_LIBRARY_PATH
    * export PATH=$DYLD_LIBRARY_PATH:$PATH
    * Start build
    ```
    bazel build --config=cuda --config=opt --action_env PATH --action_env LD_LIBRARY_PATH --action_env DYLD_LIBRARY_PATH //tensorflow/tools/pip_package:build_pip_package
    ```
    ```
    bazel build --config=cuda --config=opt --action_env PATH --action_env LD_LIBRARY_PATH --action_env DYLD_LIBRARY_PATH //tensorflow/tools/pip_package:build_pip_package
    ```
    * Generate a wheel for installation
    ```
    bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
    ```
    ```
    bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
    ```
    * Install tensorflow wheel
    ```
    sudo pip install /tmp/tensorflow_pkg/tensorflow-1.4.0rc1-cp36-cp36m-macosx_10_7_x86_64.whl (File name depends on tensorflow version and python version)
    ```
    ```
    sudo pip install /tmp/tensorflow_pkg/tensorflow-1.4.0rc1-cp36-cp36m-macosx_10_7_x86_64.whl (File name depends on tensorflow version and python version)
    ```
  2. @smitshilu smitshilu revised this gist Nov 29, 2017. 1 changed file with 12 additions and 4 deletions.
    16 changes: 12 additions & 4 deletions Tensorflow_Build_GPU.md
    Original file line number Diff line number Diff line change
    @@ -93,7 +93,15 @@
    * export DYLD_LIBRARY_PATH=/Users/__USERNAME__/lib:/usr/local/cuda/lib:/usr/local/cuda/extras/CUPTI/lib (Replace USERNAME with your machine username)
    * export LD_LIBRARY_PATH=$DYLD_LIBRARY_PATH
    * export PATH=$DYLD_LIBRARY_PATH:$PATH
    * bazel build --config=cuda --config=opt --action_env PATH --action_env LD_LIBRARY_PATH --action_env DYLD_LIBRARY_PATH //tensorflow/tools/pip_package:build_pip_package
    * bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
    * sudo pip install /tmp/tensorflow_pkg/tensorflow-1.4.0rc1-cp36-cp36m-macosx_10_7_x86_64.whl (File name depends on tensorflow version and python version)
    * Start build
    ```
    bazel build --config=cuda --config=opt --action_env PATH --action_env LD_LIBRARY_PATH --action_env DYLD_LIBRARY_PATH //tensorflow/tools/pip_package:build_pip_package
    ```
    * Generate a wheel for installation
    ```
    bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
    ```
    * Install tensorflow wheel
    ```
    sudo pip install /tmp/tensorflow_pkg/tensorflow-1.4.0rc1-cp36-cp36m-macosx_10_7_x86_64.whl (File name depends on tensorflow version and python version)
    ```
  3. @smitshilu smitshilu renamed this gist Nov 7, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Installation.md → Tensorflow_Build_GPU.md
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@
    ### System information
    * OS - High Sierra 10.13
    * Tensorflow - 1.4
    * Xcode command line tools - 7.2 (Download from here: Xcode - Support - Apple Developer & Switch to different clang version: sudo xcode-select --switch/Library/Developer/CommandLineTools & check version: clang -v)
    * Xcode command line tools - 8.2 (Download from here: Xcode - Support - Apple Developer & Switch to different clang version: sudo xcode-select --switch/Library/Developer/CommandLineTools & check version: clang -v)
    * Cmake - 3.7
    * Bazel - 0.7.0
    * CUDA - 9
  4. @smitshilu smitshilu revised this gist Nov 7, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Installation.md
    Original file line number Diff line number Diff line change
    @@ -90,7 +90,7 @@
    ```
    * Add following paths:
    * export CUDA_HOME=/usr/local/cuda
    * export DYLD_LIBRARY_PATH=/Users/__#USERNAME#__/lib:/usr/local/cuda/lib:/usr/local/cuda/extras/CUPTI/lib
    * export DYLD_LIBRARY_PATH=/Users/__USERNAME__/lib:/usr/local/cuda/lib:/usr/local/cuda/extras/CUPTI/lib (Replace USERNAME with your machine username)
    * export LD_LIBRARY_PATH=$DYLD_LIBRARY_PATH
    * export PATH=$DYLD_LIBRARY_PATH:$PATH
    * bazel build --config=cuda --config=opt --action_env PATH --action_env LD_LIBRARY_PATH --action_env DYLD_LIBRARY_PATH //tensorflow/tools/pip_package:build_pip_package
  5. @smitshilu smitshilu revised this gist Nov 7, 2017. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions Installation.md
    Original file line number Diff line number Diff line change
    @@ -89,6 +89,10 @@
    Configuration finished
    ```
    * Add following paths:
    * export CUDA_HOME=/usr/local/cuda
    * export DYLD_LIBRARY_PATH=/Users/__#USERNAME#__/lib:/usr/local/cuda/lib:/usr/local/cuda/extras/CUPTI/lib
    * export LD_LIBRARY_PATH=$DYLD_LIBRARY_PATH
    * export PATH=$DYLD_LIBRARY_PATH:$PATH
    * bazel build --config=cuda --config=opt --action_env PATH --action_env LD_LIBRARY_PATH --action_env DYLD_LIBRARY_PATH //tensorflow/tools/pip_package:build_pip_package
    * bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
    * sudo pip install /tmp/tensorflow_pkg/tensorflow-1.4.0rc1-cp36-cp36m-macosx_10_7_x86_64.whl (File name depends on tensorflow version and python version)
  6. @smitshilu smitshilu revised this gist Nov 7, 2017. 1 changed file with 64 additions and 3 deletions.
    67 changes: 64 additions & 3 deletions Installation.md
    Original file line number Diff line number Diff line change
    @@ -28,7 +28,68 @@
    ### Steps:
    * Disable SIP (in recovery mode enter command: csrutil disable)
    * ./configure (Find CUDA compute value from https://developer.nvidia.com/cuda-gpus)
    *
    *
    *
    ```
    Smit-Shilu:tensorflow-build smitshilu$ ./configure
    You have bazel 0.7.0-homebrew installed.
    Please specify the location of python. [Default is /Users/smitshilu/anaconda3/bin/python]:
    Found possible Python library paths:
    /Users/smitshilu/anaconda3/lib/python3.6/site-packages
    Please input the desired Python library path to use. Default is [/Users/smitshilu/anaconda3/lib/python3.6/site-packages]
    Do you wish to build TensorFlow with Google Cloud Platform support? [Y/n]: n
    No Google Cloud Platform support will be enabled for TensorFlow.
    Do you wish to build TensorFlow with Hadoop File System support? [Y/n]: n
    No Hadoop File System support will be enabled for TensorFlow.
    Do you wish to build TensorFlow with Amazon S3 File System support? [Y/n]: n
    No Amazon S3 File System support will be enabled for TensorFlow.
    Do you wish to build TensorFlow with XLA JIT support? [y/N]: n
    No XLA JIT support will be enabled for TensorFlow.
    Do you wish to build TensorFlow with GDR support? [y/N]: n
    No GDR support will be enabled for TensorFlow.
    Do you wish to build TensorFlow with VERBS support? [y/N]: n
    No VERBS support will be enabled for TensorFlow.
    Do you wish to build TensorFlow with OpenCL support? [y/N]: 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.
    Please specify the CUDA SDK version you want to use, e.g. 7.0. [Leave empty to default to CUDA 8.0]: 9.0
    Please specify the location where CUDA 9.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]: 7
    Please specify the location where cuDNN 7 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
    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
    ```
    * Add following paths:
    * bazel build --config=cuda --config=opt --action_env PATH --action_env LD_LIBRARY_PATH --action_env DYLD_LIBRARY_PATH //tensorflow/tools/pip_package:build_pip_package
    * bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
    * sudo pip install /tmp/tensorflow_pkg/tensorflow-1.4.0rc1-cp36-cp36m-macosx_10_7_x86_64.whl (File name depends on tensorflow version and python version)
  7. @smitshilu smitshilu revised this gist Nov 7, 2017. 1 changed file with 8 additions and 1 deletion.
    9 changes: 8 additions & 1 deletion Installation.md
    Original file line number Diff line number Diff line change
    @@ -23,5 +23,12 @@
    * tensorflow/core/kernels/split_lib_gpu.cu.cc
    * tensorflow/core/kernels/concat_lib_gpu.impl.cu.cc

    For example,` extern shared __align(sizeof(T))__ unsigned char smem[];` => `extern shared unsigned char smem[];`
    For example, `extern shared __align(sizeof(T))__ unsigned char smem[];` => `extern shared unsigned char smem[];`

    ### Steps:
    * Disable SIP (in recovery mode enter command: csrutil disable)
    * ./configure (Find CUDA compute value from https://developer.nvidia.com/cuda-gpus)
    *
    *
    *

  8. @smitshilu smitshilu revised this gist Nov 7, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Installation.md
    Original file line number Diff line number Diff line change
    @@ -23,5 +23,5 @@
    * tensorflow/core/kernels/split_lib_gpu.cu.cc
    * tensorflow/core/kernels/concat_lib_gpu.impl.cu.cc

    For example, extern shared `_`_align(sizeof(T))`_`_ unsigned char smem[]; => extern shared unsigned char smem[];
    For example,` extern shared __align(sizeof(T))__ unsigned char smem[];` => `extern shared unsigned char smem[];`

  9. @smitshilu smitshilu revised this gist Nov 7, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Installation.md
    Original file line number Diff line number Diff line change
    @@ -23,5 +23,5 @@
    * tensorflow/core/kernels/split_lib_gpu.cu.cc
    * tensorflow/core/kernels/concat_lib_gpu.impl.cu.cc

    For example, extern shared /_/_align(sizeof(T))/_/_ unsigned char smem[]; => extern shared unsigned char smem[];
    For example, extern shared `_`_align(sizeof(T))`_`_ unsigned char smem[]; => extern shared unsigned char smem[];

  10. @smitshilu smitshilu revised this gist Nov 7, 2017. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion Installation.md
    Original file line number Diff line number Diff line change
    @@ -22,5 +22,6 @@
    * tensorflow/core/kernels/depthwise_conv_op_gpu.cu.cc
    * tensorflow/core/kernels/split_lib_gpu.cu.cc
    * tensorflow/core/kernels/concat_lib_gpu.impl.cu.cc
    For example, extern shared __align(sizeof(T))__ unsigned char smem[]; => extern shared unsigned char smem[];

    For example, extern shared /_/_align(sizeof(T))/_/_ unsigned char smem[]; => extern shared unsigned char smem[];

  11. @smitshilu smitshilu revised this gist Nov 7, 2017. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions Installation.md
    Original file line number Diff line number Diff line change
    @@ -22,3 +22,5 @@
    * tensorflow/core/kernels/depthwise_conv_op_gpu.cu.cc
    * tensorflow/core/kernels/split_lib_gpu.cu.cc
    * tensorflow/core/kernels/concat_lib_gpu.impl.cu.cc
    For example, extern shared __align(sizeof(T))__ unsigned char smem[]; => extern shared unsigned char smem[];

  12. @smitshilu smitshilu revised this gist Nov 7, 2017. 1 changed file with 5 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions Installation.md
    Original file line number Diff line number Diff line change
    @@ -17,3 +17,8 @@
    * sudo pip install six numpy wheel
    * brew install coreutils

    ## Step-by-step guide
    ### Remove all __align__(sizeof(T)) from following files:
    * tensorflow/core/kernels/depthwise_conv_op_gpu.cu.cc
    * tensorflow/core/kernels/split_lib_gpu.cu.cc
    * tensorflow/core/kernels/concat_lib_gpu.impl.cu.cc
  13. @smitshilu smitshilu revised this gist Nov 7, 2017. 1 changed file with 0 additions and 2 deletions.
    2 changes: 0 additions & 2 deletions Installation.md
    Original file line number Diff line number Diff line change
    @@ -14,8 +14,6 @@


    ### Requirements

    * sudo pip install six numpy wheel

    * brew install coreutils

  14. @smitshilu smitshilu revised this gist Nov 7, 2017. 1 changed file with 0 additions and 6 deletions.
    6 changes: 0 additions & 6 deletions Installation.md
    Original file line number Diff line number Diff line change
    @@ -4,17 +4,11 @@

    ### System information
    * OS - High Sierra 10.13

    * Tensorflow - 1.4

    * Xcode command line tools - 7.2 (Download from here: Xcode - Support - Apple Developer & Switch to different clang version: sudo xcode-select --switch/Library/Developer/CommandLineTools & check version: clang -v)

    * Cmake - 3.7

    * Bazel - 0.7.0

    * CUDA - 9

    * cuDNN - 7


  15. @smitshilu smitshilu revised this gist Nov 7, 2017. 1 changed file with 9 additions and 9 deletions.
    18 changes: 9 additions & 9 deletions Installation.md
    Original file line number Diff line number Diff line change
    @@ -3,25 +3,25 @@


    ### System information
    OS - High Sierra 10.13
    * OS - High Sierra 10.13

    Tensorflow - 1.4
    * Tensorflow - 1.4

    Xcode command line tools - 7.2 (Download from here: Xcode - Support - Apple Developer & Switch to different clang version: sudo xcode-select --switch/Library/Developer/CommandLineTools & check version: clang -v)
    * Xcode command line tools - 7.2 (Download from here: Xcode - Support - Apple Developer & Switch to different clang version: sudo xcode-select --switch/Library/Developer/CommandLineTools & check version: clang -v)

    Cmake - 3.7
    * Cmake - 3.7

    Bazel - 0.7.0
    * Bazel - 0.7.0

    CUDA - 9
    * CUDA - 9

    cuDNN - 7
    * cuDNN - 7



    ### Requirements

    *sudo pip install six numpy wheel
    * sudo pip install six numpy wheel

    *brew install coreutils
    * brew install coreutils

  16. @smitshilu smitshilu revised this gist Nov 7, 2017. 1 changed file with 8 additions and 2 deletions.
    10 changes: 8 additions & 2 deletions Installation.md
    Original file line number Diff line number Diff line change
    @@ -1,18 +1,24 @@
    ***

    # Tensorflow


    ### System information
    OS - High Sierra 10.13

    Tensorflow - 1.4

    Xcode command line tools - 7.2 (Download from here: Xcode - Support - Apple Developer & Switch to different clang version: sudo xcode-select --switch/Library/Developer/CommandLineTools & check version: clang -v)

    Cmake - 3.7

    Bazel - 0.7.0

    CUDA - 9

    cuDNN - 7


    ***

    ### Requirements

    *sudo pip install six numpy wheel
  17. @smitshilu smitshilu revised this gist Nov 7, 2017. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions Installation.md
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@
    # Tensorflow


    **### System information**
    ### System information
    OS - High Sierra 10.13
    Tensorflow - 1.4
    Xcode command line tools - 7.2 (Download from here: Xcode - Support - Apple Developer & Switch to different clang version: sudo xcode-select --switch/Library/Developer/CommandLineTools & check version: clang -v)
    @@ -13,7 +13,7 @@ cuDNN - 7


    ***
    **### Requirements**
    ### Requirements

    *sudo pip install six numpy wheel

  18. @smitshilu smitshilu revised this gist Nov 7, 2017. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions Installation.md
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,8 @@
    ***
    # Tensorflow
    ***

    **System information**

    **### System information**
    OS - High Sierra 10.13
    Tensorflow - 1.4
    Xcode command line tools - 7.2 (Download from here: Xcode - Support - Apple Developer & Switch to different clang version: sudo xcode-select --switch/Library/Developer/CommandLineTools & check version: clang -v)
    @@ -13,7 +13,7 @@ cuDNN - 7


    ***
    **##Requirements##**
    **### Requirements**

    *sudo pip install six numpy wheel

  19. @smitshilu smitshilu revised this gist Nov 7, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Installation.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    ***
    #Tensorflow
    # Tensorflow
    ***

    **System information**
  20. @smitshilu smitshilu revised this gist Nov 7, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Installation.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    ***
    #Tensorflow#
    #Tensorflow
    ***

    **System information**
  21. @smitshilu smitshilu revised this gist Nov 7, 2017. 1 changed file with 6 additions and 3 deletions.
    9 changes: 6 additions & 3 deletions Installation.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,7 @@
    ***
    #Tensorflow#
    ***

    **System information**
    OS - High Sierra 10.13
    Tensorflow - 1.4
    @@ -10,9 +13,9 @@ cuDNN - 7


    ***
    **Requirements**
    **##Requirements##**

    ``*``sudo pip install six numpy wheel
    *sudo pip install six numpy wheel

    ``*``brew install coreutils
    *brew install coreutils

  22. @smitshilu smitshilu revised this gist Nov 7, 2017. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions Installation.md
    Original file line number Diff line number Diff line change
    @@ -11,6 +11,8 @@ cuDNN - 7

    ***
    **Requirements**

    ``*``sudo pip install six numpy wheel

    ``*``brew install coreutils

  23. @smitshilu smitshilu revised this gist Nov 7, 2017. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions Installation.md
    Original file line number Diff line number Diff line change
    @@ -11,6 +11,6 @@ cuDNN - 7

    ***
    **Requirements**
    sudo pip install six numpy wheel
    brew install coreutils
    ``*``sudo pip install six numpy wheel
    ``*``brew install coreutils

  24. @smitshilu smitshilu revised this gist Nov 7, 2017. 1 changed file with 12 additions and 10 deletions.
    22 changes: 12 additions & 10 deletions Installation.md
    Original file line number Diff line number Diff line change
    @@ -1,14 +1,16 @@
    Specifications

    *Specifications*

    **Specifications**
    ***
    **System information**
    OS - High Sierra 10.13
    Tensorflow - 1.4
    Xcode command line tools - 7.2 (Download from here: Xcode - Support - Apple Developer & Switch to different clang version: sudo xcode-select --switch/Library/Developer/CommandLineTools & check version: clang -v)
    Cmake - 3.7
    Bazel - 0.7.0
    CUDA - 9
    cuDNN - 7


    ***
    Tensorflow Version 1.4
    ***
    **Requirements**
    sudo pip install six numpy wheel
    brew install coreutils

    **
    TF
    **
  25. @smitshilu smitshilu revised this gist Nov 7, 2017. 1 changed file with 1 addition and 5 deletions.
    6 changes: 1 addition & 5 deletions Installation.md
    Original file line number Diff line number Diff line change
    @@ -11,8 +11,4 @@ Tensorflow Version 1.4

    **
    TF
    **
    @q
    #q
    !w
    'q
    **
  26. @smitshilu smitshilu revised this gist Nov 7, 2017. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion Installation.md
    Original file line number Diff line number Diff line change
    @@ -11,4 +11,8 @@ Tensorflow Version 1.4

    **
    TF
    **
    **
    @q
    #q
    !w
    'q
  27. @smitshilu smitshilu revised this gist Nov 6, 2017. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions Installation.md
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,8 @@
    Specifications

    *Specifications
    *Specifications*

    **Specifications
    **Specifications**


    ***
  28. @smitshilu smitshilu revised this gist Nov 6, 2017. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion Installation.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,7 @@
    Specifications
    *Specifications#

    *Specifications

    **Specifications


  29. @smitshilu smitshilu revised this gist Nov 6, 2017. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion Installation.md
    Original file line number Diff line number Diff line change
    @@ -5,4 +5,8 @@ Specifications

    ***
    Tensorflow Version 1.4
    ***
    ***

    **
    TF
    **
  30. @smitshilu smitshilu revised this gist Nov 6, 2017. 1 changed file with 6 additions and 1 deletion.
    7 changes: 6 additions & 1 deletion Installation.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,8 @@
    Specifications
    *Specifications#
    **Specifications
    **Specifications


    ***
    Tensorflow Version 1.4
    ***