Tensorrt: undefined reference to `createNvOnnxParserPluginFactory_INTERNAL'

Created on 19 Jan 2020  路  3Comments  路  Source: NVIDIA/TensorRT

I want to use the function createPluginFactory in my script on Jetson Nano

The tensorrt version on Jetson Nano is 5.1.6

below is my Cmakelist

find_path(TENSORRT_INCLUDE_DIR NvInfer.h
        HINTS ${TENSORRT_ROOT} ${CUDA_TOOLKIT_ROOT_DIR}
        PATH_SUFFIXES include/)

message(STATUS "Found TensorRT headers at ${TENSORRT_INCLUDE_DIR}")
find_library(TENSORRT_LIBRARY_INFER nvinfer
        HINTS ${TENSORRT_ROOT} ${TENSORRT_BUILD} ${CUDA_TOOLKIT_ROOT_DIR}
        PATH_SUFFIXES lib lib64 lib/x64)
find_library(TENSORRT_LIBRARY_INFER_PLUGIN nvinfer_plugin
        HINTS  ${TENSORRT_ROOT} ${TENSORRT_BUILD} ${CUDA_TOOLKIT_ROOT_DIR}
        PATH_SUFFIXES lib lib64 lib/x64)
find_library(TENSORRT_LIBRARY_PARSER nvparsers
        HINTS  ${TENSORRT_ROOT} ${TENSORRT_BUILD} ${CUDA_TOOLKIT_ROOT_DIR}
        PATH_SUFFIXES lib lib64 lib/x64)

find_library(TENSORRT_LIBRARY_ONNXPARSER nvonnxparser
        HINTS  ${TENSORRT_ROOT} ${TENSORRT_BUILD} ${CUDA_TOOLKIT_ROOT_DIR}
        PATH_SUFFIXES lib lib64 lib/x64)
set(TENSORRT_LIBRARY ${TENSORRT_LIBRARY_INFER} ${TENSORRT_LIBRARY_INFER_PLUGIN}
        ${TENSORRT_LIBRARY_PARSER} ${TENSORRT_LIBRARY_ONNXPARSER})
message(STATUS "Find TensorRT libs at ${TENSORRT_LIBRARY}")

find_package_handle_standard_args(
        TENSORRT DEFAULT_MSG TENSORRT_INCLUDE_DIR TENSORRT_LIBRARY)

if(NOT TENSORRT_FOUND)
    message(ERROR
            "Cannot find TensorRT library.")
endif()

and the error

[  5%] Building CXX object CMakeFiles/webcam_demo.dir/example/webcam_demo.cpp.o
[ 10%] Linking CXX executable webcam_demo
CMakeFiles/webcam_demo.dir/src/cttrt_Net.cpp.o: In function `nvonnxparser::(anonymous namespace)::createPluginFactory(nvinfer1::ILogger&)':
cttrt_Net.cpp:(.text+0x154): undefined reference to `createNvOnnxParserPluginFactory_INTERNAL'
collect2: error: ld returned 1 exit status
CMakeFiles/webcam_demo.dir/build.make:1041: recipe for target 'webcam_demo' failed
make[2]: *** [webcam_demo] Error 1
CMakeFiles/Makefile2:77: recipe for target 'CMakeFiles/webcam_demo.dir/all' failed
make[1]: *** [CMakeFiles/webcam_demo.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

any advice ?

Most helpful comment

how about Windows OS? There are only four library: nvinfer.lib, nvinfer_plugin.lib, nvonnxparser.lib, nvparsers.lib. There is no nvonnxparser_runtime.dll?

All 3 comments

solved

Solution from https://devtalk.nvidia.com/default/topic/1070108/tensorrt/undefined-reference-to-createnvonnxparserpluginfactory_internal:

solve the problem

just add below

find_library(TRT_ONNXPARSER_RUNTIME libnvonnxparser_runtime.so
HINTS /usr/lib/aarch64-linux-gnu/)

so that i can use the function properly

Thanks !

how about Windows OS? There are only four library: nvinfer.lib, nvinfer_plugin.lib, nvonnxparser.lib, nvparsers.lib. There is no nvonnxparser_runtime.dll?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Xianqi-Zhang picture Xianqi-Zhang  路  5Comments

WangXuanBT picture WangXuanBT  路  3Comments

yflv-yanxia picture yflv-yanxia  路  3Comments

prathik-naidu picture prathik-naidu  路  3Comments

dhkim0225 picture dhkim0225  路  6Comments