NGC | Catalog
CatalogContainersJetPack Cross Compilation container

JetPack Cross Compilation container

Logo for JetPack Cross Compilation container
Features
Description
JetPack cross compilation 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.
Publisher
NVIDIA
Latest Tag
6.0-dp
Modified
February 1, 2024
Compressed Size
31.38 GB
Multinode Support
No
Multi-Arch Support
No
6.0-dp (Latest) Security Scan Results

Linux / amd64

Sorry, your browser does not support inline SVG.

Overview of JetPack Cross Compilation Container

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.

Using the JetPack Cross Compilation Container

Pull the container

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 container

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:

  • JetPack 5
cd /l4t
cat targetfs.tbz2.* > targetfs.tbz2
tar -I lbzip2 -xf targetfs.tbz2
mkdir toolchain
tar -C toolchain -xf toolchain.tar.gz
  • JetPack 6
cd /l4t
cat targetfs.tbz2.* > targetfs.tbz2
tar -I lbzip2 -xf targetfs.tbz2
mkdir toolchain
tar -C toolchain -xf toolchain.tar.bz2

To cross compile L4T public sources

  1. Download L4T Driver Package (BSP) Sources which should be named as public_source.tbz2 from Jetson Linux page and place it under ${WORKSPACE} before starting the container.
  2. Inside the container run the commands below:
  • JetPack 5
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
  • JetPack 6
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

To cross compile OP-TEE source

  1. Download L4T Driver Package (BSP) Sources which should be named as public_source.tbz2 from Jetson Linux page and place it under ${WORKSPACE}.

  2. Download L4T Driver Package (BSP) from Jetson Linux page.

  3. 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

  4. Run the container with the additional option below:

-v <Your_L4T_BSP_Directory>:/Linux_for_Tegra/
  1. Inside the container run the commands below:
cd /workspace
tar -I lbzip2 -xf public_sources.tbz2
cd ./Linux_for_Tegra/source/
tar -I lbzip2 -xf nvidia-jetson-optee-source.tbz2
  • JetPack 5

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
  • JetPack 6

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

To cross compile Jetson Multimedia API samples (JetPack 5 only)

  1. Inside the container run the commands below:
cd /l4t/targetfs/usr/src/jetson_multimedia_api
export CROSS_COMPILE=aarch64-linux-gnu-
export TARGET_ROOTFS=/l4t/targetfs/
make

To cross compile CUDA samples

  1. Inside the container run the commands below:
  • JetPack 5
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.

  • JetPack 6
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.

To cross compile VPI samples

  1. Inside the container run the commands below:
  • JetPack 5
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
  • JetPack 6
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

To cross compile TensorRT samples

  1. Inside the container run the commands below:
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)"

To cross compile UEFI

  1. Inside the container run the commands below:
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

Documentation

License

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.

Technical Support

If you have any questions or need help, please visit the Jetson Developer Forums.