Set Internal Library Path API#

TensorRT internally loads builder resource libraries (libnvinfer_builder_resource_*.so) from the system library path (for example, LD_LIBRARY_PATH). If you load TensorRT from a custom location using dlopen, these resource libraries might not be found automatically.

Use nvinfer1::setInternalLibraryPath to specify the directory where TensorRT should look for its internal resource libraries at runtime.

// Load TensorRT from a custom location
dlopen("/path/to/custom/libnvinfer.so");
// Tell TensorRT where to find its internal resource libraries
nvinfer1::setInternalLibraryPath("/path/to/custom");
// Create builder and build engine