├── LICENSE ├── README.md ├── buildTensorFlow.sh ├── cloneTensorFlow.sh ├── createSwapfile.sh ├── installPrerequisites.sh ├── installPrerequisitesPy3.sh ├── packageTensorFlow.sh ├── patches ├── tensorflow.patch └── workspacebzl.patch ├── scripts ├── installBazel.sh ├── installDependencies.sh └── installDependenciesPy3.sh ├── setLocalLib.sh ├── setTensorFlowEV.sh └── setTensorFlowEVPy3.sh /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Jetsonhacks 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # installTensorFlowTX2 2 | September 13, 2017 3 | JetsonHacks 4 | 5 | Install TensorFlow v1.3 on NVIDIA Jetson TX2 Development Kit 6 | 7 | Jetson TX2 is flashed with JetPack 3.1 which installs: 8 | * L4T 28.1 an Ubuntu 16.04 64-bit variant (aarch64) 9 | * CUDA 8.0 10 | * cuDNN 6.0 11 | 12 | ### Pre-built installation 13 | 14 | If you are only interested in installing Tensorflow on the TX2, not building from source, pre-built wheel files are available here: https://github.com/jetsonhacks/installTensorFlowJetsonTX 15 | 16 | If you are interested in building from source, read on. 17 | ### Preparation 18 | Before installing TensorFlow, a swap file should be created (minimum of 8GB recommended). The Jetson TX2 does not have enough physical memory to compile TensorFlow. The swap file may be located on the internal eMMC, and may be removed after the build. 19 | 20 | There is a convenience script for building a swap file. To build a 8GB swapfile on the eMMC in the home directory: 21 | 22 | $ ./createSwapfile.sh -d ~/ -s 8 23 | 24 | After TensorFlow has finished building, the swap file is no longer needed and may be removed. 25 | 26 | 27 | These scripts support either Python 2.7 or Python 3.5. 28 | TensorFlow should be built in the following order: 29 | 30 | ## For Python 2.7 31 | 32 | #### installPrerequisites.sh 33 | Installs Java and other dependencies needed. Also builds Bazel version 0.5.2. 34 | 35 | #### cloneTensorFlow.sh 36 | Git clones v1.3.0 from the TensorFlow repository and patches the source code for aarch64 37 | 38 | #### setTensorFlowEV.sh 39 | Sets up the TensorFlow environment variables. This script will ask for the default python library path. There are many settings to chose from, the script picks the usual suspects. Uses python 2.7. 40 | 41 | ## For Python 3.5 42 | 43 | #### installPrerequisitesPy3.sh 44 | Installs Java and other dependencies needed. Also builds Bazel version 0.5.2. 45 | 46 | #### cloneTensorFlow.sh 47 | Git clones v1.3.0 from the TensorFlow repository and patches the source code for aarch64 48 | 49 | #### setTensorFlowEVPy3.sh 50 | Sets up the TensorFlow environment variables. This script will ask for the default python library path. There are many settings to chose from, the script picks the usual suspects. Uses python 3.5. 51 | 52 | ## Build TensorFlow 53 | Once the prerequisites have been installed and the environment configured, it is time to build TensorFlow itself. 54 | 55 | #### buildTensorFlow.sh 56 | Builds TensorFlow. 57 | 58 | #### packageTensorFlow.sh 59 | Once TensorFlow has finished building, this script may be used to create a 'wheel' file, a package for installing with Python. The wheel file will be in the $HOME directory. 60 | 61 | #### Install wheel file 62 | For Python 2.X 63 | 64 | $ pip install $HOME/wheel file 65 | 66 | For Python 3.X 67 | 68 | $ pip3 install $HOME/wheel file 69 | 70 | 71 | ### Notes 72 | This TensorFlow installation procedure was derived from these discussion threads: 73 | 74 | 80 | 81 | ### Release Notes 82 | September 13, 2017 83 | * L4T 28.1 (JetPack 3.1) 84 | * TensorFlow 1.3 85 | * Github changed some sha256 checksums, patches added to workspace.bzl as workaround 86 | 87 | September 2017 88 | * L4T 28.1 (JetPack 3.1) 89 | * TensorFlow 1.3 90 | 91 | April 2017 92 | * Initial Release 93 | * L4T 27.1 (JetPack 3.0) 94 | * TensorFlow 1.0 95 | 96 | 97 | 98 | ## License 99 | MIT License 100 | 101 | Copyright (c) 2017 Jetsonhacks 102 | 103 | Permission is hereby granted, free of charge, to any person obtaining a copy 104 | of this software and associated documentation files (the "Software"), to deal 105 | in the Software without restriction, including without limitation the rights 106 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 107 | copies of the Software, and to permit persons to whom the Software is 108 | furnished to do so, subject to the following conditions: 109 | 110 | The above copyright notice and this permission notice shall be included in all 111 | copies or substantial portions of the Software. 112 | 113 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 114 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 115 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 116 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 117 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 118 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 119 | SOFTWARE. 120 | -------------------------------------------------------------------------------- /buildTensorFlow.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # NVIDIA Jetson TX2 3 | # TensorFlow Installation 4 | # Export TensorFlow GPU environment variables 5 | # WARNING This needs to match setTensorFlowEV.sh settings 6 | export TF_NEED_CUDA=1 7 | export TF_CUDA_VERSION=8.0 8 | export CUDA_TOOLKIT_PATH=/usr/local/cuda 9 | export TF_CUDNN_VERSION=6.0.21 10 | export CUDNN_INSTALL_PATH=/usr/lib/aarch64-linux-gnu/ 11 | export TF_CUDA_COMPUTE_CAPABILITIES=6.2 12 | 13 | # Build Tensorflow 14 | cd $HOME/tensorflow 15 | bazel build -c opt --local_resources 3072,4.0,1.0 --verbose_failures --config=cuda //tensorflow/tools/pip_package:build_pip_package 16 | 17 | -------------------------------------------------------------------------------- /cloneTensorFlow.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # NVIDIA Jetson TX2 3 | # TensorFlow Installation 4 | # Install Tensorflow repository then 5 | # setup for compilation 6 | # This does not build tensorflow 7 | INSTALL_DIR=$PWD 8 | cd $HOME 9 | git clone https://github.com/tensorflow/tensorflow.git 10 | cd tensorflow 11 | git checkout v1.3.0 12 | patch -p1 < $INSTALL_DIR/patches/tensorflow.patch 13 | # Patch up the Workspace.bzl for the Github Checksum issue 14 | patch -p1 < $INSTALL_DIR/patches/workspacebzl.patch 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /createSwapfile.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #NVIDIA Jetson TX1 3 | # Create a swap file and set up permissions 4 | # If a parameter is passed, it should be the place to create the swapfile 5 | SWAPDIRECTORY=$PWD 6 | SWAPSIZE=8 7 | AUTOMOUNT="N" 8 | function usage 9 | { 10 | echo "usage: createSwapFile [[[-d directory ] [-s size] -a] | [-h]]" 11 | echo "-d | --dir Directory to place swapfile" 12 | echo "-s | --size " 13 | echo "-a | --auto Enable swap on boot in /etc/fstab " 14 | echo "-h | --help This message" 15 | } 16 | 17 | while [ "$1" != "" ]; do 18 | case $1 in 19 | -d | --dir ) shift 20 | SWAPDIRECTORY=$1 21 | ;; 22 | -s | --size ) shift 23 | SWAPSIZE=$1 24 | ;; 25 | -a | --auto ) AUTOMOUNT="Y" 26 | ;; 27 | -h | --help ) usage 28 | exit 29 | ;; 30 | * ) usage 31 | exit 1 32 | esac 33 | shift 34 | done 35 | 36 | echo "Creating Swapfile at: " $SWAPDIRECTORY 37 | echo "Swapfile Size: " $SWAPSIZE"G" 38 | echo "Automount: " $AUTOMOUNT 39 | 40 | #Create a swapfile for Ubuntu at the current directory location 41 | fallocate -l $SWAPSIZE"G" $SWAPDIRECTORY"/swapfile" 42 | cd $SWAPDIRECTORY 43 | #List out the file 44 | ls -lh swapfile 45 | # Change permissions so that only root can use it 46 | sudo chmod 600 swapfile 47 | #List out the file 48 | ls -lh swapfile 49 | #Set up the Linux swap area 50 | sudo mkswap swapfile 51 | #Now start using the swapfile 52 | sudo swapon swapfile 53 | #Show that it's now being used 54 | swapon -s 55 | 56 | if [ "$AUTOMOUNT" = "Y" ]; then 57 | echo "Modifying /etc/fstab to enable on boot" 58 | SWAPLOCATION=$SWAPDIRECTORY"/swapfile" 59 | echo $SWAPLOCATION 60 | sudo sh -c 'echo "'$SWAPLOCATION' none swap sw 0 0" >> /etc/fstab' 61 | fi 62 | 63 | -------------------------------------------------------------------------------- /installPrerequisites.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # NVIDIA Jetson TX2 3 | # Install TensorFlow dependencies and prerequisites 4 | # Install Java and other dependencies by apt-get 5 | ./scripts/installDependencies.sh 6 | ./scripts/installBazel.sh 7 | 8 | 9 | -------------------------------------------------------------------------------- /installPrerequisitesPy3.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # NVIDIA Jetson TX2 3 | # Install TensorFlow dependencies and prerequisites 4 | # Install Java and other dependencies by apt-get 5 | ./scripts/installDependenciesPy3.sh 6 | ./scripts/installBazel.sh 7 | 8 | 9 | -------------------------------------------------------------------------------- /packageTensorFlow.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # NVIDIA Jetson TX2 3 | cd $HOME/tensorflow 4 | bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg 5 | mv /tmp/tensorflow_pkg/tensorflow-*.whl $HOME/ 6 | 7 | -------------------------------------------------------------------------------- /patches/tensorflow.patch: -------------------------------------------------------------------------------- 1 | diff --git a/tensorflow/core/kernels/cwise_op_gpu_select.cu.cc b/tensorflow/core/kernels/cwise_op_gpu_select.cu.cc 2 | index 02058a8..880a0c3 100644 3 | --- a/tensorflow/core/kernels/cwise_op_gpu_select.cu.cc 4 | +++ b/tensorflow/core/kernels/cwise_op_gpu_select.cu.cc 5 | @@ -43,8 +43,14 @@ struct BatchSelectFunctor { 6 | const int all_but_batch = then_flat_outer_dims.dimension(1); 7 | 8 | #if !defined(EIGEN_HAS_INDEX_LIST) 9 | - Eigen::array broadcast_dims{{ 1, all_but_batch }}; 10 | - Eigen::Tensor::Dimensions reshape_dims{{ batch, 1 }}; 11 | + // Eigen::array broadcast_dims{{ 1, all_but_batch }}; 12 | + Eigen::array broadcast_dims; 13 | + broadcast_dims[0] = 1; 14 | + broadcast_dims[1] = all_but_batch; 15 | + // Eigen::Tensor::Dimensions reshape_dims{{ batch, 1 }}; 16 | + Eigen::Tensor::Dimensions reshape_dims; 17 | + reshape_dims[0] = batch; 18 | + reshape_dims[1] = 1; 19 | #else 20 | Eigen::IndexList, int> broadcast_dims; 21 | broadcast_dims.set(1, all_but_batch); 22 | 23 | diff --git a/tensorflow/stream_executor/cuda/cuda_gpu_executor.cc b/tensorflow/stream_executor/cuda/cuda_gpu_executor.cc 24 | index b2da109..8ee1f3a 100644 25 | --- a/tensorflow/stream_executor/cuda/cuda_gpu_executor.cc 26 | +++ b/tensorflow/stream_executor/cuda/cuda_gpu_executor.cc 27 | @@ -870,7 +870,10 @@ CudaContext* CUDAExecutor::cuda_context() { return context_; } 28 | // For anything more complicated/prod-focused than this, you'll likely want to 29 | // turn to gsys' topology modeling. 30 | static int TryToReadNumaNode(const string &pci_bus_id, int device_ordinal) { 31 | -#if defined(__APPLE__) 32 | +#ifdef __aarch64__ 33 | + LOG(INFO) << "ARM64 does not support NUMA - returning NUMA node zero"; 34 | + return 0; 35 | +#elif defined(__APPLE__) 36 | LOG(INFO) << "OS X does not support NUMA - returning NUMA node zero"; 37 | return 0;N 38 | #elif defined(PLATFORM_WINDOWS) 39 | 40 | -------------------------------------------------------------------------------- /patches/workspacebzl.patch: -------------------------------------------------------------------------------- 1 | diff --git a/tensorflow/workspace.bzl b/tensorflow/workspace.bzl 2 | index 42840a2..d6c8086 100644 3 | --- a/tensorflow/workspace.bzl 4 | +++ b/tensorflow/workspace.bzl 5 | @@ -147,11 +147,11 @@ def tf_workspace(path_prefix="", tf_repo_name=""): 6 | native.new_http_archive( 7 | name = "eigen_archive", 8 | urls = [ 9 | - "http://mirror.bazel.build/bitbucket.org/eigen/eigen/get/f3a22f35b044.tar.gz", 10 | - "https://bitbucket.org/eigen/eigen/get/f3a22f35b044.tar.gz", 11 | + "http://mirror.bazel.build/bitbucket.org/eigen/eigen/get/d781c1de9834.tar.gz", 12 | + "https://bitbucket.org/eigen/eigen/get/d781c1de9834.tar.gz", 13 | ], 14 | - sha256 = "ca7beac153d4059c02c8fc59816c82d54ea47fe58365e8aded4082ded0b820c4", 15 | - strip_prefix = "eigen-eigen-f3a22f35b044", 16 | + sha256 = "a34b208da6ec18fa8da963369e166e4a368612c14d956dd2f9d7072904675d9b", 17 | + strip_prefix = "eigen-eigen-d781c1de9834", 18 | build_file = str(Label("//third_party:eigen.BUILD")), 19 | ) 20 | 21 | @@ -330,7 +330,7 @@ def tf_workspace(path_prefix="", tf_repo_name=""): 22 | "https://github.com/google/protobuf/archive/0b059a3d8a8f8aa40dde7bea55edca4ec5dfea66.tar.gz", 23 | "http://mirror.bazel.build/github.com/google/protobuf/archive/0b059a3d8a8f8aa40dde7bea55edca4ec5dfea66.tar.gz", 24 | ], 25 | - sha256 = "6d43b9d223ce09e5d4ce8b0060cb8a7513577a35a64c7e3dad10f0703bf3ad93", 26 | + # sha256 = "6d43b9d223ce09e5d4ce8b0060cb8a7513577a35a64c7e3dad10f0703bf3ad93", 27 | strip_prefix = "protobuf-0b059a3d8a8f8aa40dde7bea55edca4ec5dfea66", 28 | # TODO: remove patching when tensorflow stops linking same protos into 29 | # multiple shared libraries loaded in runtime by python. 30 | @@ -348,7 +348,7 @@ def tf_workspace(path_prefix="", tf_repo_name=""): 31 | "https://github.com/google/protobuf/archive/0b059a3d8a8f8aa40dde7bea55edca4ec5dfea66.tar.gz", 32 | "http://mirror.bazel.build/github.com/google/protobuf/archive/0b059a3d8a8f8aa40dde7bea55edca4ec5dfea66.tar.gz", 33 | ], 34 | - sha256 = "6d43b9d223ce09e5d4ce8b0060cb8a7513577a35a64c7e3dad10f0703bf3ad93", 35 | + # sha256 = "6d43b9d223ce09e5d4ce8b0060cb8a7513577a35a64c7e3dad10f0703bf3ad93", 36 | strip_prefix = "protobuf-0b059a3d8a8f8aa40dde7bea55edca4ec5dfea66", 37 | ) 38 | 39 | @@ -358,7 +358,7 @@ def tf_workspace(path_prefix="", tf_repo_name=""): 40 | "https://github.com/google/protobuf/archive/0b059a3d8a8f8aa40dde7bea55edca4ec5dfea66.tar.gz", 41 | "http://mirror.bazel.build/github.com/google/protobuf/archive/0b059a3d8a8f8aa40dde7bea55edca4ec5dfea66.tar.gz", 42 | ], 43 | - sha256 = "6d43b9d223ce09e5d4ce8b0060cb8a7513577a35a64c7e3dad10f0703bf3ad93", 44 | + # sha256 = "6d43b9d223ce09e5d4ce8b0060cb8a7513577a35a64c7e3dad10f0703bf3ad93", 45 | strip_prefix = "protobuf-0b059a3d8a8f8aa40dde7bea55edca4ec5dfea66", 46 | ) 47 | 48 | -------------------------------------------------------------------------------- /scripts/installBazel.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # NVIDIA Jetson TX2 3 | # TensorFlow Installation 4 | # Install Bazel 5 | # Version 0.10.0 6 | # We use the release distribution so that we don't have to build protobuf 7 | # 8 | INSTALL_DIR=$PWD 9 | cd $HOME 10 | wget --no-check-certificate https://github.com/bazelbuild/bazel/releases/download/0.10.0/bazel-0.10.0-dist.zip 11 | unzip bazel-0.10.0-dist.zip -d bazel-0.10.0-dist 12 | sudo chmod -R ug+rwx $HOME/bazel-0.10.0-dist 13 | # git clone https://github.com/bazelbuild/bazel.git 14 | cd bazel-0.10.0-dist 15 | ./compile.sh 16 | sudo cp output/bazel /usr/local/bin 17 | -------------------------------------------------------------------------------- /scripts/installDependencies.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # NVIDIA Jetson TX2 3 | # Install TensorFlow dependencies 4 | # Install Java 5 | sudo add-apt-repository ppa:webupd8team/java 6 | sudo apt-get update 7 | sudo apt-get install oracle-java8-installer -y 8 | # Install other dependencies 9 | sudo apt-get install zip unzip autoconf automake libtool curl zlib1g-dev maven -y 10 | # Install Python 2.x 11 | sudo apt-get install python-numpy swig python-dev python-pip python-wheel -y 12 | -------------------------------------------------------------------------------- /scripts/installDependenciesPy3.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # NVIDIA Jetson TX2 3 | # Install TensorFlow dependencies 4 | # Install Java 5 | sudo add-apt-repository ppa:webupd8team/java 6 | sudo apt-get update 7 | sudo apt-get install oracle-java8-installer -y 8 | # Install other dependencies 9 | sudo apt-get install zip unzip autoconf automake libtool curl zlib1g-dev maven -y 10 | # Install Python 3.x 11 | sudo apt-get install python3-numpy swig python3-dev python3-pip python3-wheel -y 12 | -------------------------------------------------------------------------------- /setLocalLib.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # NVIDIA Jetson TX2 3 | # TensorFlow Installation 4 | # Useful setup command to set library path 5 | sudo sh -c 'echo /usr/local/lib >> /etc/ld.so.conf' 6 | sudo ldconfig 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /setTensorFlowEV.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # NVIDIA Jetson TX2 3 | # TensorFlow Installation 4 | # Build TensorFlow 5 | 6 | cd $HOME/tensorflow 7 | # TensorFlow couldn't find include file for some reason 8 | # TensorFlow expects it in /usr/lib/aarch64-linux-gnu/include/cudnn.h 9 | sudo mkdir /usr/lib/aarch64-linux-gnu/include/ 10 | sudo cp /usr/include/cudnn.h /usr/lib/aarch64-linux-gnu/include/cudnn.h 11 | # Setup the environment variables for configuration 12 | # PYTHON Path is the default 13 | default_python_bin_path=$(which python) 14 | PYTHON_BIN_PATH=$default_python_bin_path 15 | # No Google Cloud Platform support 16 | TF_NEED_GCP=0 17 | # No Hadoop file system support 18 | TF_NEED_HDFS=0 19 | # Use CUDA 20 | TF_NEED_CUDA=1 21 | # Setup gcc ; just use the default 22 | default_gcc_host_compiler_path=$(which gcc) 23 | GCC_HOST_COMPILER_PATH=$default_gcc_host_compiler_path 24 | # TF CUDA Version 25 | TF_CUDA_VERSION=8.0 26 | # CUDA path 27 | default_cuda_path=/usr/local/cuda 28 | CUDA_TOOLKIT_PATH=$default_cuda_path 29 | # cuDNN 30 | TF_CUDNN_VERSION=6.0.21 31 | default_cudnn_path=/usr/lib/aarch64-linux-gnu 32 | CUDNN_INSTALL_PATH=$default_cudnn_path 33 | # CUDA compute capability 34 | TF_CUDA_COMPUTE_CAPABILITIES=6.2 35 | CC_OPT_FLAGS=-march=native 36 | TF_NEED_JEMALLOC=1 37 | TF_NEED_OPENCL=0 38 | TF_ENABLE_XLA=0 39 | # Added for TensorFlow 1.3 40 | TF_NEED_MKL=0 41 | TF_NEED_MPI=0 42 | TF_NEED_VERBS=0 43 | # Use nvcc for CUDA compiler 44 | TF_CUDA_CLANG=0 45 | 46 | 47 | source ./configure 48 | -------------------------------------------------------------------------------- /setTensorFlowEVPy3.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # NVIDIA Jetson TX2 3 | # TensorFlow Installation 4 | # Build TensorFlow 5 | 6 | cd $HOME/tensorflow 7 | # TensorFlow couldn't find include file for some reason 8 | # TensorFlow expects it in /usr/lib/aarch64-linux-gnu/include/cudnn.h 9 | sudo mkdir /usr/lib/aarch64-linux-gnu/include/ 10 | sudo cp /usr/include/cudnn.h /usr/lib/aarch64-linux-gnu/include/cudnn.h 11 | # Setup the environment variables for configuration 12 | # PYTHON Path is the default 13 | default_python_bin_path=$(which python3) 14 | PYTHON_BIN_PATH=$default_python_bin_path 15 | # No Google Cloud Platform support 16 | TF_NEED_GCP=0 17 | # No Hadoop file system support 18 | TF_NEED_HDFS=0 19 | # Use CUDA 20 | TF_NEED_CUDA=1 21 | # Setup gcc ; just use the default 22 | default_gcc_host_compiler_path=$(which gcc) 23 | GCC_HOST_COMPILER_PATH=$default_gcc_host_compiler_path 24 | # TF CUDA Version 25 | TF_CUDA_VERSION=8.0 26 | # CUDA path 27 | default_cuda_path=/usr/local/cuda 28 | CUDA_TOOLKIT_PATH=$default_cuda_path 29 | # cuDNN 30 | TF_CUDNN_VERSION=6.0.21 31 | default_cudnn_path=/usr/lib/aarch64-linux-gnu 32 | CUDNN_INSTALL_PATH=$default_cudnn_path 33 | # CUDA compute capability 34 | TF_CUDA_COMPUTE_CAPABILITIES=6.2 35 | CC_OPT_FLAGS=-march=native 36 | TF_NEED_JEMALLOC=1 37 | TF_NEED_OPENCL=0 38 | TF_ENABLE_XLA=0 39 | # Added for TensorFlow 1.3 40 | TF_NEED_MKL=0 41 | TF_NEED_MPI=0 42 | TF_NEED_VERBS=0 43 | # Use nvcc for CUDA compiler 44 | TF_CUDA_CLANG=0 45 | 46 | 47 | source ./configure 48 | --------------------------------------------------------------------------------