WSL Ubuntu 22.04.2 LTS 安装paddlepaddle-gpu==2.5.1踩坑日记

环境是wsl的conda环境。
使用conda安装paddlepaddle-gpu:

conda install paddlepaddle-gpu==2.5.1 cudatoolkit=11.7 -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/Paddle/ -c conda-forge

等待安装...

报错处理:

(1)PreconditionNotMetError: Cannot load cudnn shared library. Cannot invoke method cudnnGetVersion.

>>> paddle.utils.run_check() Running verify PaddlePaddle program ... Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/livingbody/miniconda3/lib/python3.9/site-packages/paddle/utils/install_check.py", line 269, in run_check _run_static_single(use_cuda, use_xpu, use_npu) File "/home/livingbody/miniconda3/lib/python3.9/site-packages/paddle/utils/install_check.py", line 173, in _run_static_single exe.run(startup_prog) File "/home/livingbody/miniconda3/lib/python3.9/site-packages/paddle/fluid/executor.py", line 1463, in run six.reraise(*sys.exc_info()) File "/home/livingbody/miniconda3/lib/python3.9/site-packages/six.py", line 703, in reraise raise value File "/home/livingbody/miniconda3/lib/python3.9/site-packages/paddle/fluid/executor.py", line 1450, in run res = self._run_impl(program=program, File "/home/livingbody/miniconda3/lib/python3.9/site-packages/paddle/fluid/executor.py", line 1661, in _run_impl return new_exe.run(scope, list(feed.keys()), fetch_list, File "/home/livingbody/miniconda3/lib/python3.9/site-packages/paddle/fluid/executor.py", line 631, in run tensors = self._new_exe.run(scope, feed_names, RuntimeError: In user code: File "<stdin>", line 1, in <module> File "/home/livingbody/miniconda3/lib/python3.9/site-packages/paddle/utils/install_check.py", line 269, in run_check _run_static_single(use_cuda, use_xpu, use_npu) File "/home/livingbody/miniconda3/lib/python3.9/site-packages/paddle/utils/install_check.py", line 159, in _run_static_single input, out, weight = _simple_network() File "/home/livingbody/miniconda3/lib/python3.9/site-packages/paddle/utils/install_check.py", line 33, in _simple_network weight = paddle.create_parameter( File "/home/livingbody/miniconda3/lib/python3.9/site-packages/paddle/fluid/layers/tensor.py", line 152, in create_parameter return helper.create_parameter(attr, shape, convert_dtype(dtype), is_bias, File "/home/livingbody/miniconda3/lib/python3.9/site-packages/paddle/fluid/layer_helper_base.py", line 381, in create_parameter self.startup_program.global_block().create_parameter( File "/home/livingbody/miniconda3/lib/python3.9/site-packages/paddle/fluid/framework.py", line 3965, in create_parameter initializer(param, self) File "/home/livingbody/miniconda3/lib/python3.9/site-packages/paddle/fluid/initializer.py", line 56, in __call__ return self.forward(param, block) File "/home/livingbody/miniconda3/lib/python3.9/site-packages/paddle/fluid/initializer.py", line 184, in forward op = block.append_op(type="fill_constant", File "/home/livingbody/miniconda3/lib/python3.9/site-packages/paddle/fluid/framework.py", line 4017, in append_op op = Operator( File "/home/livingbody/miniconda3/lib/python3.9/site-packages/paddle/fluid/framework.py", line 2858, in __init__ for frame in traceback.extract_stack(): PreconditionNotMetError: Cannot load cudnn shared library. Cannot invoke method cudnnGetVersion. [Hint: cudnn_d_handle should not be null.] (at /paddle/paddle/phi/backends/dynload/cudnn.cc:60) [operator < fill_constant > error]

解决办法: 根据命令所知,需要的cuda、cudnn都已经安装,出现这个问题是找不到对应的动态库,所以要针对性处理。

创建存放动态库的文件夹

mkdir /usr/local/cuda/lib64 -rf

拷贝动态库到lib

