Skip to content

Commit fe85567

Browse files
Weiming Zhaoweimingzha0
Weiming Zhao
authored andcommitted
Fix ODLA TRT plugin build
Some common files (e.g. checkMacrosPlugin.cpp) were included in odla plugin, which causes errors using logging because both libs have the same logger definition. (cherry picked from commit 0d03954f87032991c6e54941ac1747aaad279b97)
1 parent ad9c091 commit fe85567

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

ODLA/platforms/tensorrt/CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ set(CUDA_ROOT /usr/local/cuda-${CUDA_VERSION}/targets/x86_64-linux)
2222
find_library(CUDART_LIB NAMES cudart PATHS ${CUDA_ROOT} PATH_SUFFIXES lib NO_DEFAULT_PATH)
2323
find_library(nvinfer NAMES nvinfer)
2424
find_library(nvinfer_plugin NAMES nvinfer_plugin)
25+
find_library(nvinfer_plugin_static NAMES nvinfer_plugin_static)
26+
2527

2628
if(NOT CUDART_LIB OR NOT nvinfer OR NOT nvinfer_plugin)
2729
message(STATUS "CUDA library not found, skip building ODLA for TensorRT")

ODLA/platforms/tensorrt/plugins/CMakeLists.txt

+4
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ endforeach(PLUGIN_ITER)
7373

7474
# Add common
7575
add_subdirectory(${COMMON_UTILS_DIR} ${CMAKE_CURRENT_BINARY_DIR}/common)
76+
# Remove
77+
list(FILTER PLUGIN_SOURCES EXCLUDE REGEX "checkMacrosPlugin.cpp")
78+
list(FILTER PLUGIN_SOURCES EXCLUDE REGEX "reducedMathPlugin.cpp")
79+
list(FILTER PLUGIN_SOURCES EXCLUDE REGEX "cudaDriverWrapper.cpp")
7680

7781
# Set gencodes
7882
set_source_files_properties(${PLUGIN_CU_SOURCES} PROPERTIES COMPILE_FLAGS ${GENCODES})

ODLA/platforms/tensorrt/plugins/initPlugin.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ void initODLAPlugin(nvinfer1::ILogger* logger, const char* libNamespace) {
3131
#else
3232
const int NUM_PLUGINS = 32;
3333
#endif
34-
initLibNvInferPlugins(static_cast<void*>(logger), "");
34+
initLibNvInferPlugins(static_cast<void*>(logger), libNamespace);
3535
REGISTER_TENSORRT_PLUGIN(BatchedNMSPluginV2Creator);
3636
REGISTER_TENSORRT_PLUGIN(OneHotPluginCreator);
3737

@@ -41,4 +41,4 @@ void initODLAPlugin(nvinfer1::ILogger* logger, const char* libNamespace) {
4141
logger->log(ILogger::Severity::kERROR, "init ODLA plugin failed.");
4242
}
4343
}
44-
}
44+
}

0 commit comments

Comments
 (0)