【paddle本地环境安装踩坑记录】libssl.so.1.1...PreconditionNotMetError...

这篇具有很好参考价值的文章主要介绍了【paddle本地环境安装踩坑记录】libssl.so.1.1...PreconditionNotMetError...。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

此次报错出在paddlepaddle-gpu环境出错上

本机环境为ubuntu16.04,虽然版本较低,但所遇到的问题几乎适用于所有版本(如有错误请纠正)

一、libssl.so.1.1: cannot open shared object file: No such file or directory

首先确保自己通过paddlepaddle官网安装步骤是正确,CUDA版本也确认过对应无误!!

然后就在通过以下语句:
python
import paddle
paddle.utils.run_check()

验证是否安装成功时产生了报错:

python
Python 3.8.0 | packaged by conda-forge | (default, Nov 22 2019, 19:11:38) 
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import paddle
Error: Can not import paddle core while this file exists: /home/zero/anaconda3/envs/paddleEnv/lib/python3.8/site-packages/paddle/fluid/libpaddle.so
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/zero/anaconda3/envs/paddleEnv/lib/python3.8/site-packages/paddle/__init__.py", line 31, in <module>
    from .framework import monkey_patch_variable
  File "/home/zero/anaconda3/envs/paddleEnv/lib/python3.8/site-packages/paddle/framework/__init__.py", line 17, in <module>
    from . import random  # noqa: F401
  File "/home/zero/anaconda3/envs/paddleEnv/lib/python3.8/site-packages/paddle/framework/random.py", line 17, in <module>
    from paddle import fluid
  File "/home/zero/anaconda3/envs/paddleEnv/lib/python3.8/site-packages/paddle/fluid/__init__.py", line 36, in <module>
    from . import framework
  File "/home/zero/anaconda3/envs/paddleEnv/lib/python3.8/site-packages/paddle/fluid/framework.py", line 35, in <module>
    from . import core
  File "/home/zero/anaconda3/envs/paddleEnv/lib/python3.8/site-packages/paddle/fluid/core.py", line 356, in <module>
    raise e
  File "/home/zero/anaconda3/envs/paddleEnv/lib/python3.8/site-packages/paddle/fluid/core.py", line 269, in <module>
    from . import libpaddle
ImportError: /usr/lib/libssl.so.1.1: symbol ENGINE_set_tass_flags, version OPENSSL_1_1_1b not defined in file libcrypto.so.1.1 with link time reference
>>> exit()

经查询发现,这些.so文件并非是我们系统中没有,只是没有在指定的位置,所以找不到。
于是我们将找到的文件放到正确的地方即可:

1.先找到系统中这些文件所在的位置

sudo find / -name libssl.so.1.1/usr/lib/libssl.so.1.1

2.查询结果如下

