Jetson Deployment Guide - Depth Anything V3

February 5, 2026 ยท View on GitHub

Validated Configuration

ComponentVersionNotes
PlatformJetson Orin NX 16GBSeeed reComputer J4012
JetPack6.2 (L4T R36.4)Required for TRT 10.3
TensorRT10.3.0.30Host-side inference
CUDA12.6Host
Performance40 FPS @ 518x518 FP167.7x speedup over PyTorch
Performance93 FPS @ 308x308 FP1617.8x speedup over PyTorch

Architecture: Host-Container Split with Shared Memory IPC

Due to broken TensorRT Python bindings in available Jetson containers (Issue #714), we use a split architecture with optimized shared memory IPC:

+---------------------------------------------------------------+
|                      HOST (JetPack 6.2+)                       |
|  +----------------------------------------------------------+  |
|  |      TRT Inference Service (trt_inference_service_shm.py) |  |
|  |  - Loads engine with host TensorRT 10.3                   |  |
|  |  - RAM-backed IPC via /dev/shm/da3 (numpy.memmap)         |  |
|  |  - ~15ms inference + ~8ms IPC = ~23ms total               |  |
|  +----------------------------------------------------------+  |
|                              ^                                  |
|                              | /dev/shm/da3 (shared memory)     |
|                              v                                  |
|  +----------------------------------------------------------+  |
|  |              Docker Container (L4T r36.4.0)               |  |
|  |  +----------------------------------------------------+  |  |
|  |  |              ROS2 Depth Node                       |  |  |
|  |  |  - SharedMemoryInferenceFast class                 |  |  |
|  |  |  - Subscribes to /image_raw                        |  |  |
|  |  |  - Publishes to /depth, /depth_colored             |  |  |
|  |  +----------------------------------------------------+  |  |
|  +----------------------------------------------------------+  |
+---------------------------------------------------------------+

Why this approach:

  • dustynv/l4t-pytorch:r36.4.0 has broken TensorRT Python bindings
  • Using dustynv/ros:humble-desktop-l4t-r36.4.0 (humble-pytorch variant doesn't exist)
  • Container TRT 8.6.2 cannot build DA3 engines (DINOv2 incompatibility)
  • Host TRT 10.3 works perfectly (validated at 25ms latency)

Quick Start

cd ~/depth_anything_3_ros2
bash scripts/deploy_jetson.sh --host-trt

This script:

  1. Verifies TensorRT 10.3 on host
  2. Downloads ONNX model if missing (auto-installs huggingface_hub)
  3. Builds TensorRT FP16 engine (~2 min)
  4. Starts host inference service
  5. Starts Docker container with shared memory mount

Manual Deployment

Step 1: Verify Host TensorRT

/usr/src/tensorrt/bin/trtexec --version
# Expected: TensorRT v100300 (10.3.x)

Step 2: Build TensorRT Engine

mkdir -p models/tensorrt

/usr/src/tensorrt/bin/trtexec \
  --onnx=models/onnx/da3-small-embedded.onnx \
  --saveEngine=models/tensorrt/da3-small-fp16.engine \
  --fp16 \
  --memPoolSize=workspace:2048MiB \
  --optShapes=pixel_values:1x1x3x518x518

Build time: ~2 minutes | Engine size: ~64 MB

Step 3: Start Host Inference Service

# Terminal 1: Host inference service
python3 scripts/trt_inference_service.py \
  --engine models/tensorrt/da3-small-fp16.engine \
  --shared-dir /tmp/da3_shared

Step 4: Start Container

# Terminal 2: ROS2 container
docker compose up depth-anything-3-jetson

Step 5: Run ROS2 Node

Inside container:

ros2 launch depth_anything_3_ros2 depth_anything_3.launch.py use_shared_memory:=true

Performance Results

See JETSON_BENCHMARKS.md for comprehensive benchmarks.

Quick Reference

ConfigurationFPSLatencyUse Case
DA3-Small @ 518x5184025msHigh quality
DA3-Small @ 400x4006416msBalanced
DA3-Small @ 308x3089311msReal-time robotics
DA3-Small @ 256x2561109msHigh-speed

Model Variants

ModelFPS (518x518)LatencyEngine Size
DA3-Small4025ms64MB
DA3-Base1951ms211MB
DA3-Large7.5132ms674MB

Thermal Stability

10-minute sustained load test PASSED:

  • Throughput: 40.79 FPS (stable)
  • Latency variance: < 5%
  • No thermal throttling detected

Communication Protocol

Production: Shared Memory IPC (/dev/shm/da3)

The host trt_inference_service_shm.py and container communicate via RAM-backed shared memory for minimal latency (~8ms IPC overhead):

FileDirectionFormat
/dev/shm/da3/input.binContainer -> Hostfloat32 memmap [1,1,3,518,518]
/dev/shm/da3/output.binHost -> Containerfloat32 memmap [1,518,518]
/dev/shm/da3/requestContainer -> HostTimestamp signal
/dev/shm/da3/statusHost -> Container"ready", "complete:time", "error:msg"

Fallback: File-based IPC (/tmp/da3_shared)

The legacy file-based IPC is still supported for backward compatibility (~40ms IPC overhead):

FileDirectionFormat
/tmp/da3_shared/input.npyContainer -> Hostfloat32 [1,1,3,518,518]
/tmp/da3_shared/output.npyHost -> Containerfloat32 [1,518,518]
/tmp/da3_shared/requestContainer -> HostTimestamp signal
/tmp/da3_shared/statusHost -> Container"ready", "complete:time", "error:msg"

Troubleshooting

Host service not detecting requests

Check shared directory permissions (production uses /dev/shm/da3):

ls -la /dev/shm/da3/
# Should be readable/writable by both host user and container
# Fallback path: ls -la /tmp/da3_shared/

Container cannot write to shared memory

Verify volume mount in docker-compose.yml:

volumes:
  - /tmp/da3_shared:/tmp/da3_shared:rw

Engine build fails with "Unknown option: --workspace"

TensorRT 10.x changed CLI syntax:

# Wrong (TRT 8.x)
--workspace=2048

# Correct (TRT 10.x)
--memPoolSize=workspace:2048MiB

FPS lower than expected

  1. Check host service is running
  2. Verify GPU power mode: sudo nvpmodel -q (should be MAXN)
  3. Enable max clocks: sudo jetson_clocks

Files

FilePurpose
scripts/deploy_jetson.shAutomated deployment
scripts/trt_inference_service.pyHost-side TRT inference
scripts/benchmark_resolutions.shResolution benchmark script
scripts/benchmark_models.shModel size benchmark script
scripts/thermal_stability_test.shThermal validation script
depth_anything_3_ros2/da3_inference.pyInference wrapper (shared memory support)
models/tensorrt/da3-small-fp16.engineTRT engine (64 MB)
docker-compose.ymlContainer config

Last Updated: 2026-02-02 Validated On: Jetson Orin NX 16GB, JetPack 6.2, TensorRT 10.3.0.30