Practical overview
When it fits
Use it when you need a C++ TensorRT starting point for YOLOv8 GPU inference and can provide the required CUDA, TensorRT and OpenCV environment.
Who it is for
- C++ developers implementing YOLOv8 computer-vision inference on a CUDA-capable system.
- Developers exploring TensorRT-based workflows for detection, segmentation or pose estimation.
Documented uses
- Run YOLOv8 inference on an image and save an annotated result.
- Run inference from a webcam and display results in real time.
- Benchmark an ONNX model with an input image.
- Convert a PyTorch YOLOv8 model into ONNX for inference.
Requirements & limits
The project is available as a public GitHub repository under the MIT license.
- The documented tested environments are Ubuntu 20.04 and 22.04; Windows is explicitly unsupported.
- The setup requires CUDA, cuDNN, TensorRT 10 or newer, and OpenCV with CUDA support.
- The project relies on the separate tensorrt-cpp-api library for inference.
- The first run can take several minutes while TensorRT generates an optimized engine.
- INT8 mode requires representative calibration data and trades accuracy for potential speed.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Convert a YOLOv8 PyTorch model to ONNX
Create an ONNX model for use with the project's TensorRT inference executables.
Before you start
- A downloaded YOLOv8 PyTorch model.
- Python pip and the Ultralytics package.
- The repository cloned with its scripts directory.
Steps
Install the package with the command below.
pip3 install ultralyticsFrom the repository's
scripts/directory, run the command below.python3 pytorch2onnx.py --pt_path
Expected outcome
The conversion script produces an ONNX model.
Guide limitations
- When using another conversion script, disable its
end2endoption; this implementation performs bounding-box decoding and non-maximum suppression in C++. - The guide covers conversion only, not building or running the inference executables.
Build the C++ project
Compile the repository's C++ executables after installing and configuring its prerequisites.
Before you start
- Ubuntu 20.04 or 22.04, the environments identified as tested in the README.
- CUDA, cuDNN, build-essential, Python pip, CMake, OpenCV with CUDA support and TensorRT 10 or newer.
- The repository cloned with
--recursiveand the TensorRT installation path set in CMakeLists.txt.
Steps
Create a build directory with
mkdir build.Enter it with
cd build.Configure the project with
cmake ...Compile with the command below.
make -j
Expected outcome
The project is built with its documented executables available for subsequent use.
Guide limitations
- The README states that Windows is not supported.
- This is a build recipe; it does not establish that the build has been independently executed or tested.
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 |
|---|---|---|---|
| YOLOV8 Tensorrt Cpp | Run YOLOv8 inference on an image and save an annotated result. | Linux, Server | The project is available as a public GitHub repository under the MIT license. |
| Hyperpose | Customize pose-estimation architectures and datasets. | Docker, Linux, macOS, Windows | |
| Multi Task Nlp | Define multiple tasks and their data and model settings in a YAML file. | Linux, macOS, Windows | The project is an open-source library under the Apache-2.0 license, distributed through its public GitHub repository. |
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 14 October 2026
- Original website title
- cyrusbehr/YOLOv8-TensorRT-CPP · Official homepage title · retained in its source language

