Skip to content

Fix Torch-TensorRT Bazel build on JetPack#4307

Open
Mike-Sagiri wants to merge 1 commit into
pytorch:mainfrom
Mike-Sagiri:fix/jetpack-tensorrt-bazel
Open

Fix Torch-TensorRT Bazel build on JetPack#4307
Mike-Sagiri wants to merge 1 commit into
pytorch:mainfrom
Mike-Sagiri:fix/jetpack-tensorrt-bazel

Conversation

@Mike-Sagiri
Copy link
Copy Markdown

@Mike-Sagiri Mike-Sagiri commented May 29, 2026

Description

Update and fix TensorRT Bazel build support on NVIDIA JetPack platforms.
JetPack packages TensorRT headers and libraries differently from standard Linux TensorRT distributions.

This change:

  • adds JetPack-specific include path support for third_party/tensorrt/local/BUILD
  • adds JetPack-specific library path support for third_party/tensorrt/local/BUILD
  • updates Bazel select() rules for JetPack environments for third_party/tensorrt/local/BUILD
  • fixes incorrect TensorRT library resolution on JetPack systems for of third_party/tensorrt/local/BUILD
  • updates dependencies for JetPack in setup.py and MODULE.bazel
  • now the users can use --jetpack to build Torch-TensorRT from source successfully

Known issue:

  • Since TensorRT 10.13+ not support cuda 12.x anymore, building Torch-TensorRT with TensorRT 10.13+ needs cuda 13 on JetPack. However, JetPack 6.2 and lower doesn't support cuda 13. When building Torch-TensorRT with TensorRT 10.7-, add_attention is not supported by TensorRT 10.14-. So the users may need to add torch.backends.cuda.enable_flash_sdp(False), torch.backends.cuda.enable_mem_efficient_sdp(False), torch.backends.cuda.enable_math_sdp(True) to solve the problem.
  • A stable version for JetPack 6.x is Torch 2.10, Torch-TensorRT 2.10 and TensorRT 10.7.

Fixes # (issue)

Type of change

Please delete options that are not relevant and/or add your own.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project (You can use the linters)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas and hacks
  • I have made corresponding changes to the documentation
  • I have added tests to verify my fix or my feature
  • New and existing unit tests pass locally with my changes
  • I have added the relevant labels to my PR in so that relevant reviewers are notified

@meta-cla meta-cla Bot added the cla signed label May 29, 2026
@github-actions github-actions Bot added the component: build system Issues re: Build system label May 29, 2026
@github-actions github-actions Bot requested a review from lanluo-nvidia May 29, 2026 03:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant