TensorRT icon indicating copy to clipboard operation
TensorRT copied to clipboard

crash if TensorRT 10.1x is used from a dynamic library

Open notaz opened this issue 3 months ago • 0 comments

Description

On Linux, if TensorRT is used by a dynamic library that is loaded using dlopen(), there is a crash when the program finishes. This is likely caused by TensorRT doing dlclose() on libnvinfer_builder_resource.so.10.x from a static c++ object destructor. The problem would likely go away if TensorRT would unload libnvinfer_builder_resource from nvinfer1::IBuilder destructor, or from a normal function marked with __attribute__((destructor)) rather than some c++ destructor. This is due to the way destructors are implemented in glibc.

Environment

TensorRT Version: 10.13, 10.14 NVIDIA GPU: RTX 5090 NVIDIA Driver Version: 580.95.05 CUDA Version: 13.0

Operating System: Ubuntu 24.04.3 LTS Baremetal or Container (if so, version): Baremetal

Relevant Files

test.zip

Steps To Reproduce

Unzip the attached file and run make. Run the reproducer with

LD_LIBRARY_PATH=. ./test

Have you tried the latest release?: yes

notaz avatar Nov 05 '25 19:11 notaz