NVIDIA / NVIDIA/TensorRT

Build TensorRT statically

Open
#4,116 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Module:Engine Build triaged
Dominant language
C++
Stars
13.4k
Forks
2.4k
Avg merge
5d 3h
Merged PRs (30d)
2

Description

I am working on statically building TensorRT on my Windows system. The goal is to reduce the size of my program by eliminating the need for dynamic libraries (DLLs) and ensuring that only the necessary parts of the libraries are included in the final program.

For this, I have been attempting to build TensorRT from source in static mode. I am using CMake to generate build files, and while the solution files are generated successfully, when I open the solution in Visual Studio, I do not see any targets for nvinfer or nvinfer_builder_resource, which seem to be crucial libraries for TensorRT.

Here’s a summary of the issues I am facing:

Missing Targets: The targets for nvinfer and nvinfer_builder_resource are not present in the generated Visual Studio solution. I am unable to locate where these are configured in the CMakeLists.txt file.

Feasibility of Static Build: I am also wondering if it is possible to build TensorRT statically on Windows. If so, could you provide any official documentation or guidance on how to achieve this?

Below is an image of the generated targets where nvinfer and nvinfer_builder_resource are missing.

Thank you in advance for your help and guidance.

Image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the CMakeLists.txt configuration that generates the Windows Visual Studio solution and the options controlling static builds. Check whether nvinfer and nvinfer_builder_resource are defined or intentionally omitted, then document whether static TensorRT builds on Windows are supported and what configuration is required.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp
Domain
build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.