~/miniconda3/pkgs/cudatoolkit-11.7.0-hd8887f6_10/lib$ sudo cp * /usr/local/cuda/lib64 -rf

覆盖性拷贝,同手动安装cudnn操作

~/miniconda3/pkgs/cudnn-8.4.1.50-hed8a83a_0/lib$ sudo cp * /usr/local/cuda/lib64/ -rf

编辑 .bahsrc

vim ~/.bashrc

末尾添加

export LD_LIBRARY_PATH="/usr/local/cuda/lib64"

(2)The third-party dynamic library (libcuda.so) that Paddle depends on is not configured correctly.

>>> import paddle
>>> paddle.utils.run_check()
Running verify PaddlePaddle program ...
I1016 00:37:29.397162  5746 interpretercore.cc:237] New Executor is Running.
W1016 00:37:29.397517  5746 gpu_resources.cc:96] The GPU architecture in your current machine is Pascal, 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.
W1016 00:37:29.397544  5746 gpu_resources.cc:119] Please NOTE: device: 0, GPU Compute Capability: 6.1, Driver API Version: 12.2, Runtime API Version: 11.7
W1016 00:37:29.402364  5746 gpu_resources.cc:149] device: 0, cuDNN Version: 8.4.
W1016 00:37:30.560958  5746 dynamic_loader.cc:303] The third-party dynamic library (libcuda.so) that Paddle depends on is not configured correctly. (error code is libcuda.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;


--------------------------------------
C++ Traceback (most recent call last):
--------------------------------------
No stack trace in paddle, may be caused by external reasons.

----------------------
Error Message Summary:
----------------------
FatalError: `Segmentation fault` is detected by the operating system.
  [TimeInfo: *** Aborted at 1697387850 (unix time) try "date -d @1697387850" if you are using GNU date ***]
  [SignalInfo: *** SIGSEGV (@0x0) received by PID 5746 (TID 0x7f5359183440) from PID 0 ***]

Segmentation fault

原因:paddel没有找到libcuda.so标红)

解决:在~/.bashrc中加入环境变量

export LD_LIBRARY_PATH="/usr/lib/wsl/lib:$LD_LIBRARY_PATH"

vim ~/.bashrc

测试安装成功:

>>> import paddle
>>> paddle.utils.run_check()
Running verify PaddlePaddle program ...
I1016 00:52:10.319463  5810 interpretercore.cc:237] New Executor is Running.
W1016 00:52:10.319797  5810 gpu_resources.cc:96] The GPU architecture in your current machine is Pascal, 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.
W1016 00:52:10.319828  5810 gpu_resources.cc:119] Please NOTE: device: 0, GPU Compute Capability: 6.1, Driver API Version: 12.2, Runtime API Version: 11.7
W1016 00:52:10.326299  5810 gpu_resources.cc:149] device: 0, cuDNN Version: 8.4.
I1016 00:52:12.458793  5810 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.

主要参考:

尝鲜Ubuntu22.04 下 PaddlePaddle-GPU 安装踩坑记 - 飞桨AI Studio星河社区 (baidu.com)

wsl安装英伟达驱动踩坑 - shenhshihao - 博客园 (cnblogs.com)

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.hqwc.cn/news/140530.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

linux 防火墙介绍以及iptables的使用

背景介绍 在前几天&#xff0c;于工发现我们内部的150服务器7554端口被外网访问了。该应用提供着内部的摄像头资源。为了避免被入侵&#xff0c;于是我添加了一些iptables规则&#xff0c;防止外网的访问。 解决方式 解决方式有两种&#xff1a; 关闭公司公网路由器对150服务…

【QT】常用控件——按钮组

继承Widget PushButton 设置图片&#xff0c;先导入图片资源&#xff0c;见&#xff1a;【QT】资源文件导入_复制其他项目中的文件到qt项目中_StudyWinter的博客-CSDN博客 在布局中添加图片 调整尺寸 toolButton 显示图片、文本 显示图片&#xff08;图片和文字都有时&#…

模型预测控制(MPC)中考虑约束中的不确定性(Matlab代码实现)

