三个问题
第一个libssl.so.1.1 问题,报错如下
(paddlesp) ww@pp:~/桌面$ python Python 3.10.13 (main, Sep 11 2023, 13:44:35) [GCC 11.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import paddle Error: Can not import paddle core while this file exists: /home/ww/miniconda3/envs/paddlesp/lib/python3.10/site-packages/paddle/fluid/libpaddle.so Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/ww/miniconda3/envs/paddlesp/lib/python3.10/site-packages/paddle/__init__.py", line 31, in <module> from .framework import monkey_patch_variable File "/home/ww/miniconda3/envs/paddlesp/lib/python3.10/site-packages/paddle/framework/__init__.py", line 17, in <module> from . import random # noqa: F401 File "/home/ww/miniconda3/envs/paddlesp/lib/python3.10/site-packages/paddle/framework/random.py", line 17, in <module> from paddle import fluid File "/home/ww/miniconda3/envs/paddlesp/lib/python3.10/site-packages/paddle/fluid/__init__.py", line 36, in <module> from . import framework File "/home/ww/miniconda3/envs/paddlesp/lib/python3.10/site-packages/paddle/fluid/framework.py", line 35, in <module> from . import core File "/home/ww/miniconda3/envs/paddlesp/lib/python3.10/site-packages/paddle/fluid/core.py", line 356, in <module> raise e File "/home/ww/miniconda3/envs/paddlesp/lib/python3.10/site-packages/paddle/fluid/core.py", line 269, in <module> from . import libpaddle ImportError: libssl.so.1.1: cannot open shared object file: No such file or directory >>>
解决方法:
wget http://nz2.archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_amd64.deb sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2_amd64.deb
第二个问题 libcudart.so.10.2不能被找到。报错如下
(paddlesp) ww@pp:~/桌面$ python Python 3.10.13 (main, Sep 11 2023, 13:44:35) [GCC 11.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import paddle Error: Can not import paddle core while this file exists: /home/ww/miniconda3/envs/paddlesp/lib/python3.10/site-packages/paddle/fluid/libpaddle.so Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/ww/miniconda3/envs/paddlesp/lib/python3.10/site-packages/paddle/__init__.py", line 31, in <module> from .framework import monkey_patch_variable File "/home/ww/miniconda3/envs/paddlesp/lib/python3.10/site-packages/paddle/framework/__init__.py", line 17, in <module> from . import random # noqa: F401 File "/home/ww/miniconda3/envs/paddlesp/lib/python3.10/site-packages/paddle/framework/random.py", line 17, in <module> from paddle import fluid File "/home/ww/miniconda3/envs/paddlesp/lib/python3.10/site-packages/paddle/fluid/__init__.py", line 36, in <module> from . import framework File "/home/ww/miniconda3/envs/paddlesp/lib/python3.10/site-packages/paddle/fluid/framework.py", line 35, in <module> from . import core File "/home/ww/miniconda3/envs/paddlesp/lib/python3.10/site-packages/paddle/fluid/core.py", line 356, in <module> raise e File "/home/ww/miniconda3/envs/paddlesp/lib/python3.10/site-packages/paddle/fluid/core.py", line 269, in <module> from . import libpaddle ImportError: libcudart.so.10.2: cannot open shared object file: No such file or directory >>>
解决方法:参照博客
第三个问题
The GPU architecture in your current machine is Ampere, which is not compatible with Paddle installation with arch: 52 60 61 70 75 , it is recommended to install the corresponding wheel package according to the installation information on the official Paddle website.
翻译:这个信息表明你的 GPU 架构是 Ampere,与 PaddlePaddle 安装时所需的 GPU 架构不完全兼容。但由于你成功通过了验证,说明 PaddlePaddle 仍然能够在你的 GPU 上正常工作,所以你可以继续使用它
User (paddlesp) ww@pp:~/桌面$ python Python 3.10.13 (main, Sep 11 2023, 13:44:35) [GCC 11.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import paddle File "<stdin>", line 1 import paddle IndentationError: unexpected indent >>> import paddle >>> paddle.utils.run_check() Running verify PaddlePaddle program ... I0104 19:42:43.980899 7104 interpretercore.cc:237] New Executor is Running. W0104 19:42:43.981134 7104 gpu_resources.cc:96] The GPU architecture in your current machine is Ampere, which is not compatible with Paddle installation with arch: 52 60 61 70 75 , it is recommended to install the corresponding wheel package according to the installation information on the official Paddle website. W0104 19:42:43.981145 7104 gpu_resources.cc:119] Please NOTE: device: 0, GPU Compute Capability: 8.6, Driver API Version: 12.2, Runtime API Version: 10.2 W0104 19:42:43.983601 7104 gpu_resources.cc:149] device: 0, cuDNN Version: 7.6.
我的显卡驱动 API 版本:12.2,运行时 API 版本:10.2 ,解释一下显卡驱动版本是安装显卡的自带的,运行API版本是自己安装的
解决:得亏得我之前记录做的好,以前记录过安装的版本号,重新下载cudatoolkit=11.2安装。
Python 3.10.13 (main, Sep 11 2023, 13:44:35) [GCC 11.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import paddle >>> paddle.utils.run_check() Running verify PaddlePaddle program ... I0104 21:05:21.864025 8914 interpretercore.cc:237] New Executor is Running. W0104 21:05:21.864185 8914 gpu_resources.cc:119] Please NOTE: device: 0, GPU Compute Capability: 8.6, Driver API Version: 12.2, Runtime API Version: 11.2 W0104 21:05:21.865571 8914 gpu_resources.cc:149] device: 0, cuDNN Version: 8.2. I0104 21:05:23.240983 8914 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.
成功!
注意:成功的版本搭配 paddlepaddle-GPU=2.5.0 cudatoolkit=11.2