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 — это SDK от NVIDIA для быстрого инференса моделей глубокого обучения на видеокартах NVIDIA. В этом репозитории находятся открытые компоненты: плагины, парсер 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 и более ранних версий, поэтому старым рабочим процессам потребуется миграция. Для нативной сборки protobuf на aarch64 компилятор C нужно явно задать через CC=.
Кому это нужно и требуется ли видеокарта NVIDIA?Это для разработчиков, которые развёртывают модели глубокого обучения для быстрого инференса. Проект работает только с GPU NVIDIA: он построен на CUDA/cuDNN, а NCCL можно подключить для настроек с несколькими устройствами.
Работает ли это и на Linux, и на Windows, включая ARM-устройства вроде Jetson?Да: есть примеры сборки для Ubuntu/RockyLinux x86-64, нативной Windows x86, а также кросс-компиляция для целевых платформ Jetson и DriveOS aarch64.
Нужна ли конкретная версия CUDA/cuDNN?Да, проект рассчитан на конкретные рекомендуемые версии CUDA (13.3.0 или 12.9.0) и cuDNN 8.9. Версию CUDA можно переопределить флагом -DCUDAVERSION= в CMake.
Для чего нужно руководство по импорту моделей?Это пошаговое руководство по импорту моделей в TensorRT через ONNX, Torch-TensorRT, HuggingFace/Optimum или Network Definition API, с примерами и советами по инструментам.
Где проверить, поддерживается ли мой тип модели?В репозитории есть ссылка на таблицу поддержки моделей по каждому пути импорта: языковые модели (LLM), NLP-энкодеры, модели для компьютерного зрения, аудио, диффузионные и мультимодальные модели.
Чем заменили удалённый инструмент профилирования TREX?Его роль профилирования и визуализации теперь выполняет Nsight Deep Learning Designer.
Есть ли корпоративная поддержка?Да, NVIDIA предоставляет корпоративную поддержку TensorRT в составе пакета NVIDIA AI Enterprise, а также бесплатные практические лабораторные работы через NVIDIA LaunchPad.
Creator
NVIDIA
Size
144.8 MB
Stars
13.4K
Age
7y
Commits · 90 Days