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

Add default cudnn lib path (#25175)

* add default cudnn lib path, test=develop

* change default path in func, test=develop

* move to linux branch, test=develop

* fix var error in other plat, test=develop
上级 38d2d13d
...@@ -58,6 +58,7 @@ struct PathNode { ...@@ -58,6 +58,7 @@ struct PathNode {
}; };
static constexpr char cupti_lib_path[] = CUPTI_LIB_PATH; static constexpr char cupti_lib_path[] = CUPTI_LIB_PATH;
static constexpr char linux_cudnn_lib_path[] = "/usr/local/cuda/lib64";
static PathNode s_py_site_pkg_path; static PathNode s_py_site_pkg_path;
...@@ -200,7 +201,11 @@ void* GetCUDNNDsoHandle() { ...@@ -200,7 +201,11 @@ void* GetCUDNNDsoHandle() {
#elif defined(_WIN32) && defined(PADDLE_WITH_CUDA) #elif defined(_WIN32) && defined(PADDLE_WITH_CUDA)
return GetDsoHandleFromSearchPath(FLAGS_cudnn_dir, win_cudnn_lib); return GetDsoHandleFromSearchPath(FLAGS_cudnn_dir, win_cudnn_lib);
#else #else
return GetDsoHandleFromSearchPath(FLAGS_cudnn_dir, "libcudnn.so", false); std::string linux_cudnn_path = linux_cudnn_lib_path;
if (!FLAGS_cudnn_dir.empty()) {
linux_cudnn_path = FLAGS_cudnn_dir;
}
return GetDsoHandleFromSearchPath(linux_cudnn_path, "libcudnn.so", false);
#endif #endif
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册