PreconditionNotMetError: The third-party dynamic library (libcublas.so) that Paddle depends on is no

运行paddle报错:

C++ Call Stacks (More useful to developers):
--------------------------------------------
0   std::string paddle::platform::GetTraceBackString<std::string>(std::string&&, char const*, int)
1   paddle::platform::EnforceNotMet::EnforceNotMet(paddle::platform::ErrorSummary const&, char const*, int)
2   paddle::platform::dynload::GetCublasDsoHandle()
3   void std::__once_call_impl<std::_Bind_simple<paddle::platform::dynload::DynLoad__cublasCreate_v2::operator()<cublasContext**>(cublasContext**)::{lambda()#1} ()> >()
4   paddle::platform::CublasHandleHolder::CublasHandleHolder(CUstream_st*, cublasMath_t)
5   paddle::platform::CUDAContext::CUDAContext(paddle::platform::CUDAPlace const&, paddle::platform::stream::Priority const&)
6   paddle::platform::CUDADeviceContext::CUDADeviceContext(paddle::platform::CUDAPlace)
7   std::_Function_handler<std::unique_ptr<paddle::platform::DeviceContext, std::default_delete<paddle::platform::DeviceContext> > (), std::reference_wrapper<std::_Bind_simple<paddle::platform::EmplaceDeviceContext<paddle::platform::CUDADeviceContext, paddle::platform::CUDAPlace>(std::map<paddle::platform::Place, std::shared_future<std::unique_ptr<paddle::platform::DeviceContext, std::default_delete<paddle::platform::DeviceContext> > >, std::less<paddle::platform::Place>, std::allocator<std::pair<paddle::platform::Place const, std::shared_future<std::unique_ptr<paddle::platform::DeviceContext, std::default_delete<paddle::platform::DeviceContext> > > > > >*, paddle::platform::Place)::{lambda()#1} ()> > >::_M_invoke(std::_Any_data const&)
8   std::_Function_handler<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> (), std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<std::unique_ptr<paddle::platform::DeviceContext, std::default_delete<paddle::platform::DeviceContext> > >, std::__future_base::_Result_base::_Deleter>, std::unique_ptr<paddle::platform::DeviceContext, std::default_delete<paddle::platform::DeviceContext> > > >::_M_invoke(std::_Any_data const&)
9   std::__future_base::_State_base::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>&, bool&)
10  std::__future_base::_Deferred_state<std::_Bind_simple<paddle::platform::EmplaceDeviceContext<paddle::platform::CUDADeviceContext, paddle::platform::CUDAPlace>(std::map<paddle::platform::Place, std::shared_future<std::unique_ptr<paddle::platform::DeviceContext, std::default_delete<paddle::platform::DeviceContext> > >, std::less<paddle::platform::Place>, std::allocator<std::pair<paddle::platform::Place const, std::shared_future<std::unique_ptr<paddle::platform::DeviceContext, std::default_delete<paddle::platform::DeviceContext> > > > > >*, paddle::platform::Place)::{lambda()#1} ()>, std::unique_ptr<paddle::platform::DeviceContext, std::default_delete<paddle::platform::DeviceContext> > >::_M_run_deferred()
11  paddle::platform::DeviceContextPool::Get(paddle::platform::Place const&)
12  paddle::framework::GarbageCollector::GarbageCollector(paddle::platform::Place const&, unsigned long)
13  paddle::framework::UnsafeFastGPUGarbageCollector::UnsafeFastGPUGarbageCollector(paddle::platform::CUDAPlace const&, unsigned long)
14  paddle::framework::Executor::RunPartialPreparedContext(paddle::framework::ExecutorPrepareContext*, paddle::framework::Scope*, long, long, bool, bool, bool)
15  paddle::framework::Executor::RunPreparedContext(paddle::framework::ExecutorPrepareContext*, paddle::framework::Scope*, bool, bool, bool)
16  paddle::framework::Executor::Run(paddle::framework::ProgramDesc const&, paddle::framework::Scope*, int, bool, bool, std::vector<std::string, std::allocator<std::string> > const&, bool, bool)

----------------------
Error Message Summary:
----------------------
PreconditionNotMetError: The third-party dynamic library (libcublas.so) that Paddle depends on is not configured correctly. (error code is libcublas.so: cannot open shared object file: No such file or directory)
  Suggestions:
  1. Check if the third-party dynamic library (e.g. CUDA, CUDNN) is installed correctly and its version is matched with paddlepaddle you installed.
  2. Configure third-party dynamic library environment variables as follows:
  - Linux: set LD_LIBRARY_PATH by `export LD_LIBRARY_PATH=...`
  - Windows: set PATH by `set PATH=XXX; at (/paddle/paddle/fluid/platform/dynload/dynamic_loader.cc:194)

解决方式:

找到cuda的lib64,然后设置LD_LIBRARY_PATH

export LD_LIBRARY_PATH='/usr/local/cuda-10.0/lib64/'

 

  • 6
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 8
    评论
### 回答1: 这个错误提示表明 PaddlePaddle 需要依赖的一个名为 cudnn64_7.dll 的第三方动态库没有被正确地配置。错误代码 126 表示在尝试加载这个库时发生了一个错误。 解决这个问题的方法取决于你的操作系统和安装环境。以下是一些可能有用的建议: 1. 确认已经正确安装了 CUDA 和 cuDNN,并且它们的版本与 PaddlePaddle 所需的版本匹配。 2. 确认系统环境变量已经正确设置,包括 PATH 和 LD_LIBRARY_PATH。具体而言,确保 CUDA 和 cuDNN 的路径已经被添加到这些变量中。 3. 如果你是在 Windows 上使用 PaddlePaddle,尝试将 cudnn64_7.dll 复制到 PaddlePaddle 安装目录下的 bin 目录中。通常情况下,这个目录的路径类似于 C:\Program Files\PaddlePaddle\bin。 4. 如果你使用的是 Anaconda 环境,尝试在 Anaconda Prompt 中输入以下命令:conda install cudatoolkit=xx.x cudnn=xx.x -c paddle。其中的 xx.x 是你正在使用的 CUDA 和 cuDNN 版本号。 如果以上方法无法解决问题,建议在 PaddlePaddle 的官方论坛或 GitHub 上寻求帮助。 ### 回答2: 这个错误是因为PaddlePaddle的一个第三方库cudnn64_7.dll没有配置正确所引起的。cudnn是NVIDIA的一个专门用于深度神经网络的库,它提供了高效的计算和内存管理,能够大幅提高深度神经网络的训练和推断效率。PaddlePaddle对cudnn的依赖非常重要,如果cudnn配置不正确就会出现运行时错误。 首先,我们可以检查cudnn库的路径是否正确。在PaddlePaddle的配置文件中,需要设置cudnn库的路径,确保PaddlePaddle能够正确找到它。例如,在Windows系统中,可以在环境变量中设置CUDA_HOME和CUDNN_HOME这两个变量,它们分别指向CUDA和cudnn的安装目录。在Linux系统中,可以编辑bashrc文件,添加对应的路径。当PaddlePaddle引用cudnn库时,会自动在这些路径下寻找cudnn库。 其次,我们可以检查cudnn库的版本是否正确。PaddlePaddle对不同版本的cudnn库有不同的要求,如果版本不对就会出现错误。在PaddlePaddle的官网上可以找到不同版本cudnn库的要求。在更新cudnn库时,需要注意版本的兼容性,不要将不兼容的版本强行安装。 最后,我们也可以考虑重新安装PaddlePaddle和cudnn库。有时候,由于其他原因导致PaddlePaddle和cudnn的配置出现错误,重新安装可以解决问题。在重新安装时,需要确保所有依赖库的版本和配置都是正确的,并且按照官方指南进行操作。 总之,当出现runtimeerror: (preconditionnotmet) the third-party dynamic library (cudnn64_7.dll) that paddle depends on is not configured correctly. (error code is 126)这个错误时,需要检查cudnn库的路径和版本是否正确,并考虑重新安装PaddlePaddle和cudnn库。 ### 回答3: 这个错误信息是PaddlePaddle深度学习框架在加载cudnn64_7.dll动态库时发现了问题,错误代码是126。cudnn64_7.dll是一个用于加速GPU计算的第三方动态库,在使用PaddlePaddle训练深度学习模型时需要依赖它。出现这个错误通常可能是以下两种情况之一: 1. cudnn64_7.dll文件不存在或已损坏。 解决方案:可以尝试重新安装CUDA和cudnn库。首先检查CUDA和cudnn的版本是否匹配,然后下载对应版本的cudnn库并将其解压到CUDA库的相应目录中。如果已经安装了正确版本的cudnn库,可以尝试重新安装CUDA并选择添加cudnn库选项来修复问题。 2. cudnn64_7.dll文件路径未正确配置。 解决方案:检查CUDA和cudnn的环境变量是否正确设置,确保它们的路径被正确添加到系统的环境变量中。另外,也可以在PaddlePaddle的命令行参数中添加CUDA和cudnn的路径来指定它们的位置。 总的来说,如果遇到这个错误,最好先检查CUDA和cudnn的版本是否匹配并确认环境变量设置是否正确。如果问题仍然存在,可以重新安装CUDA和cudnn库来解决。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 8
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值