未验证 提交 d89deae9 编写于 作者: P Pei Yang 提交者: GitHub

reduce trt warning message (#28011) (#28075)

上级 316c97c7
...@@ -45,25 +45,9 @@ void* GetTensorRtHandle() { ...@@ -45,25 +45,9 @@ void* GetTensorRtHandle() {
if (nullptr == dso_handle) { if (nullptr == dso_handle) {
auto error_msg = auto error_msg =
"TensorRT dynamic library (%s) that Paddle depends on is not " "You are using Paddle compiled with TensorRT, but TensorRT dynamic "
"configured correctly. (error code is %s)\n" "library is not found. Ignore this if TensorRT is not needed.";
" Suggestions:\n" std::cerr << error_msg;
" 1. Check if TensorRT "
"is installed correctly and its version is matched with paddlepaddle "
"you installed.\n"
" 2. Configure TensorRT dynamic library environment variables as "
"follows:\n"
" - Linux: set LD_LIBRARY_PATH by `export LD_LIBRARY_PATH=...`\n"
" - Windows: set PATH by `set PATH=XXX;%PATH%`\n"
" - Mac: set DYLD_LIBRARY_PATH by `export DYLD_LIBRARY_PATH=...` "
"[Note: After Mac OS 10.11, using the DYLD_LIBRARY_PATH is "
"impossible unless System Integrity Protection (SIP) is disabled.]";
#if !defined(_WIN32)
auto errorno = dlerror();
#else
auto errorno = GetLastError();
#endif // !_WIN32
std::cerr << string::Sprintf(error_msg, dso_name, errorno);
} }
return dso_handle; return dso_handle;
......
...@@ -50,6 +50,7 @@ extern void* tensorrt_dso_handle; ...@@ -50,6 +50,7 @@ extern void* tensorrt_dso_handle;
}; \ }; \
extern DynLoad__##__name __name extern DynLoad__##__name __name
#ifdef NV_TENSORRT_MAJOR
#if (NV_TENSORRT_MAJOR >= 6) #if (NV_TENSORRT_MAJOR >= 6)
#define TENSORRT_RAND_ROUTINE_EACH(__macro) \ #define TENSORRT_RAND_ROUTINE_EACH(__macro) \
__macro(createInferBuilder_INTERNAL); \ __macro(createInferBuilder_INTERNAL); \
...@@ -62,6 +63,7 @@ extern void* tensorrt_dso_handle; ...@@ -62,6 +63,7 @@ extern void* tensorrt_dso_handle;
#endif #endif
TENSORRT_RAND_ROUTINE_EACH(DECLARE_DYNAMIC_LOAD_TENSORRT_WRAP) TENSORRT_RAND_ROUTINE_EACH(DECLARE_DYNAMIC_LOAD_TENSORRT_WRAP)
#endif
} // namespace dynload } // namespace dynload
} // namespace platform } // namespace platform
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册