installation tensorflow: cannot stat '/usr/include/cudnn.h'

Hello

I am trying to install tensorflow on my Jetson TX2 and am therefor following this tutorial from Jetsonhacks: https://www.youtube.com/watch?v=V51IO7kNXCg

When trying to execute ./setTensorflowEV.sh I get the following output:

~/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

The content of the file setTensorflowEV.sh: https://github.com/jetsonhacks/installTensorFlowTX2/blob/master/setTensorFlowEV.sh

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.

So I would like to know what I can do to not have this error message any more.

Important note: I don’t have physical access to the board to flash it or anything like that

I tried disabling cuda like so TF_CUDA_NEED=0

which gives:

~/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

but when trying to build Tensorflow I get:

~/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

I don’t have a ./configure script anywhere and set the line like so export TF_NEED_CUDA=0 in [u]my[\u] ./buildTensorFlow.sh file:

#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

The installation instructions you mentioned require CUDA and cuDNN to be installed on the Jetson before the TensorFlow build. The JetPack installer is generally used to install CUDA and cuDNN. I am not sure that you can use JetPack without physical access to the Jetson, but you can certainly try. Go to JetPack and configure just to install CUDA and cuDNN, and disable the flash image and other options.

Hi,

Please install CUDA and cuDNN via JetPack first.
For package installation, network connection should be enough.

Thanks.