Skip to content

❓ [Question] Is SAM2 supported when compiling with the Dynamo backend on JetPack 6.1 or 6.2? #3478

Open
@AyanamiReiFan

Description

@AyanamiReiFan

❓ Question

Will SAM2 be compatible with the Dynamo backend on JetPack 6.1/6.2?

Are there any workarounds for the TensorRT version mismatch?

What you have already tried

Here are my attempts and issues encountered, my device is jetson AGX Orin, I only compile the ImageEncoder (Hiera & FPN which remove position_encoding) of SAM2, the SAM2 code is from https://github.com/chohk88/sam2/tree/torch-trt:

JetPack 6.1 + PyTorch 2.5 (from https://developer.download.nvidia.cn) + Torch-TensorRT 2.5

Tried compiling SAM2 but encountered errors.

Observed that the PyTorch 2.5 documentation does not mention SAM2 support, likely indicating SAM2 is not yet adapted for this version.

JetPack 6.1 + PyTorch 2.6 (from https://pypi.jetson-ai-lab.dev/jp6/cu126) + Torch-TensorRT 2.6

Installed PyTorch 2.6 from jp6/cu126 and Torch-TensorRT 2.6.

Importing torch_tensorrt failed with ModuleNotFoundError: No module named 'tensorrt.plugin'.

Root cause: Torch-TensorRT 2.6 requires TensorRT 10.7, but JetPack 6.1 provides only TensorRT 10.3.

Found no straightforward way to upgrade TensorRT within JetPack 6.1 due to dependency conflicts.

Cross-Platform Attempt: Compile on x86 + Run on JetPack 6.1

Compiled SAM2 on x86 with Torch-TensorRT 2.6 and exported the model.

Tried running it on JetPack 6.1 with Torch-TensorRT 2.5.

Failed unsurprisingly due to serialization version incompatibility between 2.6 and 2.5.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions