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

news2024/11/27 18:30:27

环境是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.coloradmin.cn/o/1096777.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

虹科分享 | 2023Gartner®终端安全发展规律周期:AMTD引领未来

导语&#xff1a;在2023年Gartner终端安全发展规律周期中&#xff0c;自动移动目标防御&#xff08;AMTD&#xff09;崭露头角&#xff0c;虹科Morphisec被誉为AMTD领域的样本供应商。该周期呈现出终端安全领域的最新创新&#xff0c;旨在帮助安全领导者更好地规划、采纳和实施…

我与COSCon的故事【时光的故事】

曾经 2019年的时候&#xff0c;我还在日本读研究生&#xff0c;做一些物联网 (Internet of Things, IoT) 网络中的底层P2P (Peer to Peer) 通讯仿真模拟。这个方向是新来的Nguyen老师的新方向&#xff0c;它跟计算机强相关&#xff0c;但是很小众&#xff0c;实验室里也没有前辈…

汽车数据安全事件频发,用户如何保护隐私信息?

面对日益增多的汽车数据安全事件&#xff0c;对于广大用户来说&#xff0c;有没有既廉价又安全的解决方案&#xff1f; 频发的汽车数据安全事件 随着汽车“新四化”大潮的来临&#xff0c;汽车用户从电动化、网联化、智能化、共享化中切实体验到了越来越多的便利&#xff0c;各…

spark stream入门案例:netcat准实时处理wordCount(scala 编程)

目录 案例需求 代码 结果 解析 案例需求&#xff1a; 使用netcat工具向9999端口不断的发送数据&#xff0c;通过SparkStreaming读取端口数据并统计不同单词出现的次数 -- 1. Spark从socket中获取数据&#xff1a;一行一行的获取 -- 2. Driver程序执行时&#xff0c…

用CRM系统实现销售目标的步骤

每个销售都要有自己的目标计划&#xff0c;在定销售计划时要把握方面问题&#xff0c;一个严格执行&#xff0c;另一个是可控。明确销售目标后&#xff0c;合理分配时间&#xff0c;运用销售基本工作方法严格把控销售进度。那我们该如何用CRM销售管理系统实现销售目标&#xff…

js面向对象(工厂模式、构造函数模式、原型模式、原型和原型链)

1.封装 2. 工厂模式 function createCar(color, style){let obj new Object();obj.color color;obj.style style;return obj;}var car1 createCar("red","car1");var car2 createCar("green","car2"); 3. 构造函数模式 // 创建…

Mybatis-Plus3.x的使用

MyBatis-Plus&#xff08;简称 MP&#xff09;是一个 MyBatis 的增强工具&#xff0c;在 MyBatis 的基础上只做增强不做改变&#xff0c;为 简化开发、提高效率而生。 一、引入 创建步骤&#xff1a; 1.创建Spring Boot工程 2.添加依赖 引入 Spring Boot Starter 父工程&am…

小程序开发平台源码系统+内容付费小程序功能 带完整的搭建教程

来喽来喽&#xff01;今天来给大家分享的是一款小程序开发平台源码系统&#xff0c;这款小程序开发平台的功能很多&#xff0c;本文主要给大家介绍一下内容付费小程序功能。以下是部分核心代码&#xff1a; 系统主要功能如下&#xff1a; 知识付费系统开发的优势。一是提高获取…

《永远的爱犬》The forever dog英文版

爱狗人士必读经典&#xff0c;主页左下角有英文版下载方式 手机可阅读

C++标准模板(STL)- 类型支持 (数值极限,traps,tinyness_before)

数值极限 std::numeric_limits 定义于头文件 <limits> 定义于头文件 <limits> template< class T > class numeric_limits; numeric_limits 类模板提供查询各种算术类型属性的标准化方式&#xff08;例如 int 类型的最大可能值是 std::numeric_limits&l…

ESD静电电压监控系统的作用是什么

ESD静电电压监控系统的作用是实时监测生产环境中的静电电压&#xff0c;及时检测和预防ESD静电电压过高的情况&#xff0c;保护设备和产品的质量&#xff0c;确保生产过程的安全和稳定。 具体来说&#xff0c;ESD静电电压监控系统可以实现以下功能&#xff1a; 实时监测静电电压…

华为云应用中间件DCS系列—Redis实现(社交APP)实时评论

云服务、API、SDK&#xff0c;调试&#xff0c;查看&#xff0c;我都行 阅读短文您可以学习到&#xff1a;应用中间件系列之Redis实现&#xff08;社交APP&#xff09;实时评论 1 什么是DEVKIT 华为云开发者插件&#xff08;Huawei Cloud Toolkit&#xff09;&#xff0…

[科研琐事] 安装服务器的二三事

1. 机柜参数 宽度&#xff1a;一般机器都是符合的&#xff1b; 深度&#xff1a;对应服务器最长的那个边&#xff1b; 厚度&#xff08;高度&#xff09;&#xff1a;1/2/3/4U&#xff0c;就是机柜上写的刻度数字&#xff0c;1U1.75英寸。 1U4.45cm 2U4.45cm * 2 3U4.45cm * …

揭秘OLED透明拼接屏的参数规格:分辨率、亮度与透明度全解析

作为一种新型的显示技术&#xff0c;OLED透明拼接屏在市场中正在迅速崭露头角&#xff0c;有很多知名品牌厂家能设计、开发、生产高品质的显示产品。 如尼伽、起鸿、康视界、LG、YCTIMES、腾裕等&#xff0c;这些品牌在显示技术领域拥有丰富的经验和声誉&#xff0c;以其卓越的…

聚观早报 | 特斯拉发布赛博啤酒套装;小米汽车售价曝光

【聚观365】10月16日消息 特斯拉发布赛博啤酒套装 小米汽车售价曝光 新款Model Y 国内已开启交付 苹果将推出新款 iPad mini / Air 保时捷销量中国区大跌 特斯拉发布赛博啤酒套装 特斯拉在美国市场推出CyberBeerCyberStein限量套装&#xff0c;售价150美元&#xff08;约…

USB PD3.1

目前我们大多数Type-C接口仍然采用的是PD3.0快充协议&#xff0c;按当前用户的使用场景来看功率也完全够用&#xff0c;那么PD3.1快充协议是什么&#xff1f;USB PD3.1到底有没有必要&#xff1f; 不妨我们先了解一下PD3.1: 5月25日&#xff0c;USB-IF协会推出了USB Type-C线…

CSS Display(显示) 与 Visibility(可见性)

display属性设置一个元素应如何显示&#xff0c;visibility属性指定一个元素应可见还是隐藏。 隐藏元素 - display:none或visibility:hidden 隐藏一个元素可以通过把display属性设置为"none"&#xff0c;或把visibility属性设置为"hidden"。但是请注意&a…

Linux下内存检测利器Valgrind之Memcheck工具详解

目录 1、Valgrind简介 1.1、Memcheck工具 1.2、Callgrind工具 1.3、Cachegrind工具 1.4、Helgrind工具 1.5、Massif工具 2、如何使用Memcheck 2.1、启动Memcheck 2.2、输出消息解释 3、使用Memcheck检测内存问题实例 4、Valgrind和Memcheck其他命令选项 5、最后 VC…

如何处理前端错误和异常?

聚沙成塔每天进步一点点 ⭐ 专栏简介 前端入门之旅&#xff1a;探索Web开发的奇妙世界 欢迎来到前端入门之旅&#xff01;感兴趣的可以订阅本专栏哦&#xff01;这个专栏是为那些对Web开发感兴趣、刚刚踏入前端领域的朋友们量身打造的。无论你是完全的新手还是有一些基础的开发…

【QT开发笔记-基础篇】| 第四章 事件QEvent | 4.6 定时器事件

本章要实现的整体效果如下&#xff1a; QT 中使用定时器&#xff0c;有两种方式&#xff1a; 定时器类&#xff1a;QTimer定时器事件&#xff1a;QEvent::Timer&#xff0c;对应的子类是 QTimerEvent 本节通过一个案例&#xff0c;同时讲解这两种方式 案例&#xff1a;当点击…