TensorRT README

The project's README from github.com/NVIDIA/TensorRT. As one markdown file: README.md.

License Documentation Roadmap

:mega::mega: Announcement :mega::mega:

TensorRT 11.X is now released with powerful new capabilities designed to accelerate your AI inference workflows. With this major version bump, TensorRT's API has been streamlined and a few legacy features from 10.X have been removed.

Below provides migration guides for the following features:

TensorRT Open Source Software

This repository contains the Open Source Software (OSS) components of NVIDIA TensorRT. It includes the sources for TensorRT plugins and ONNX parser, as well as sample applications demonstrating usage and capabilities of the TensorRT platform. These open source software components are a subset of the TensorRT General Availability (GA) release with some extensions and bug-fixes.

Need enterprise support? NVIDIA global support is available for TensorRT with the NVIDIA AI Enterprise software suite. Check out NVIDIA LaunchPad for free access to a set of hands-on labs with TensorRT hosted on NVIDIA infrastructure.

Join the TensorRT and Triton community and stay current on the latest product updates, bug fixes, content, best practices, and more.

Agentic Coding Skills

Various skills related to TensorRT usage and benchmarking are available here. For installation, refer to the instructions of your preferred coding agent.

Prebuilt TensorRT Python Package

We provide the TensorRT Python package for an easy installation.
To install:

pip install tensorrt

You can skip the Build section to enjoy TensorRT with Python.

Build

Prerequisites

To build the TensorRT-OSS components, you will first need the following software packages.

TensorRT GA build

System Packages

Optional Packages

Downloading TensorRT Build

  1. Download TensorRT OSS

    git clone -b main https://github.com/nvidia/TensorRT TensorRT
    cd TensorRT
    git submodule update --init --recursive
    
  2. (Optional - 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.

    Else download and extract the TensorRT GA build from NVIDIA Developer Zone with the direct links below:

    Example: Ubuntu 22.04 on x86-64 with cuda-13.3

    cd ~/Downloads
    tar --zstd -xvf TensorRT-Enterprise-11.2.1.2-Linux-x86_64-cuda-13.3-Release-external.tar.zst
    export TRT_LIBPATH=`pwd`/TensorRT-11.2.1.2/lib
    

    Example: Windows on x86-64 with cuda-12.9

    Expand-Archive -Path TensorRT-Enterprise-11.2.1.2-Windows-amd64-cuda-12.9-Release-external.zip
    $env:TRT_LIBPATH="$pwd\TensorRT-11.2.1.2\lib"
    

Setting Up The Build Environment

For Linux platforms, we recommend that you generate a docker container for building TensorRT OSS as described below. For native builds, please install the prerequisite System Packages.

  1. Generate the TensorRT-OSS build container.

    Example: Ubuntu 24.04 on x86-64 with cuda-13.3 (default)

    ./docker/build.sh --file docker/ubuntu-24.04.Dockerfile --tag tensorrt-ubuntu24.04-cuda13.3
    

    Example: Rockylinux8 on x86-64 with cuda-13.3

    ./docker/build.sh --file docker/rockylinux8.Dockerfile --tag tensorrt-rockylinux8-cuda13.3
    

    Example: Ubuntu 24.04 cross-compile for Jetson (aarch64) with cuda-13.3 (JetPack SDK)

    ./docker/build.sh --file docker/ubuntu-cross-aarch64.Dockerfile --tag tensorrt-jetpack-cuda13.3
    

    Example: Ubuntu 24.04 on aarch64 with cuda-13.3

    ./docker/build.sh --file docker/ubuntu-24.04-aarch64.Dockerfile --tag tensorrt-aarch64-ubuntu24.04-cuda13.3
    
  2. Launch the TensorRT-OSS build container.

    Example: Ubuntu 24.04 build container

    ./docker/launch.sh --tag tensorrt-ubuntu24.04-cuda13.3 --gpus all
    

    NOTE:
    1. Use the --tag corresponding to build container generated in Step 1.
    2. NVIDIA Container Toolkit is required for GPU access (running TensorRT applications) inside the build container.
    3. sudo password for Ubuntu build containers is 'nvidia'.
    4. Specify port number using --jupyter <port> for launching Jupyter notebooks.
    5. Write permission to this folder is required as this folder will be mounted inside the docker container for uid:gid of 1000:1000.

Building TensorRT-OSS

Building TensorRT DriveOS Samples

References

TensorRT Resources

Known Issues

TensorRT (NVIDIA/TensorRT)

Searching Database…

13.4K ·GitHub
这是什么?TensorRT 是 NVIDIA 推出的软件开发工具包(SDK),用于在 NVIDIA GPU 上进行高性能深度学习推理。本仓库包含其开源部分:插件、ONNX 解析器,以及演示 TensorRT 用法的示例应用。
这是完整的 TensorRT 引擎,还是只有开源部分?只是一部分:开源插件、ONNX 解析器和示例。核心的 TensorRT GA(闭源)库仍需从 NVIDIA 另行下载。
我该如何让 TensorRT 运行起来?最简单的方法是安装预编译的 TensorRT Python 包,完全跳过编译。如果想自己编译开源组件,需要下载本仓库以及对应的 TensorRT GA 版本,然后生成并启动 Docker 编译容器(或直接在本机编译),再运行 CMake,并将 TRTLIBDIR/TRTOUTDIR 指向你的 TensorRT 安装目录。
编译前需要先安装哪些东西?CUDA(推荐 13.3.0 或 12.9.0)、可选的 cuDNN 8.9、GNU make >= 4.1、CMake >= 3.31、Python >= 3.10,以及 git/pkg-config/wget。NCCL 和 NVIDIA Container Toolkit 为可选项,用于多设备或容器内 GPU 的编译场景。
编译或使用最新版本时有哪些需要注意的坑?TensorRT 11.X 移除了多项旧版 API,包括弱类型网络、隐式量化、IPluginV2、TREX 工具以及 Python 3.9 及更早版本的绑定,因此旧的工作流需要迁移。在原生 aarch64 上编译 protobuf 时,还需要通过 CC= 显式指定 C 编译器。
谁需要用它?是否必须有 NVIDIA GPU?它面向需要部署深度学习模型以实现快速推理的开发者,并且只支持 NVIDIA GPU,基于 CUDA/cuDNN 构建,多设备场景可选配 NCCL。
它在 Linux 和 Windows 上都能用吗?包括 Jetson 这类 ARM 设备吗?可以。文档提供了 Ubuntu/RockyLinux x86-64、原生 Windows x86 的编译示例,以及面向 Jetson 和 DriveOS aarch64 目标平台的交叉编译示例。
我是否需要特定版本的 CUDA/cuDNN?需要。它针对特定的推荐 CUDA 版本(13.3.0 或 12.9.0)和 cuDNN 8.9 进行适配;你可以在 CMake 中通过 -DCUDAVERSION= 覆盖 CUDA 版本。
导入工作流指南是做什么用的?这是一份分步指南,介绍如何通过 ONNX、Torch-TensorRT、HuggingFace/Optimum 或网络定义 API 将模型导入 TensorRT,并附带示例和工具使用技巧。
在哪里可以查看我的模型类型是否受支持?仓库中附有一份按模型划分的支持矩阵,涵盖 LLM、编码器类 NLP、视觉、音频、扩散和多模态模型,并列出每种导入方式的支持情况。
被移除的 TREX 性能分析工具由什么替代?现在由 Nsight Deep Learning Designer 承担 TREX 过去提供的性能分析与可视化功能。
有企业级支持吗?有。NVIDIA 通过 NVIDIA AI Enterprise 软件套件为 TensorRT 提供企业级支持,并可通过 NVIDIA LaunchPad 免费参加动手实验课程。
Creator
NVIDIA
Size
144.8 MB
Stars
13.4K
Age
7y
Commits · 90 Days