jkjung-avt / jetson_nano

This repository is a collection of scripts/programs I use to set up the software development environment on my Jetson Nano, TX2, and Xavier NX.
MIT License
293 stars 134 forks source link

build tensorflow on jetson nano #8

Closed PythonImageDeveloper closed 4 years ago

PythonImageDeveloper commented 4 years ago

I want to build tensorflow-1.14.0 with jetpack4.3, Bazel-0.25.2, protobuf-3.8.0 on jetson nano, I get this error:

ERROR: /home/jnano/.cache/bazel/_bazel_root/11848d91bbe32367362bd23b83211c84/external/local_config_cuda/crosstool/BUILD:24:1: in cc_toolchain_suite rule @local_config_cuda//crosstool:toolchain: cc_toolchain_suite '@local_config_cuda//crosstool:toolchain' does not contain a toolchain for cpu 'aarch64' ERROR: Analysis of target '//tensorflow/tools/pip_package:build_pip_package' failed; build aborted: Analysis of target '@local_config_cuda//crosstool:toolchain' failed; build aborted INFO: Elapsed time: 20.502s INFO: 0 processes. FAILED: Build did NOT complete successfully (114 packages loaded, 175 targets configured) currently loading: tensorflow/core/kernels ... (2 packages)

I get the same error using jetpack-4.2.2 for building the TensorFlow-1.12.2, for solving the problem I set to disable for TensorRT configure, correclty build the .whl file:

PYTHON_BIN_PATH=$(which python3) \ PYTHON_LIB_PATH=$(python3 -c 'import site; print(site.getsitepackages()[0])') \ TF_CUDA_COMPUTE_CAPABILITIES=${cuda_compute} \ TF_CUDA_VERSION=10.0 \ TF_CUDA_CLANG=0 \ TF_CUDNN_VERSION=7 \ TF_TENSORRT_VERSION=${trt_version} \ -----> remove this line CUDA_TOOLKIT_PATH=/usr/local/cuda \ CUDNN_INSTALL_PATH=/usr/lib/aarch64-linux-gnu \ TENSORRT_INSTALL_PATH=/usr/lib/aarch64-linux-gnu \ ---> remove this line TF_NEED_IGNITE=0 \ TF_ENABLE_XLA=0 \ TF_NEED_OPENCL_SYCL=0 \ TF_NEED_COMPUTECPP=0 \ TF_NEED_ROCM=0 \ TF_NEED_CUDA=1 \ TF_NEED_TENSORRT=1 \ --- > set to 0 TF_NEED_OPENCL=0 \ TF_NEED_MPI=0 \

jkjung-avt commented 4 years ago

It seems that bazel could not find your CUDA toolchain. Did you add cuda related paths into your ${PATH} and ${LD_LIBRARY_PATH}? Reference:

https://github.com/jkjung-avt/jetson_nano/blob/master/install_basics.sh#L8 https://github.com/jkjung-avt/jetson_nano/blob/master/install_basics.sh#L9

PythonImageDeveloper commented 4 years ago

Yes,

jnano@jnano-desktop:~/jetson_nano$ nvcc -V nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2019 NVIDIA Corporation Built on Mon_Mar_11_22:13:24_CDT_2019 Cuda compilation tools, release 10.0, V10.0.326

in the tensorflow folder your Github, have onle tensorflow patch of 1.12.2, 1.15.0, 2.0 versions, How you get these patch files, you created them by yourself?

jkjung-avt commented 4 years ago

I referenced other online resources, as well as tensorflow/issues, and created the patch files.