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 "6.0-dp" for development with JetPack SDK 6.0 DP 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
cat targetfs.tbz2.* > targetfs.tbz2
tar -I lbzip2 -xf targetfs.tbz2
mkdir toolchain
tar -C toolchain -xf toolchain.tar.gz
cd /l4t
cat targetfs.tbz2.* > targetfs.tbz2
tar -I lbzip2 -xf targetfs.tbz2
mkdir toolchain
tar -C toolchain -xf toolchain.tar.bz2
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
export TOOLCHAIN_DIR="/l4t/toolchain"
export CROSS_COMPILE_AARCH64_PATH="$TOOLCHAIN_DIR/aarch64--glibc--stable-2022.08-1/"
export CROSS_COMPILE_AARCH64="$TOOLCHAIN_DIR/aarch64--glibc--stable-2022.08-1/bin/aarch64-buildroot-linux-gnu-"
cd /workspace
tar -I lbzip2 -xf public_sources.tbz2
cd ./Linux_for_Tegra/source/
mkdir kernel_src_out/
tar -I lbzip2 -C kernel_src_out/ -xf kernel_src.tbz2
tar -I lbzip2 -C kernel_src_out/ -xf kernel_oot_modules_src.tbz2
tar -I lbzip2 -C kernel_src_out/ -xf nvidia_kernel_display_driver_source.tbz2
cd kernel_src_out/
CROSS_COMPILE="$CROSS_COMPILE_AARCH64_PATH/bin/aarch64-buildroot-linux-gnu-" ./nvbuild.sh
cd ..
mkdir atf_src_out/
tar -I lbzip2 -C atf_src_out/ -xf atf_src.tbz2
cd atf_src_out/
NV_TARGET_BOARD=generic ./nvbuild.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 (JetPack 5 only):
<Linux_for_Tegra>/bootloader/standalonemm_optee_t194.bin
For the Jetson 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/
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/local/bin/python3" 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/local/bin/python3" UEFI_STMM_PATH=/Linux_for_Tegra/bootloader/standalonemm_optee_t234.bin ./optee_src_build.sh -p t234
Use below command to cross compile for Jetson Orin series
CROSS_COMPILE_AARCH64=/l4t/toolchain/aarch64--glibc--stable-2022.08-1/bin/aarch64-buildroot-linux-gnu- CROSS_COMPILE_AARCH64_PATH=/l4t/toolchain/aarch64--glibc--stable-2022.08-1 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
git clone https://github.com/NVIDIA/cuda-samples.git
cd cuda-samples
make TARGET_ARCH=aarch64 TARGET_OS=linux TARGET_FS=/l4t/targetfs/ SMS=${SOC_SMS}
${SOC_SMS} is 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
cd /l4t
/opt/nvidia/vpi3/bin/vpi_install_samples.sh .
cd NVIDIA_VPI-3.0-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)"
cd /l4t
edkrepo manifest-repos add nvidia https://github.com/NVIDIA/edk2-edkrepo-manifest.git main nvidia
edkrepo clone nvidia-uefi NVIDIA-Platforms stable202210
cd nvidia-uefi
edk2-nvidia/Platform/NVIDIA/Jetson/build.sh
cd /l4t
edkrepo manifest-repos add nvidia https://github.com/NVIDIA/edk2-edkrepo-manifest.git main nvidia
edkrepo clone nvidia-uefi NVIDIA-Platforms main
cd nvidia-uefi
edk2-nvidia/Platform/NVIDIA/Jetson/build.sh
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.