Practical overview
When it fits
Use it when a Linux application needs a C++ inference component for ONNX CNN models on CUDA with TensorRT, particularly when explicit memory transfers, stream control, engine caching or optional Python GPU-array access matter.
Who it is for
- C++ developers building Linux computer-vision applications or services that run ONNX CNN models on NVIDIA GPUs.
- Python developers seeking optional bindings to pass GPU arrays into inference without host transfers.
- Teams integrating TensorRT inference into a downstream CMake project.
Documented uses
- Build or load a cached TensorRT engine from an ONNX model.
- Run CNN inference using named tensors and CUDA streams.
- Handle dynamic input shapes with optimization profiles and manage concurrent contexts through an engine pool.
- Optionally preprocess image tensors with a fused CUDA kernel or expose inference to Python GPU-array workflows.
Requirements & limits
The repository is public and lists an MIT license. The documented target requires Linux, CUDA 12, C++20 and TensorRT 10 or later; CUDA and TensorRT are externally provided.
- TensorRT and CUDA must be installed as system or external dependencies; they are not bundled as the library's runtime prerequisites.
- The library targets Linux, CUDA 12, C++20 and TensorRT 10 or later, and is scoped to CNN-style vision rather than Windows or transformer-specific use.
- Engine-cache validity accounts for ONNX content, build options, TensorRT version and GPU identity.
- Dynamic-shape workflows require optimization profiles; concurrency can use an EnginePool with caller-provided streams.
- Python bindings are optional; the core integration is a C++ library.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Build and install the C++ library
Configure, compile and install the library package for use by a downstream CMake project.
Before you start
- Linux, CUDA 12, C++20 and TensorRT 10 or later.
- CMake and a TensorRT installation available to the build; the README notes a TensorRT_DIR option for a tarball installation.
Steps
Configure the project with CMake; enable the optional preprocessing component with TRT_CPP_API_BUILD_PREPROC=ON if needed, and provide TensorRT_DIR when using a tarball.
Build the configured project with CMake.
Install the package to a chosen prefix with cmake --install.
In the downstream CMake project, call find_package(tensorrt_cpp_api REQUIRED) and link the documented package targets.
Expected outcome
An installed CMake package that a downstream project can discover and link against.
Guide limitations
- This is a build-and-install path; it does not describe deploying or executing a model.
- TensorRT and CUDA are externally provided dependencies.
- The documented target is Linux with CUDA 12, C++20 and TensorRT 10 or later.
Compare options for Model inference and serving
These projects document a common task and share a project role. This is a source-based comparison, not an execution benchmark or a guarantee of interchangeability.
| Project | Documented purpose | Platform | Access and requirements |
|---|---|---|---|
| TensorRT C++ API | Build or load a cached TensorRT engine from an ONNX model. | Linux, Server | The repository is public and lists an MIT license. The documented target requires Linux, CUDA 12, C++20 and TensorRT 10 or later; CUDA and TensorRT are externally provided. |
| Cloud AI SDK | Adapt and run documented model recipes for computer-vision and NLP inference. | Cloud, Server | The GitHub repository is public. Its public visibility does not establish license terms. |
| Turboquant | Replace a model’s existing inference cache with a compressed cache. | Cloud, Linux, macOS, Self-hosted | The project describes itself as open source. The README documents installation through pip or from a source checkout. |
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 14 October 2026
- Original website title
- cyrusbehr/tensorrt-cpp-api · Official homepage title · retained in its source language
Related options
YOLOv8-TensorRT-CPP — A sister project identified in the repository as using this library as its inference backend.
YOLOv9-TensorRT-CPP — A sister project identified in the repository as using this library as its inference backend.