&#x1f4a5;&#x1f4a5;&#x1f49e;&#x1f49e;欢迎来到本博客❤️❤️&#x1f4a5;&#x1f4a5; &#x1f3c6;博主优势&#xff1a;&#x1f31e;&#x1f31e;&#x1f31e;博客内容尽量做到思维缜密&#xff0c;逻辑清晰&#xff0c;为了方便读者。 ⛳️座右铭&a…

【数之道 05】走进神经网络模型、机器学习的世界

神经网络 神经网络&#xff08;ANN&#xff09;神经网络基础激活函数 神经网络如何通过训练提高预测准确度逆向参数调整法 &#xff08;BackPropagation&#xff09;梯度下降法链式法则增加一层 b站视频连接 神经网络&#xff08;ANN&#xff09; 最简单的例子&#xff0c;视…

jni:as 进行 JNI / NDK 开发:初步配置及使用

AndroidStudio 进行 JNI / NDK 开发&#xff1a;初步配置及使用-CSDN博客版权声明&#xff1a; 本文为博主原创文章&#xff0c;转载请标明出处。AndroidStudio 进行 JNI / NDK 开发&#xff1a;初步配置及使用-CSDN博客 一、相关名词解释 JNI&#xff1a;java native interf…

环境变量【使用命令行参数引出环境变量】

前提&#xff1a;命令行参数 大家在写C/C程序的时候肯定见过下面这种情况&#xff1a; main函数里面携带的参数&#xff0c;平常写代码过程中很少用到这两个参数&#xff0c;接下来我们就研究一下 我们也不知道 指针数组argv里面到底保存的是什么&#xff0c;也不知道这个a…

Python基础--PART1

最近闲来无事&#xff0c;学习使用Python也有好几年了&#xff0c;一直没有系统的总结&#xff0c;现在有时间就写一写个人的一些拙见。 PART1. 核心语法(基础语法) 1. 变量 1.1 变量的定义 ​ 变量就是可变的量&#xff0c;对于一些有可能会经常变化的数据&#xff0c;我们…

上海亚商投顾:沪指震荡调整 转基因概念股逆势大涨

上海亚商投顾前言&#xff1a;无惧大盘涨跌&#xff0c;解密龙虎榜资金&#xff0c;跟踪一线游资和机构资金动向&#xff0c;识别短期热点和强势个股。 一.市场情绪 沪指昨日低开低走&#xff0c;深成指、创业板指均跌超1%&#xff0c;双双创出年内新低。转基因概念股逆势大涨…

风电机浪涌保护器的防雷作用和意义

风电是一种利用风能转化为电能的清洁新能源&#xff0c;具有节约资源、减少污染、降低碳排放等优点。随着风电技术的发展和应用&#xff0c;风电场的规模和数量也不断增加&#xff0c;为人类提供了可持续的电力供应。然而&#xff0c;风电场也面临着一些挑战和风险&#xff0c;…

【NPM】vuex 数据持久化库 vuex-persistedstate

在 GitHub 上找到&#xff1a;vuex-persistedstate。 安装 npm install --save vuex-persistedstate使用 import { createStore } from "vuex"; import createPersistedState from "vuex-persistedstate";const store createStore({// ...plugins: [cr…

实验室超声波清洗机的作用

实验室超声波清洗机的作用是什么&#xff1f;顾名思义&#xff0c;其主要作用是清洗。超声波清洗机是实验室中必不可少的清洗装置&#xff0c;利用超声波在液体中的空化效应&#xff0c;产生空化气泡&#xff0c;由于正负压的作用下&#xff0c;空化气泡会在短时间内生成并爆破…

利用爬虫采集音频信息完整代码示例

以下是一个使用WWW::RobotRules和duoip.cn/get_proxy的Perl下载器程序&#xff1a; #!/usr/bin/perluse strict; use warnings; use WWW::RobotRules; use LWP::UserAgent; use HTTP::Request; use HTTP::Response;# 创建一个UserAgent对象 my $ua LWP::UserAgent->new();#…