Linux / amd64
JetPack build container can be used to cross compile various JetPack components on a x86 host machine. This container simplifies cross compilation and includes the needed cross compilation tools and build environment already setup within it.
Pull the corresponding JetPack Build docker image matching JetPack SDK version. For example use the docker image tagged by "5.0.2" for development with JetPack SDK 5.0.2 production release. Below th ${SW_VERSION} is used to represent the docker image tag and JetPack SDK version.
docker pull nvcr.io/nvidia/jetpack-linux-aarch64-crosscompile-x86:${SW_VERSION}
Run the docker with the command on host:
docker run -it --privileged --net=host -v /dev/bus/usb:/dev/bus/usb -v ${WORKSPACE}:/workspace nvcr.io/nvidia/jetpack-linux-aarch64-crosscompile-x86:${SW_VERSION}
${WORKSPACE} is the path which includes the files one would like to use in the container.
Inside the container, extract the targetfs and toolchain:
cd /l4t
tar -I lbzip2 -xf targetfs.tbz2
mkdir toolchain
tar -C toolchain -xf toolchain.tar.gz
cd /workspace
tar -I lbzip2 -xf public_sources.tbz2
cd ./Linux_for_Tegra/source/public
CROSS_COMPILE_AARCH64=/l4t/toolchain/bin/aarch64-buildroot-linux-gnu- CROSS_COMPILE_AARCH64_PATH=/l4t/toolchain NV_TARGET_BOARD=t186ref ./nv_public_src_build.sh
Download L4T Driver Package (BSP) Sources which should be named as public_source.tbz2 from Jetson Linux page and place it under ${WORKSPACE}.
Download L4T Driver Package (BSP) from Jetson Linux page.
Extract L4T Driver Package (BSP)
A UEFI StMM image is required when building OP-TEE. The image is usually at:
For the Jetson AGX Xavier series and the Jetson Xavier NX:
<Linux_for_Tegra>/bootloader/standalonemm_optee_t194.bin
For the Jetson AGX Orin series:
<Linux_for_Tegra>/bootloader/standalonemm_optee_t234.bin
Run the container with the additional option below:
-v <Your_L4T_BSP_Directory>:/Linux_for_Tegra/
cd /workspace
tar -I lbzip2 -xf public_sources.tbz2
cd ./Linux_for_Tegra/source/public
tar -I lbzip2 -xf nvidia-jetson-optee-source.tbz2
Use below command to cross compile for Jetson AGX Xavier series or Jetson Xavier NX series
CROSS_COMPILE_AARCH64=/l4t/toolchain/bin/aarch64-buildroot-linux-gnu- CROSS_COMPILE_AARCH64_PATH=/l4t/toolchain PYTHON3_PATH="/usr/bin/python3.8" UEFI_STMM_PATH=/Linux_for_Tegra/bootloader/standalonemm_optee_t194.bin ./optee_src_build.sh -p t194
Use below command to cross compile for Jetson AGX Orin series
CROSS_COMPILE_AARCH64=/l4t/toolchain/bin/aarch64-buildroot-linux-gnu- CROSS_COMPILE_AARCH64_PATH=/l4t/toolchain PYTHON3_PATH="/usr/bin/python3.8" UEFI_STMM_PATH=/Linux_for_Tegra/bootloader/standalonemm_optee_t234.bin ./optee_src_build.sh -p t234
cd /l4t/targetfs/usr/src/jetson_multimedia_api
export CROSS_COMPILE=aarch64-linux-gnu-
export TARGET_ROOTFS=/l4t/targetfs/
make
cd /l4t
/l4t/targetfs/usr/local/cuda/bin/cuda-install-samples-11.4.sh .
cd NVIDIA_CUDA-11.4_Samples
make TARGET_ARCH=aarch64 TARGET_OS=linux TARGET_FS=/l4t/targetfs/ SMS=${SOC_SMS}
${SOC_SMS} is 72 for Xavier iGPU, 75 for Xavier dGPU, and 87 for Orin iGPU.
cd /l4t
/opt/nvidia/vpi2/bin/vpi_install_samples.sh .
cd NVIDIA_VPI-2.2-samples/08-cross_aarch64_l4t/
cmake . -DCMAKE_TOOLCHAIN_FILE=Toolchain_aarch64_l4t.cmake
make
export CUDA_INSTALL_DIR=/usr/local/cuda
export CUDNN_INSTALL_DIR=/usr/lib/aarch64-linux-gnu/
cd /usr/src/tensorrt/samples/
make TARGET=aarch64 -j"$(nproc)"
The jetpack-linux-aarch64-crosscompile-x86 includes various software packages with their respective licenses included within the container. By pulling and using this container, you accept the terms and conditions of these licenses.
If you have any questions or need help, please visit the Jetson Developer Forums.