WSL Ubuntu 22.04.2 LTS 安装paddle踩坑日记

使用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)(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.mzph.cn/news/106398.shtml

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

相关文章

原子性操作

原子性操作是指一个操作在执行过程中不会被中断&#xff0c;要么全部执行成功&#xff0c;要么全部不执行&#xff0c;不会出现部分执行的情况。原子性操作对于多线程并发编程至关重要&#xff0c;因为它可以确保多个线程之间不会出现竞态条件或数据不一致性。 在计算机科学中…

205、使用消息队列实现 RPC(远程过程调用)模型的 服务器端 和 客户端

目录 ★ RPC模型&#xff08;远程过程调用通信模型&#xff09;▲ 完整过程&#xff1a;代码演示总体流程解释&#xff1a;ConstantUtil 常量工具类ConnectionUtil RabbitMQ连接工具类Server 服务端Client 客户端测试结果服务端客户端 完整代码ConstantUtil 常量工具类Connecti…

AMD AFMF不但能用在游戏,也适用于视频

近期AMD发布了AMD Software Adrenalin Edition预览版驱动程序&#xff0c;增加了对平滑移动帧&#xff08;AMD Fluid Motion Frames&#xff0c;AFMF&#xff09;功能的支持&#xff0c;也就是AMD的“帧生成”技术&#xff0c;与DLSS 3类似&#xff0c;作为FidelityFX Super Re…

137. 只出现一次的数字 II

题目 题解 方法一 直接用 哈希表出现 3 次则从 哈希表移除&#xff0c;最后剩下的就是结果 class Solution { public int singleNumber(int[] nums) { Map<Integer, Integer> map new HashMap<>(); for (int num : nums) { Integer i…

React添加文件路径时使用@符号代替src目录(非creae-react-app)

在其它项目中看到的可以用符号来代替src目录&#xff0c;那么在自己的react项目中也必须得尝试一下。本人的项目不是通过create-react-app脚手架来创建的&#xff0c;无法使用craco或者的方案来实现。 jsconfig.json配置 用的vscode进行开发&#xff0c;查看项目当中是否存在js…

css 如何让元素内部文本和外部文本 一块显示省略号

实际上还是有这样的需求的 <div class"container"><span>啊啊啊啊啊啊啊啊</span>你好啊撒撒啊撒撒撒撒啊撒撒撒撒撒说</div>还是有这样的需求的哦。 div.container {width: 200px;white-space: nowrap;text-overflow: ellipsis;overflow:…

【AI视野·今日Robot 机器人论文速览 第五十期】Mon, 9 Oct 2023

AI视野今日CS.Robotics 机器人学论文速览 Mon, 9 Oct 2023 Totally 25 papers &#x1f449;上期速览✈更多精彩请移步主页 Daily Robotics Papers Learning to Grasp: from Somewhere to Anywhere Authors Fran ois H l non, Johann Huber, Fa z Ben Amar, St phane Doncieux…

Linux中的nmap命令

nmap&#xff08;Network Mapper&#xff09;是一个开源的网络扫描和安全审计工具&#xff0c;它被设计为用于发现设备在网络上运行并确定其开放的网络端口。该工具常用于网络安全实践和网络管理任务&#xff0c;例如检查开放的网络端口&#xff0c;检测网络服务及其版本&#…

代理技术的崭新纪元:Socks5代理和代理IP的多重应用

在当今数字化的时代&#xff0c;网络工程师成为了技术的舵手&#xff0c;引领着企业应对跨界电商、爬虫、出海业务、网络安全和游戏等各种挑战。而Socks5代理和代理IP技术&#xff0c;则如同一双翅膀&#xff0c;为网络工程师提供了多重应用的动力。本文将深入探讨这两项代理技…

ubuntu 18.04 网口连接镭神C16 雷达环境配置

前面的参看转载 &#xff0c;最后两步重启网络配置 较新的 Ubuntu 版本Ubuntu 18.04 及更高版本中重新启动网络服务的命令&#xff1a; 重启 NetworkManager $&#xff1a;sudo systemctl restart NetworkManager重启 systemd-networkd $:sudo systemctl restart systemd-n…

【Java 进阶篇】JavaScript DOM 编程:理解文档对象模型

在 web 开发中&#xff0c;DOM&#xff08;文档对象模型&#xff09;是一个重要的概念。DOM 是一种将网页文档表示为树状结构的方式&#xff0c;允许开发者使用 JavaScript 来访问和操作网页的内容。本篇博客将详细介绍 DOM&#xff0c;包括什么是 DOM、如何访问 DOM 元素、如何…

ESP8285 RTOS SDK OTA

一、官方资源说明 官方指南&#xff1a;空中升级 (OTA) - ESP32 - — ESP-IDF 编程指南 v4.3.6 文档&#xff0c;虽然是正对ESP32的&#xff0c;但是原理是一样的。 官方参考例程&#xff1a;esp-idf\ESP8266_RTOS_SDK\examples\system\ota\&#xff0c;其中包含两个例程&…

Pulsar-Schema 数据结构

Pulsar-Schema 数据结构 为什么需要使用Schema&#xff1f;怎么使用&#xff1f;生产者端消费者端使用用例Schema定义Schema类型基本类型复合类型KeyValue schemaStruct schemaPulsar提供了以下方法来使用结构模式staticgeneric 自动SchemaSchema验证实施Schema演化Schema版本控…

生物标志物发现中的无偏数据分析策略

目录 0. 导论基本概念 1. 生物标志物发现的注意事项2. 数据预处理2.1 高质量原始数据和缺失值处理2.2 数据过滤2.3 数据归一化 3. 数据质量评估3.1 混杂因素3.2 类别分离3.3 功效分析3.4 批次效应 4. 生物标志物发现4.1 策略4.2 数据分析工具4.3 模型优化策略 0. 导论 组学技术…

【具身智能模型1】PaLM-E: An Embodied Multimodal Language Model

论文标题&#xff1a;PaLM-E: An Embodied Multimodal Language Model 论文作者&#xff1a;Danny Driess, Fei Xia, Mehdi S. M. Sajjadi, Corey Lynch, Aakanksha Chowdhery, Brian Ichter, Ayzaan Wahid, Jonathan Tompson, Quan Vuong, Tianhe Yu, Wenlong Huang, Yevgen C…

10.2手动推导linux中file, cdev, inode之间的关系

是时候可以手动推导一下linux里面基类父类和子类的关系了 代码放最后把 简单说明版 详细流程 第一步注册驱动 cdev结构体能看做是一个基类,那么链表里面都是字符设备驱动的cdev连载一起,啥串口,lcd的,通过cdev->list_head连接 那cdev结构体里有主次设备号 第一步 使用r…

SwiftFormer:基于Transformer的高效加性注意力用于实时移动视觉应用的模型

文章目录 摘要1、简介2、相关研究3、方法3.1、注意力模块概述3.2、高效的加性注意力3.3、SwiftFormer 架构4、实验4.1、实现细节4.2、基线比较4.3、图像分类4.4、目标检测和实例分割4.5、语义分割5、结论6、补充材料A、SwiftFormer的架构细节B、其他实现细节C、额外消融D、COCO…

VS2022新建项目时没有ASP.NET Web应用程序 (.NET Framework)

问题&#xff1a;如图&#xff0c;VS2022新建项目时没有“ASP.NET Web应用程序 &#xff08;.NET Framework&#xff09;”的选项解决方法&#xff1a;点击跳转至修改安装选项界面选择安装该项即可&#xff1a;

SpringMVC简介

SpringMVC概述 SpringMVC是一个基于Spring开发的MVC轻量级框架&#xff0c;Spring3.0后发布的组件&#xff0c;SpringMVC可以和Spring无缝整合&#xff0c;使用DispatcherServlet作为前端控制器&#xff0c;且内部提供了处理映射器、处理适配器、视图解析器等组件&#xff0c;…

C# 往多线程传递安全参数的方法

在C#构造一个线程时&#xff0c;要向其传递一个函数&#xff0c;这个函数可以试简单的无参函数&#xff0c;也可以是参数为Object类型的函数&#xff0c;但是由于参数类型为Object&#xff0c;因此编译器无法实行类型检查&#xff0c;看下面的例子&#xff1a; class Program{…