From cf7469f47b3fbbe55727a7582918a567003860ff Mon Sep 17 00:00:00 2001 From: "Po-Wei Wang (Vincent)" Date: Tue, 1 Sep 2026 12:17:26 -0700 Subject: [PATCH 1/2] Add DriveOS sample build instructions to the README Signed-off-by: Po-Wei Wang (Vincent) --- README.md | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/README.md b/README.md index 0e2088409..5ce8d9dd0 100644 --- a/README.md +++ b/README.md @@ -226,6 +226,85 @@ For Linux platforms, we recommend that you generate a docker container for build - `GPU_ARCHS`: GPU (SM) architectures to target. By default we generate CUDA code for all major SMs. Specific SM versions can be specified here as a quoted space-separated list to reduce compilation time and binary size. Table of compute capabilities of NVIDIA GPUs can be found [here](https://developer.nvidia.com/cuda-gpus). Examples: - NVidia A100: `-DGPU_ARCHS="80"` - RTX 50 series: `-DGPU_ARCHS="120"` - Multiple SMs: `-DGPU_ARCHS="80 120"` - `TRT_PLATFORM_ID`: Bare-metal build (unlike containerized cross-compilation). Currently supported options: `x86_64` (default). +## Building TensorRT DriveOS Samples + + The TensorRT samples are no longer included in the DriveOS SDK under `/usr/src/tensorrt`. + This is expected since samples have moved to GitHub when switching to CMake. + + Follow the DriveOS Installation Guide to launch the DriveOS Linux NSR container, then + follow the rest of these instructions to clone and build this repository in that container. + + Access the DriveOS Installation Guide for the current release at + Developer Zone - https://developer.nvidia.com/drive/documentation + NVONLINE - Search for "NVIDIA DriveOS 7.x Installation Guide" + +- Generate Makefiles and build + + **Example: Cross-Compile for DOS7 Linux (aarch64)** + + ```bash + cd $TRT_OSSPATH + mkdir -p build && cd build + cmake .. -DBUILD_SAMPLES=ON -DBUILD_PLUGINS=OFF -DBUILD_PARSERS=OFF -DTRT_OUT_DIR=`pwd`/bin_dynamic_cross -DTRT_LIB_DIR=$TRT_LIBPATH -DCMAKE_TOOLCHAIN_FILE=$TRT_OSSPATH/cmake/toolchains/cmake_aarch64_dos_cross.toolchain + make -j$(nproc) + ``` + + **Example: Cross-Compile for DOS6.5 Linux (aarch64)** + + ```bash + cd $TRT_OSSPATH + mkdir -p build && cd build + cmake .. -DBUILD_SAMPLES=ON -DBUILD_PLUGINS=OFF -DBUILD_PARSERS=OFF -DTRT_OUT_DIR=`pwd`/bin_dynamic_cross -DTRT_LIB_DIR=$TRT_LIBPATH -DCMAKE_TOOLCHAIN_FILE=$TRT_OSSPATH/cmake/toolchains/cmake_aarch64_dos_cross.toolchain -DCUDA_VERSION=11.4 -DCMAKE_CUDA_ARCHITECTURES=87 + make -j$(nproc) + ``` + + **Example: Native build for DOS6.5 and DOS7 Linux (aarch64)** + + ```bash + cd $TRT_OSSPATH + mkdir -p build && cd build + cmake .. -DTRT_LIB_DIR=$TRT_LIBPATH -DTRT_OUT_DIR=`pwd`/out -DTRT_PLATFORM_ID=aarch64 -DBUILD_SAMPLES=ON -DBUILD_PLUGINS=OFF -DBUILD_PARSERS=OFF + make -j$(nproc) + ``` + + **Example: Cross-Compile for DOS6.5 QNX (aarch64)** + + ```bash + cd $TRT_OSSPATH + mkdir -p build && cd build + export CUDA_VERSION=11.4 + export CUDA=cuda-$CUDA_VERSION + export CUDA_ROOT=/usr/local/cuda-safe-$CUDA_VERSION + export QNX_BASE=/drive/toolchains/qnx_toolchain # Set to your QNX toolchain installation path + export QNX_HOST=$QNX_BASE/host/linux/x86_64/ + export QNX_TARGET=$QNX_BASE/target/qnx7/ + export PATH=$PATH:$QNX_HOST/usr/bin + cmake .. -DBUILD_SAMPLES=ON -DBUILD_PLUGINS=OFF -DBUILD_PARSERS=OFF -DBUILD_SAFE_SAMPLES=OFF -DCMAKE_CUDA_COMPILER=$CUDA_ROOT/bin/nvcc -DTRT_OUT_DIR=`pwd`/bin_dynamic_cross -DTRT_LIB_DIR=$TRT_LIBPATH -DCMAKE_TOOLCHAIN_FILE=$TRT_OSSPATH/cmake/toolchains/cmake_qnx.toolchain -DCUDA_VERSION=$CUDA_VERSION -DCMAKE_CUDA_ARCHITECTURES=87 + make -j$(nproc) + ``` + + > NOTE: Set `QNX_BASE` to your QNX toolchain installation path. + > If your CUDA version is not the same as in the example, set `CUDA_VERSION` (for examples that use it in multiple places) or add `-DCUDA_VERSION=` to the cmake command. + + **Example: Cross-Compile for DOS7 QNX (aarch64)** + + ```bash + cd $TRT_OSSPATH + mkdir -p build && cd build + export CUDA_VERSION=13.2 + export CUDA=cuda-$CUDA_VERSION + export CUDA_ROOT=/usr/local/cuda-safe-$CUDA_VERSION + export QNX_BASE=/drive/toolchains/qnx_toolchain # Set to your QNX toolchain installation path + export QNX_HOST=$QNX_BASE/host/linux/x86_64/ + export QNX_TARGET=$QNX_BASE/target/qnx/ + export PATH=$PATH:$QNX_HOST/usr/bin + cmake .. -DBUILD_SAMPLES=ON -DBUILD_PLUGINS=OFF -DBUILD_PARSERS=OFF -DBUILD_SAFE_SAMPLES=OFF -DCMAKE_CUDA_COMPILER=$CUDA_ROOT/bin/nvcc -DTRT_OUT_DIR=`pwd`/bin_dynamic_cross -DTRT_LIB_DIR=$TRT_LIBPATH -DCMAKE_TOOLCHAIN_FILE=$TRT_OSSPATH/cmake/toolchains/cmake_qnx.toolchain -DCUDA_VERSION=$CUDA_VERSION -DCMAKE_CUDA_ARCHITECTURES=110 + make -j$(nproc) + ``` + + > NOTE: Set `QNX_BASE` to your QNX toolchain installation path. + > If your CUDA version is not the same as in the example, set `CUDA_VERSION` (for examples that use it in multiple places) or add `-DCUDA_VERSION=` to the cmake command. + # References ## TensorRT Resources From 4fb89bd3799df67592b2c2b022128f632a66b1c1 Mon Sep 17 00:00:00 2001 From: "Po-Wei Wang (Vincent)" Date: Fri, 4 Sep 2026 13:54:31 -0700 Subject: [PATCH 2/2] Update README --- README.md | 37 ++++++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 5ce8d9dd0..5041f8532 100644 --- a/README.md +++ b/README.md @@ -77,10 +77,31 @@ To build the TensorRT-OSS components, you will first need the following software ```bash git clone -b main https://github.com/nvidia/TensorRT TensorRT cd TensorRT + export TRT_OSSPATH="$(pwd)" git submodule update --init --recursive ``` -2. #### (Optional - if not using TensorRT container) Specify the TensorRT GA release build path +2. #### (If using a build container) Specify the TensorRT library location + + Build containers preinstall the TensorRT libraries. Set `TRT_LIBPATH` to the directory that + matches the target you build for: + + ```bash + # Typical x86 lib path in TensorRT and other containers + export TRT_LIBPATH="/usr/lib/x86_64-linux-gnu" + + # Typical aarch64 Linux lib path in cross-compiling containers + export TRT_LIBPATH="/usr/lib/aarch64-linux-gnu" + + # Typical aarch64 QNX lib path in cross-compiling containers + export TRT_LIBPATH="/usr/lib/aarch64-unknown-nto-qnx" + ``` + + > NOTE: A container holds more than one `libnvinfer.so`. Pick the one that matches your target, + > because the x86 libraries do not link into an aarch64 build. To list them, run + > `find / -name libnvinfer.so`. + +3. #### (If not using TensorRT container) Specify the TensorRT GA release build path If using the TensorRT OSS build container, TensorRT libraries are preinstalled under `/usr/lib/x86_64-linux-gnu` and you may skip this step. @@ -231,7 +252,7 @@ For Linux platforms, we recommend that you generate a docker container for build The TensorRT samples are no longer included in the DriveOS SDK under `/usr/src/tensorrt`. This is expected since samples have moved to GitHub when switching to CMake. - Follow the DriveOS Installation Guide to launch the DriveOS Linux NSR container, then + Follow the DriveOS Installation Guide to launch your desired DriveOS container, then follow the rest of these instructions to clone and build this repository in that container. Access the DriveOS Installation Guide for the current release at @@ -269,6 +290,10 @@ For Linux platforms, we recommend that you generate a docker container for build **Example: Cross-Compile for DOS6.5 QNX (aarch64)** + > NOTE: Set `QNX_BASE` to your QNX toolchain installation path. + > For more information on installing the QNX SDP, refer to the NVIDIA DriveOS QNX Installation Guide for your DriveOS release. + > If your CUDA version is not the same as in the example, set `CUDA_VERSION` (for examples that use it in multiple places) or add `-DCUDA_VERSION=` to the cmake command. + ```bash cd $TRT_OSSPATH mkdir -p build && cd build @@ -283,11 +308,12 @@ For Linux platforms, we recommend that you generate a docker container for build make -j$(nproc) ``` + **Example: Cross-Compile for DOS7 QNX (aarch64)** + > NOTE: Set `QNX_BASE` to your QNX toolchain installation path. + > For more information on installing the QNX SDP, refer to the NVIDIA DriveOS QNX Installation Guide for your DriveOS release. > If your CUDA version is not the same as in the example, set `CUDA_VERSION` (for examples that use it in multiple places) or add `-DCUDA_VERSION=` to the cmake command. - **Example: Cross-Compile for DOS7 QNX (aarch64)** - ```bash cd $TRT_OSSPATH mkdir -p build && cd build @@ -302,9 +328,6 @@ For Linux platforms, we recommend that you generate a docker container for build make -j$(nproc) ``` - > NOTE: Set `QNX_BASE` to your QNX toolchain installation path. - > If your CUDA version is not the same as in the example, set `CUDA_VERSION` (for examples that use it in multiple places) or add `-DCUDA_VERSION=` to the cmake command. - # References ## TensorRT Resources