This guide shows how to cross compile TensorRT samples for AArch64 QNX, Linux and Android platform under x86_64 Linux.
-
Install the CUDA cross-platform toolkit for the the corresponding target, and set the environment variable
CUDA_INSTALL_DIRexport CUDA_INSTALL_DIR="your cuda install dir"
CUDA_INSTALL_DIRis set to/usr/local/cudaby default. -
Install the cuDNN cross-platform libraries for the corresponding target, and set the environment variable
CUDNN_INSTALL_DIRexport CUDNN_INSTALL_DIR="your cudnn install dir"
CUDNN_INSTALL_DIRis set toCUDA_INSTALL_DIRby default. -
Install the TensorRT cross compilation debian packages for the corresponding target.
- QNX AArch64: libnvinfer-dev-cross-qnx, libnvinfer5-cross-qnx
- Linux AArch64: libnvinfer-dev-cross-aarch64, libnvinfer5-cross-aarch64
- Android AArch64: No debian packages are available.
If you are using the tar file released by the TensorRT team, you can safely skip this step. The tar file release already includes the cross compile libraries so no additional packages are required.
Download the QNX toolchain and export the following environment variables.
export QNX_HOST=/path/to/your/qnx/toolchains/host/linux/x86_64
export QNX_TARGET=/path/to/your/qnx/toolchain/target/qnx7Build samples via
cd /path/to/TensorRT/samples
make TARGET=qnxSample compilation for Linux aarch64 needs the corresponding g++ compiler, aarch64-linux-gnu-g++. In Ubuntu, this can be installed via
sudo apt-get install g++-aarch64-linux-gnuBuild samples via
cd /path/to/TensorRT/samples
make TARGET=aarch64Download Android NDK(r16b) from https://developer.android.com/ndk/. After downloading the NDK, create a standalone toolchain, for example
$NDK/build/tools/make_standalone_toolchain.py \
--arch arm64 \
--api 26 \
--install-dir=/path/to/my-toolchainYou can check the details on https://developer.android.com/ndk/guides/standalone_toolchain.
Build samples via
cd /path/to/TensorRT/samples
make TARGET=android64 ANDROID_CC=/path/to/my-toolchain/bin/aarch64-linux-android-clang++