title: installation tensorflow: cannot stat '/usr/include/cudnn.h'
body: <p>I am trying to install tensorflow on my Jetson TX2 and am therefor following this tutorial from Jetsonhacks: <a href="https://www.youtube.com/watch?v=V51IO7kNXCg" rel="nofollow noreferrer">https://www.youtube.com/watch?v=V51IO7kNXCg</a></p>
  
  <p>When trying to execute ./setTensorflowEV.sh I get the following output:</p>
  
  <pre><code>~/installTensorFlowTX2$ ./setTensorFlowEV.sh 
  mkdir: cannot create directory ‘/usr/lib/aarch64-linux-gnu/include/’: File exists
  cp: cannot stat '/usr/include/cudnn.h': No such file or directory
  You have bazel 0.5.2- installed.
  Found possible Python library paths:
    /usr/local/lib/python2.7/dist-packages
    /usr/lib/python2.7/dist-packages
  Please input the desired Python library path to use.  Default is [/usr/local/lib/python2.7/dist-    packages]
  
  Using python library path: /usr/local/lib/python2.7/dist-packages
  Invalid path to CUDA 8.0 toolkit. /usr/local/cuda/lib64/libcudart.so.8.0 cannot be found
  </code></pre>
  
  <p>The content of the file setTensorflowEV.sh: <a href="https://github.com/jetsonhacks/installTensorFlowTX2/blob/master/setTensorFlowEV.sh" rel="nofollow noreferrer">https://github.com/jetsonhacks/installTensorFlowTX2/blob/master/setTensorFlowEV.sh</a></p>
  
  <p>I tried to locate cudnn.h on my system ($locate cudnn.h), but it isn't anywhere. I also looked at what I need to install in  the shared object (sudo apt-file search libcudart.so.8.0), but that returned nothing neither.</p>
  
  <p>So I would like to know what I can do to not have this error message any more.</p>
  
  <p><strong>Important note: I don't have physical access to the board to flash it or anything like that</strong></p>
  
  <p>I tried disabling cuda like so <code>TF_CUDA_NEED=0</code></p>
  
  <p>which gives:</p>
  
  <pre><code>~/installTensorFlowTX2$ ./setTensorFlowEV.sh 
  mkdir: cannot create directory ‘/usr/lib/aarch64-linux-gnu/include/’: File exists
  cp: cannot stat '/usr/include/cudnn.h': No such file or directory
  You have bazel 0.5.2- installed.
  Found possible Python library paths:
    /usr/local/lib/python2.7/dist-packages
    /usr/lib/python2.7/dist-packages
  Please input the desired Python library path to use.  Default is [/usr/local/lib/python2.7/dist-packages]
  
  Using python library path: /usr/local/lib/python2.7/dist-packages
  Configuration finished
  </code></pre>
  
  <p>but when trying to build Tensorflow I get:</p>
  
  <pre><code>~/installTensorFlowTX2$ ./buildTensorFlow.sh 
  ERROR: /home/nvidia/.cache/bazel/_bazel_nvidia/d2751a49dacf4cb14a513ec663770624/external/local_config_cuda/crosstool/BUILD:4:1: Traceback (most recent call last):
      File "/home/nvidia/.cache/bazel/_bazel_nvidia/d2751a49dacf4cb14a513ec663770624/external/local_config_cuda/crosstool/BUILD", line 4
          error_gpu_disabled()
      File "/home/nvidia/.cache/bazel/_bazel_nvidia/d2751a49dacf4cb14a513ec663770624/external/local_config_cuda/crosstool/error_gpu_disabled.bzl", line 3, in error_gpu_disabled
          fail("ERROR: Building with --config=c...")
  ERROR: Building with --config=cuda but TensorFlow is not configured to build with GPU support. Please re-run ./configure and enter 'Y' at the prompt to build with GPU support.
  ERROR: no such target '@local_config_cuda//crosstool:toolchain': target 'toolchain' not declared in package 'crosstool' defined by /home/nvidia/.cache/bazel/_bazel_nvidia/d2751a49dacf4cb14a513ec663770624/external/local_config_cuda/crosstool/BUILD.
  INFO: Elapsed time: 0.403s
  </code></pre>
  
  <p>I don't have a ./configure script anywhere and set the line like so <code>export TF_NEED_CUDA=0</code> in <strong>my</strong> ./buildTensorFlow.sh file:</p>
  
  <pre><code>#this is my modified buildTensorFlow.sh file
  export TF_NEED_CUDA=0
  export TF_CUDA_VERSION=8.0
  export CUDA_TOOLKIT_PATH=/usr/local/cuda
  export TF_CUDNN_VERSION=6.0.21
  export CUDNN_INSTALL_PATH=/usr/lib/aarch64-linux-gnu/
  export TF_CUDA_COMPUTE_CAPABILITIES=6.2
  
  # Build Tensorflow
  cd $HOME/tensorflow
  bazel build -c opt --local_resources 3072,4.0,1.0 --verbose_failures --config=cuda //tensorflow/tools/pip_package:build_pip_package
  </code></pre>