Skip to content

Add TensorRT redistribution support - #26

Open
ryanli wants to merge 1 commit into
hermeticbuild:mainfrom
ryanli:tensorrt
Open

ryanli wants to merge 1 commit into
hermeticbuild:mainfrom
ryanli:tensorrt

Conversation

@ryanli

@ryanli ryanli commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

NVIDIA publishes neither redistrib manifests nor a browsable archive index for TensorRT, so the checked-in catalog
(tensorrt/tensorrt_redist_versions.json) follows the generated NCCL catalog model: entries are keyed TensorRT version -> CUDA major and record the archives per platform, the exact CUDA minor each build was compiled against, and the explicitly compatible CUDA minors. The catalog is generated and verified by tensorrt/update_redists.py (run through //tools/tensorrt:update_redists, rules_python as a dev dependency only), which declares the GA releases in a data table, probes the known tarball URL patterns on
developer.download.nvidia.com/compute/machine-learning/tensorrt/, and streams every archive to compute its sha256 and top-level directory. The GA tarballs extract into TensorRT-/ rather than the redist archive-name convention, so each entry carries an explicit strip_prefix.

TensorRT versions are pinned per cuda_ext.redist(...) tag via the new tensorrt_version attribute and exposed as @cuda//tensorrt. get_tensorrt_redist() validates the requested CUDA version against the catalog's compatible_cuda before any download starts; NVIDIA's support matrix documents each TensorRT build as compatible with its CUDA major line only. The initial catalog covers TensorRT 10.16.0 (10.16.0.72): the cuda-13.2 build for linux-x86_64 and linux-sbsa and the cuda-12.9 build for linux-x86_64 (NVIDIA publishes no sbsa tarball for that build), all sha256s computed from the downloaded archives.

The template exposes complete target families for nvinfer, nvinfer_plugin, and nvonnxparser: shared/interface imports (interface imports link through the packaged lib/stubs/), semantic and system wrappers, and headers depending on cudart headers (NvInferRuntimeBase.h includes cuda_runtime_api.h; crt headers are added for CUDA 13+). shared_library_files globs every packaged lib/lib*.so* except the Windows cross-compilation builder resources, because libnvinfer dlopens the per-SM builder resources and the lean and dispatch runtimes. No nvinfer_static or nvinfer_plugin_static targets are exposed: libnvinfer_static.a references builder-resource kernel blobs (binaryklib symbols) shipped only inside the dlopened libnvinfer_builder_resource*.so files, so no hermetic static closure exists in the redistribution; libnvonnxparser_static.a is self-contained and exposed. TensorRT is distributed under the NVIDIA TensorRT Supplement to the NVIDIA Software License Agreement.

e2e adds a link-only tensorrt_smoke (getInferLibVersion) constrained to the CUDA versions whose redist tags pin tensorrt_version (12.9.1 and 13.2.1, matching the catalog builds).

NVIDIA publishes neither redistrib manifests nor a browsable archive
index for TensorRT, so the checked-in catalog
(tensorrt/tensorrt_redist_versions.json) follows the generated NCCL
catalog model: entries are keyed TensorRT version -> CUDA major and
record the archives per platform, the exact CUDA minor each build was
compiled against, and the explicitly compatible CUDA minors. The
catalog is generated and verified by tensorrt/update_redists.py (run
through //tools/tensorrt:update_redists, rules_python as a dev
dependency only), which declares the GA releases in a data table,
probes the known tarball URL patterns on
developer.download.nvidia.com/compute/machine-learning/tensorrt/, and
streams every archive to compute its sha256 and top-level directory.
The GA tarballs extract into TensorRT-<full-version>/ rather than the
redist archive-name convention, so each entry carries an explicit
strip_prefix.

TensorRT versions are pinned per cuda_ext.redist(...) tag via the new
tensorrt_version attribute and exposed as @cuda//tensorrt.
get_tensorrt_redist() validates the requested CUDA version against the
catalog's compatible_cuda before any download starts; NVIDIA's support
matrix documents each TensorRT build as compatible with its CUDA major
line only. The initial catalog covers TensorRT 10.16.0 (10.16.0.72):
the cuda-13.2 build for linux-x86_64 and linux-sbsa and the cuda-12.9
build for linux-x86_64 (NVIDIA publishes no sbsa tarball for that
build), all sha256s computed from the downloaded archives.

The template exposes complete target families for nvinfer,
nvinfer_plugin, and nvonnxparser: shared/interface imports (interface
imports link through the packaged lib/stubs/), semantic and _system
wrappers, and headers depending on cudart headers (NvInferRuntimeBase.h
includes cuda_runtime_api.h; crt headers are added for CUDA 13+).
shared_library_files globs every packaged lib/lib*.so* except the
Windows cross-compilation builder resources, because libnvinfer dlopens
the per-SM builder resources and the lean and dispatch runtimes. No
nvinfer_static or nvinfer_plugin_static targets are exposed:
libnvinfer_static.a references builder-resource kernel blobs
(_binary_*_klib_* symbols) shipped only inside the dlopened
libnvinfer_builder_resource_*.so files, so no hermetic static closure
exists in the redistribution; libnvonnxparser_static.a is
self-contained and exposed. TensorRT is distributed under the NVIDIA
TensorRT Supplement to the NVIDIA Software License Agreement.

e2e adds link-only tensorrt_smoke and tensorrt_system_smoke binaries
(getInferLibVersion) constrained to the CUDA versions whose redist tags
pin tensorrt_version (12.9.1 and 13.2.1, matching the catalog builds).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant