未验证 提交 a6abd92d 编写于 作者: C Chen Weihang 提交者: GitHub

Polish install error hint message (#25531)

* polish install error hint msg, test=develop

* fix variable error, test=develop

* polish hint messgae again
上级 cd933c0a
...@@ -172,13 +172,19 @@ static inline void* GetDsoHandleFromSearchPath( ...@@ -172,13 +172,19 @@ static inline void* GetDsoHandleFromSearchPath(
// 5. [If Failed] logging or throw error info // 5. [If Failed] logging or throw error info
if (nullptr == dso_handle) { if (nullptr == dso_handle) {
auto error_msg = auto error_msg =
"Failed to find dynamic library: %s ( %s ) \n" "The third-party dynamic library (%s) that Paddle depends on is not "
"Please specify its path correctly using following ways: \n" "configured correctly. (error code is %s)\n"
" set environment variable LD_LIBRARY_PATH on Linux or " " Suggestions:\n"
"DYLD_LIBRARY_PATH on Mac OS. \n" " 1. Check if the third-party dynamic library (e.g. CUDA, CUDNN) "
" For instance, issue command: export LD_LIBRARY_PATH=... \n" "is installed correctly and its version is matched with paddlepaddle "
" Note: After Mac OS 10.11, using the DYLD_LIBRARY_PATH is " "you installed.\n"
"impossible unless System Integrity Protection (SIP) is disabled."; " 2. Configure third-party 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) #if !defined(_WIN32)
auto errorno = dlerror(); auto errorno = dlerror();
#else #else
...@@ -186,7 +192,8 @@ static inline void* GetDsoHandleFromSearchPath( ...@@ -186,7 +192,8 @@ static inline void* GetDsoHandleFromSearchPath(
#endif // !_WIN32 #endif // !_WIN32
if (throw_on_error) { if (throw_on_error) {
// NOTE: Special error report case, no need to change its format // NOTE: Special error report case, no need to change its format
PADDLE_THROW(platform::errors::NotFound(error_msg, dso_name, errorno)); PADDLE_THROW(
platform::errors::PreconditionNotMet(error_msg, dso_name, errorno));
} else { } else {
LOG(WARNING) << string::Sprintf(error_msg, dso_name, errorno); LOG(WARNING) << string::Sprintf(error_msg, dso_name, errorno);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册