find: `/run/user/1000/gvfs': 权限不够
/opt/kingsoft/wps-office/office6/libssl.so.1.1
/var/lib/docker/aufs/diff/a1553a2332d791f53183476f9942848ce98a9f27302ce125e16e430efb994c0a/usr/lib/x86_64-linux-gnu/libssl.so.1.1
/home/zero/anaconda3/lib/libssl.so.1.1
/home/zero/anaconda3/pkgs/openssl-1.1.1u-hd590300_0/lib/libssl.so.1.1
/home/zero/anaconda3/pkgs/openssl-1.1.1k-h27cfd23_0/lib/libssl.so.1.1
/home/zero/anaconda3/pkgs/openssl-1.1.1h-h7b6447c_0/lib/libssl.so.1.1
/home/zero/anaconda3/pkgs/openssl-1.1.1w-hd590300_0/lib/libssl.so.1.1
/home/zero/anaconda3/pkgs/openssl-1.1.1k-h7f98852_0/lib/libssl.so.1.1
/home/zero/anaconda3/envs/yolov7/lib/libssl.so.1.1
/home/zero/anaconda3/envs/pytorch/lib/libssl.so.1.1
/home/zero/anaconda3/envs/alphapose/lib/libssl.so.1.1
/home/zero/anaconda3/envs/FaceRecognition/lib/libssl.so.1.1
/home/zero/anaconda3/envs/paddleEnv/lib/libssl.so.1.1

3.找到随便一个作出如下更改:

sudo cp /home/zero/anaconda3/envs/pytorch/lib/libssl.so.1.1 /usr/lib

4.此时会发现该报错已经消失,但是有可能出现新的相似报错,用该方法同样可以解决

二、PreconditionNotMetError: Cannot load cudnn shared library. Cannot invoke method cudnnGetVersion.

具体是在这里触发的:

python
Python 3.8.0 | packaged by conda-forge | (default, Nov 22 2019, 19:11:38) 
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import paddle
>>> paddle.utils.run_check()
Running verify PaddlePaddle program ... 
I1023 21:03:54.605382 30889 interpretercore.cc:237] New Executor is Running.
W1023 21:03:54.605722 30889 gpu_resources.cc:96] The GPU architecture in your current machine is Maxwell, which is not compatible with Paddle installation with arch: 70 75 80 86 , it is recommended to install the corresponding wheel package according to the installation information on the official Paddle website.
W1023 21:03:54.605732 30889 gpu_resources.cc:119] Please NOTE: device: 0, GPU Compute Capability: 5.2, Driver API Version: 11.3, Runtime API Version: 11.7
W1023 21:03:54.605855 30889 dynamic_loader.cc:303] The third-party dynamic library (libcudnn.so) that Paddle depends on is not configured correctly. (error code is /usr/local/cuda/lib64/libcudnn.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;
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/zero/anaconda3/envs/paddleEnv/lib/python3.8/site-packages/paddle/utils/install_check.py", line 249, in run_check
    _run_static_single(use_cuda, use_xpu)
  File "/home/zero/anaconda3/envs/paddleEnv/lib/python3.8/site-packages/paddle/utils/install_check.py", line 146, in _run_static_single
    exe.run(startup_prog)
  File "/home/zero/anaconda3/envs/paddleEnv/lib/python3.8/site-packages/paddle/fluid/executor.py", line 1392, in run
    res = self._run_impl(
  File "/home/zero/anaconda3/envs/paddleEnv/lib/python3.8/site-packages/paddle/fluid/executor.py", line 1618, in _run_impl
    ret = new_exe.run(
  File "/home/zero/anaconda3/envs/paddleEnv/lib/python3.8/site-packages/paddle/fluid/executor.py", line 654, in run
    tensors = self._new_exe.run(
RuntimeError: In user code:

    File "<stdin>", line 1, in <module>
      
    File "/home/zero/anaconda3/envs/paddleEnv/lib/python3.8/site-packages/paddle/utils/install_check.py", line 249, in run_check
      _run_static_single(use_cuda, use_xpu)
    File "/home/zero/anaconda3/envs/paddleEnv/lib/python3.8/site-packages/paddle/utils/install_check.py", line 133, in _run_static_single
      input, out, weight = _simple_network()
    File "/home/zero/anaconda3/envs/paddleEnv/lib/python3.8/site-packages/paddle/utils/install_check.py", line 31, in _simple_network
      weight = paddle.create_parameter(
    File "/home/zero/anaconda3/envs/paddleEnv/lib/python3.8/site-packages/paddle/tensor/creation.py", line 222, in create_parameter
      return helper.create_parameter(
    File "/home/zero/anaconda3/envs/paddleEnv/lib/python3.8/site-packages/paddle/fluid/layer_helper_base.py", line 432, in create_parameter
      self.startup_program.global_block().create_parameter(
    File "/home/zero/anaconda3/envs/paddleEnv/lib/python3.8/site-packages/paddle/fluid/framework.py", line 3935, in create_parameter
      initializer(param, self)
    File "/home/zero/anaconda3/envs/paddleEnv/lib/python3.8/site-packages/paddle/nn/initializer/initializer.py", line 40, in __call__
      return self.forward(param, block)
    File "/home/zero/anaconda3/envs/paddleEnv/lib/python3.8/site-packages/paddle/nn/initializer/constant.py", line 65, in forward
      op = block.append_op(
    File "/home/zero/anaconda3/envs/paddleEnv/lib/python3.8/site-packages/paddle/fluid/framework.py", line 4013, in append_op
      op = Operator(
    File "/home/zero/anaconda3/envs/paddleEnv/lib/python3.8/site-packages/paddle/fluid/framework.py", line 2781, in __init__
      for frame in traceback.extract_stack():

    PreconditionNotMetError: Cannot load cudnn shared library. Cannot invoke method cudnnGetVersion.
      [Hint: cudnn_dso_handle should not be null.] (at ../paddle/phi/backends/dynload/cudnn.cc:64)
      [operator < fill_constant > error]
>>> exit()

该问题同样也是,cudnn我们可以查询到在相应anaconda环境下的envs的lib中是存在的:

(paddleEnv) zero@zero:~$ which python
/home/zero/anaconda3/envs/paddleEnv/bin/python
(paddleEnv) zero@zero:~$ ls /home/zero/anaconda3/envs/paddleEnv/lib/
libcudart.so                 libnvblas.so.11.4.1.1043
libcudart.so.11.0            libnvjpeg.so
libcudart.so.11.2.152        libnvjpeg.so.11
libcudnn_adv_infer.so        libnvjpeg.so.11.4.0.152
libcudnn_adv_infer.so.8      libnvrtc-builtins.so
libcudnn_adv_infer.so.8.2.1  libnvrtc-builtins.so.11.2
libcudnn_adv_train.so        libnvrtc-builtins.so.11.2.152
libcudnn_adv_train.so.8      libnvrtc.so
libcudnn_adv_train.so.8.2.1  libnvrtc.so.11.2
libcudnn_cnn_infer.so        libnvrtc.so.11.2.152
libcudnn_cnn_infer.so.8      libnvToolsExt.so
libcudnn_cnn_infer.so.8.2.1  libnvToolsExt.so.1
libcudnn_cnn_train.so        libnvToolsExt.so.1.0.0
libcudnn_cnn_train.so.8      libnvvm.so
libcudnn_cnn_train.so.8.2.1  libnvvm.so.4
libcudnn_ops_infer.so        libnvvm.so.4.0.0
libcudnn_ops_infer.so.8      libopenblasp-r0.3.24.so
libcudnn_ops_infer.so.8.2.1  libopenblas.so.0
libcudnn_ops_train.so        libopenjp2.a
libcudnn_ops_train.so.8      libopenjp2.so
libcudnn_ops_train.so.8.2.1  libopenjp2.so.2.4.0
libcudnn.so                  libopenjp2.so.7
libcudnn.so.8                libpanel.so
libcudnn.so.8.2.1            libpanel.so.6
...

可以看到,该有的包我们都有,但还是有报错,这是因为需要的cuda、cudnn都已经安装,出现这个问题是找不到对应的动态库,所以要针对性处理。

1.首先,我们先打开系统配置文件

gedit ~/.bashrc

2.使用以下语句将刚才找到这些动态库的目录配置到文件末尾,切记是末尾,如果有别的LD_LIBRARY_PATH,切记要注释掉:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/zero/anaconda3/envs/paddleEnv/lib/

3.别忘了保存完该文件需要激活一下:

 source ~/.bashrc

4.然后继续测试paddle环境是否安装好

import paddle
paddle.utils.run_check()

5.显示下面的就安装成功了文章来源地址https://www.toymoban.com/news/detail-754293.html

(paddleEnv) zero@zero-Z97-HD3:~$ python
Python 3.8.0 | packaged by conda-forge | (default, Nov 22 2019, 19:11:38) 
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import paddle
>>> paddle.utils.run_check()
Running verify PaddlePaddle program ... 
I1023 21:39:20.841471  4339 interpretercore.cc:237] New Executor is Running.
W1023 21:39:20.841838  4339 gpu_resources.cc:96] The GPU architecture in your current machine is Maxwell, which is not compatible with Paddle installation with arch: 70 75 80 86 , it is recommended to install the corresponding wheel package according to the installation information on the official Paddle website.
W1023 21:39:20.841848  4339 gpu_resources.cc:119] Please NOTE: device: 0, GPU Compute Capability: 5.2, Driver API Version: 11.3, Runtime API Version: 11.2
W1023 21:39:20.843921  4339 gpu_resources.cc:149] device: 0, cuDNN Version: 8.2.
I1023 21:39:38.545578  4339 interpreter_util.cc:518] Standalone Executor is Used.
PaddlePaddle works well on 1 GPU.
PaddlePaddle is installed successfully! Let's start deep learning with PaddlePaddle now.
>>> exit()

如果帮助到你了,请点个赞哦!~

到了这里,关于【paddle本地环境安装踩坑记录】libssl.so.1.1...PreconditionNotMetError...的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • 解决libssl.so.1.1 libcrypto.so.1.1依赖问题

    本来调试电脑的虚拟机环境是好的,换了一台笔记本编译项目的时候,make后出现问题: /usr/bin/ld: warning: libssl.so.1.1, needed by /usr/local/lib/libonvifptz.so, not found (try using -rpath or -rpath-link) /usr/bin/ld: warning: libcrypto.so.1.1, needed by /usr/local/lib/libonvifptz.so, not found (try using -rpath or -rpath-lin

    2024年02月12日
    浏览(42)
  • 缺少libssl.so.10依赖的解决办法

    当你在Linux系统中遇到缺少 libssl.so.10 依赖的问题时,可以尝试以下解决办法: 安装 openssl-devel 包 更新 openssl 版本 重新安装缺失的软件包 如果在安装某个软件包时出现了缺失 libssl.so.10 的提示,可以尝试重新安装该软件包,以便它能够找到正确的依赖库。 希望这些方法能够

    2024年02月03日
    浏览(40)
  • openssl缺少libssl.so.1.1库文件

    这是由于openssl库的位置不正确造成的,一般出现在openssl源码升级场景下。 源码编译完成后,需要对libssl.so.1.1做一个软连接,从openssl源码安装目录/usr/local/openssl/lib/下面将编译好的libssl.so.1.1进行软连接。

    2024年01月21日
    浏览(49)
  • 解决Ubuntu22.04缺少libssl.so.1.1问题

    错误信息: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory 网络上的解决方案千篇一律,有说安装openssl解决的,这不是杀鸡用牛刀吗,再说Ubuntu自身已经安装了Openssl,你还要再安装一个?能解决问题吗?解决问题不能想当然,得找问题原

    2024年02月15日
    浏览(50)
  • 记录 | 报错:libssl-dev : 依赖: libssl3 (= 3.0.8-1ubuntu1.1) 但是 3.0.8-1ubuntu1.2 正要被安装

    ubuntu 上安装 libssl-dev 失败的报错解决 报错: 下列软件包有未满足的依赖关系: libssl-dev : 依赖: libssl3 (= 3.0.8-1ubuntu1.1) 但是 3.0.8-1ubuntu1.2 正要被安装 E: 无法修正错误,因为您要求某些软件包保持现状,就是它们破坏了软件包间的依赖关系。 想当然,ubuntu 下使用如下命令安装

    2024年02月01日
    浏览(40)
  • ubantu libssl.so.1.1: cannot open shared object file

    libssl.so.1.1: cannot open shared object file 使用 Ubuntu 22.04 时,有时候会遇到如下错误 error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory 这是因为Ubuntu 22.04 默认使用的是 openssl3.0 ,但是大多为 Ubuntu 生成的可执行文件依赖 openssl 1.1 安装Openssl 1.1 我们

    2024年02月04日
    浏览(38)
  • Stable Diffusion Webui 本地部署【踩坑记录】

    Python Release Python 3.10.6 | Python.org git是一个代码管理工具,通过它可以将开源项目仓库克隆到本地 下载地址:Git - Downloading Package 可以新建一个目录,在文件夹内单击鼠标右键,选择Git bash here,复制以下代码 也可以打开 GitHub - AUTOMATIC1111/stable-diffusion-webui: Stable Diffusion web UI S

    2024年02月12日
    浏览(58)
  • 处理conda安装工具的动态库问题——解决记录 libssl.1.0.0 系统中所有openssl位置全览 whereis openssl

    处理conda安装工具的动态库问题——解决记录 - 简书 解决`libssl.so.1.0.0: cannot open shared object file: No such file or directory`问题 - 简书 openssl 默认版本问题(Anaconda相关)_anaconda openssl-CSDN博客  whereis openssl 可以使用以下命令将内容添加到 ~/.bashrc 文件中: shellCopy Code 这将在 ~/.bashrc

    2024年02月07日
    浏览(41)
  • GTX1660Ti 本地部署 Stable Diffusion踩坑记录

    先是进行搜索如何本地安装,找到了两种安装方法:一个是结合 WebUI 来进行本地部署;还有一个就是直接安装到本地 通过代码段进行绘图 。因为之前做毕设已经有过配置环境的经验,于是选择第二种,开始了踩坑。 这里主要是借鉴了一下二位大佬的安装记录,这里插入一下

    2023年04月25日
    浏览(47)
  • text-generation-Webui-AI本地部署踩坑记录

    下载源码 text-generation-Webui 下载模型 chinese-alpaca-2-7b-hf下载完成的模型需要放置在项目下的models目录下 安装conda Free Download | Anaconda 安装python ​ python 设置环境变量 下载最新的显卡驱动 英伟达2060显卡驱动需要与自己显卡匹配 查看显卡驱动版本 创建conda环境 初始化 激活 安装

    2024年02月02日
    浏览(47)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包