Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux env TRT_LIBPATH in wrong format when building TensorRT 10.6 OSS #4251

Open
Synapsess opened this issue Nov 18, 2024 · 0 comments
Open

Comments

@Synapsess
Copy link

Description

when I tried to build TensorRT 10.6 oss, i met the following errors:
========================= Importing and creating target nvinfer ==========================
-- Looking for library nvinfer
-- Library that was found nvinfer_LIB_PATH-NOTFOUND

these errors are related with file of https://github.com/NVIDIA/TensorRT/blob/release/10.6/cmake/modules/find_library_create_target.cmake

macro(find_library_create_target target_name lib libtype hints)
    message(STATUS "========================= Importing and creating target ${target_name} ==========================")
    message(STATUS "Looking for library ${lib}")
    if (CMAKE_BUILD_TYPE STREQUAL "Debug")
        find_library(${lib}_LIB_PATH ${lib}${TRT_DEBUG_POSTFIX} HINTS ${hints} NO_DEFAULT_PATH)
    endif()
    find_library(${lib}_LIB_PATH ${lib} HINTS ${hints} NO_DEFAULT_PATH)
    find_library(${lib}_LIB_PATH ${lib})
    message(STATUS "Library that was found ${${lib}_LIB_PATH}")
    add_library(${target_name} ${libtype} IMPORTED)
    set_property(TARGET ${target_name} PROPERTY IMPORTED_LOCATION ${${lib}_LIB_PATH})
    message(STATUS "==========================================================================================")
endmacro()

they means if fails to find the library of nvinfer in path of hints

after carefully debug, i find hints is the variable of TRT_LIB_DIR, and TRT_LIB_DIR is from the env variable TRT_LIBPATH which is mentioned in read_me:

 cd $TRT_OSSPATH
 mkdir -p build && cd build
 cmake .. -DTRT_LIB_DIR=$TRT_LIBPATH -DTRT_OUT_DIR=`pwd`/out
 make -j$(nproc)

the actual problem is TRT_LIBPATH is the env variable in linux(Ubuntu 24.04 for me), when export TRT_LIBPATH in cmake , TRT_LIB_DIR
will look like :path1:path2:path3. Different paths are separated by ":". But for list type in cmake they should like path1;path2;path3. This bug causes the function of find_library cant find lib we needed.

i fixed the bug by adding

string(SUBSTRING "${TRT_LIB_DIR}" 1 -1 TRT_LIB_DIR_without_colon)
string(REPLACE ":" ";" TRT_LIB_DIR "${TRT_LIB_DIR_without_colon}")

to del first ":" and replace all ":" with ";".

I'm not very familiar with cmake. Is this really a bug, or is there an issue with my installation process? Thank you very much for your help.

if you want to reproduce, remember to del cmake cache in build file

Environment

TensorRT Version: 10.6

NVIDIA GPU:

NVIDIA Driver Version:

CUDA Version: 12.4

CUDNN Version:

Operating System:

Python Version (if applicable):

Tensorflow Version (if applicable):

PyTorch Version (if applicable):

Baremetal or Container (if so, version):

Relevant Files

Model link:

Steps To Reproduce

Commands or scripts:

Have you tried the latest release?:

Can this model run on other frameworks? For example run ONNX model with ONNXRuntime (polygraphy run <model.onnx> --onnxrt):

@Synapsess Synapsess changed the title Bugs when building TensorRT 10.6 OSS Linux env TRT_LIBPATH in wrong format when building TensorRT 10.6 OSS Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant