TensorRT wrapper for .NET.
TensorRT CSharp API v4.0
TensorRT and CUDA bindings for C# and .NET, with managed APIs, project-owned bridge packages, runnable vision samples, and a TensorRtExec desktop workflow.
English | 简体中文
TensorRT CSharp API v4.0 provides a .NET API for TensorRT inference, CUDA runtime compilation, memory, streams, callbacks, and the TensorRtExec desktop workflow. The stable 4.0.0 release is public; development now focuses on package-consuming examples, applications, and complete technical articles.
The managed API keeps the public namespace roots stable:
CUDA, cuDNN, TensorRT, and NVRTC are user-installed prerequisites. NVIDIA runtime redistribution is retired: this repository publishes managed source/packages and project-owned bridge-only packages, never CUDA/cuDNN/TensorRT vendor archives.
.Bridge packages with split_package_roles=bridge contain only the project bridge for a fixed CUDA/TensorRT line.JYPPX.TensorRtSharp and JYPPX.CudaSharp namespace roots and the 4.0 managed API surface.4.0.0.1 is available for current C# core changes; the Bridge package matrix remains on 4.0.0.Read the detailed 4.0.0 notes, the 4.0.0.1 managed-package notes, or browse the complete version index.
Create a console project, reference the managed package, and install the bridge package that matches the CUDA/TensorRT installation on the target machine:
dotnet new console -n TrtQuickstart
cd TrtQuickstart
dotnet add package JYPPX.TensorRT.CSharp.API --version 4.0.0
dotnet add package JYPPX.TensorRT.CSharp.API.Runtime.win-x64.trt10.11.cuda12.9.cudnn9.22.Bridge --version 4.0.0The exact 4.0.0 version keeps restores reproducible without selecting API-incompatible historical 4.x packages such as 4.0.6170. Replace the Bridge package ID with the RID and NVIDIA-runtime matrix installed on the target machine.
Then create a runtime, load an engine, bind input/output tensors, execute, and read the result. The bridge package is not a replacement for the user-installed NVIDIA runtime. See the inference bindings tutorial and Windows installation guide.
| Package | Contents |
|---|---|
| JYPPX.TensorRT.CSharp.API | Managed TensorRT and CUDA-facing C# API |
| JYPPX.TensorRT.CSharp.API.Runtime.*.Bridge | Project-owned native bridge only; select one by RID/TensorRT/CUDA/cuDNN |
Classification at samples/ComputerVision/01.Classification and YoloVision at applications/YoloVision are runnable examples. They consume the public 4-series managed package and are deliberately excluded from all public package feeds and Release assets.
| Series | Project | Focus |
|---|---|---|
| CUDA | Cuda/01.RuntimeCompilation |
CUDA RTC compilation, module loading, launch, and readback |
| Inference | Inference/01.Bindings, Inference/02.DynamicShapes |
Bindings, memory ownership, and dynamic profiles |
| Performance | Performance/01.MultiStream |
CUDA streams, events, and ordering |
| Computer vision | Classification |
Image preprocessing, Top-K output, JSON, and annotated results |
| Applications | YoloVision, OnnxToEngine, TensorRtExec |
Complete multi-step workflows and advanced usage |
See the sample series and applications for runnable commands and matching articles.
CUDA RTC roadmap: English | 简体中文 | technical article
The stable 4.0.0 release is available through GitHub Releases, NuGet.org, and GitHub Packages. The compatible managed-package maintenance revision is 4.0.0.1; the Bridge matrix remains at 4.0.0. Package README content is the English root README, package branding uses nuget/logo.jpg, and the core managed package uses the Apache-2.0 SPDX license expression.
| Package | Version | NuGet.org | GitHub Packages | Purpose |
|---|---|---|---|---|
| JYPPX.TensorRT.CSharp.API | Gallery | Package feed | Core managed TensorRT/CUDA API |
| Release channel | Link | Assets |
|---|---|---|
| GitHub Release | v4.0.0 | Source archive, core managed .nupkg, and project-owned Bridge .nupkg files |
| GitHub Packages | NuGet package feed | Core managed package and the published project-owned Bridge matrix |
| NuGet.org | Core package 4.0.0 | Core managed package and all 18 project-owned Bridge packages |
Every published Bridge package is listed below. CUDA, cuDNN, and TensorRT are prerequisites installed by the consumer; the .Bridge package contains only jyppxtrtbridge. The Version column is a live NuGet.org badge. published-4.0.0 means the exact 4.0.0 package is available in GitHub Packages, the GitHub Release, and NuGet.org.
No open issues yet, or sync has not completed.