码农知识堂 - 1000bd
  •   Python
  •   PHP
  •   JS/TS
  •   JAVA
  •   C/C++
  •   C#
  •   GO
  •   Kotlin
  •   Swift
  • 【环境】Linux下Anaconda/ Miniconda安装+百度Paddle环境搭建+Cudnn(3090显卡+CUDA11.8+cudnn8.6.0)


    清华源帮助链接:https://mirror.tuna.tsinghua.edu.cn/help/anaconda/
    下载链接:https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/

    其他深度学习环境相关博文:【stable-diffusion】4090显卡下dreambooth、lora、sd模型微调的GUI环境安装(cuda驱动、pytorch、xformer)

    文章目录

    • 一、anaconda / miniconda 安装
      • 1.1 下载到linux
      • 1.2 安装过程
        • `空格`跳过 + yes
        • 选择安装位置(可默认)
        • 初始化 conda + yes
      • 1.3 安装完成+切换国内源
        • conda 添加国内源
        • pip添加国内的源
    • 二、安装 cudnn (任何框架都需要)
        • 下载cudnn
          • 在服务器解压
          • 复制到系统库
    • 三、 深度学习框架paddle安装
      • 官方安装说明
      • paddle选择合适的版本
        • 验证安装,
        • 如果没正确安装cudnn会报错

    一、anaconda / miniconda 安装

    1.1 下载到linux

    如果wget命令为安装,直接windows下载后复制过去

    wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-py38_4.9.2-Linux-x86_64.sh
    
    • 1

    下载界面
    在这里插入图片描述

    1.2 安装过程

    sh Miniconda3-py38_4.9.2-Linux-x86_64.sh 
    
    • 1

    在这里插入图片描述

    空格跳过 + yes

    在这里插入图片描述
    同意协议
    输入yes
    在这里插入图片描述

    选择安装位置(可默认)

    在这里插入图片描述

    初始化 conda + yes

    否则需要自己输入环境变量
    在这里插入图片描述
    命令会自动写入 ~/.bashrc 否则需要手动添加,
    在这里插入图片描述

    1.3 安装完成+切换国内源

    查看conda命令是否能用

    conda
    
    • 1

    在这里插入图片描述

    conda 添加国内源

    
    conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
    conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
    conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
    conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch
    
    conda config --set show_channel_urls yes
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7

    pip添加国内的源

    添加百度的链接

    pip config set global.index-url  https://mirror.baidu.com/pypi/simple
    pip config set global.trusted-host mirror.baidu.com
    
    • 1
    • 2

    其他国内

    阿里云镜像源 
    https://mirrors.aliyun.com/pypi/simple/
    清华大学镜像源 
    https://pypi.tuna.tsinghua.edu.cn/simple/
    #  腾讯
    pip config set global.index-url http://mirrors.cloud.tencent.com/pypi/simple
    pip config set global.trusted-host mirrors.cloud.tencent.com
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7

    二、安装 cudnn (任何框架都需要)

    3090TI+ cuda11.8 + cudnn 8.6.0+
    cuda驱动+CUDA Toolkit 已经由运维安装好了,具体可以搜索其他教程.

    在这里插入图片描述

    下载cudnn

    下载:https://developer.nvidia.com/cudnn
    官方指南: https://docs.nvidia.com/deeplearning/cudnn/install-guide/
    下载后传到服务器,也可直接下载
    在这里插入图片描述

    在服务器解压
     tar -xvf cudnn-linux-x86_64-8.6.0.163_cuda11-archive.tar.xz
    
    • 1

    解压过程截图
    在这里插入图片描述

    复制到系统库
    cd cudnn-linux-x86_64-8.6.0.163_cuda11-archive
    sudo cp include/cudnn*.h /usr/local/cuda/include 
    sudo cp -P lib/libcudnn* /usr/local/cuda/lib64 
    sudo chmod a+r /usr/local/cuda/include/cudnn*.h /usr/local/cuda/lib64/libcudnn*
    
    • 1
    • 2
    • 3
    • 4

    三、 深度学习框架paddle安装

    官方文档:https://www.paddlepaddle.org.cn/install/quickdocurl=/documentation/docs/zh/install/pip/linux-pip.html

    官方安装说明

    在这里插入图片描述

    paddle选择合适的版本

    在这里插入图片描述

    python3 -m pip install paddlepaddle-gpu==2.5.1 -i https://mirror.baidu.com/pypi/simple
    
    • 1

    验证安装,

    直接在bash上输入

    python 
    import paddle
    paddle.utils.run_check()
    
    
    • 1
    • 2
    • 3
    • 4

    在这里插入图片描述

    如果没正确安装cudnn会报错

    W1023 11:32:40.486835 13508 gpu_resources.cc:119] Please NOTE: device:
    0, GPU Compute Capability: 8.6, Driver API Version: 11.8, Runtime API
    Version: 11.8 W1023 11:32:40.487215 13508 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;

    在这里插入图片描述

  • 相关阅读:
    PPTist在线编辑、播放幻灯片
    javaScript关于闭包的理解
    linux驱动程序之poll机制
    CMake 安装升级更高版本
    Flink CDC 菜鸟教程 -环境篇
    231022|redis_demo
    程序员注意!35岁前,别靠死工资过日子
    【Android 逆向】ART 函数抽取加壳 ③ ( 禁用 dex2oat 操作 HOOK 点介绍 | 集成 InLineHook )
    ES6——知识点记录
    1505_TC275参考手册阅读笔记_调试系统
  • 原文地址:https://blog.csdn.net/imwaters/article/details/133994891
  • 最新文章
  • 攻防演习之三天拿下官网站群
    数据安全治理学习——前期安全规划和安全管理体系建设
    企业安全 | 企业内一次钓鱼演练准备过程
    内网渗透测试 | Kerberos协议及其部分攻击手法
    0day的产生 | 不懂代码的"代码审计"
    安装scrcpy-client模块av模块异常,环境问题解决方案
    leetcode hot100【LeetCode 279. 完全平方数】java实现
    OpenWrt下安装Mosquitto
    AnatoMask论文汇总
    【AI日记】24.11.01 LangChain、openai api和github copilot
  • 热门文章
  • 十款代码表白小特效 一个比一个浪漫 赶紧收藏起来吧!!!
    奉劝各位学弟学妹们,该打造你的技术影响力了!
    五年了,我在 CSDN 的两个一百万。
    Java俄罗斯方块,老程序员花了一个周末,连接中学年代!
    面试官都震惊,你这网络基础可以啊!
    你真的会用百度吗?我不信 — 那些不为人知的搜索引擎语法
    心情不好的时候,用 Python 画棵樱花树送给自己吧
    通宵一晚做出来的一款类似CS的第一人称射击游戏Demo!原来做游戏也不是很难,连憨憨学妹都学会了!
    13 万字 C 语言从入门到精通保姆级教程2021 年版
    10行代码集2000张美女图,Python爬虫120例,再上征途
Copyright © 2022 侵权请联系2656653265@qq.com    京ICP备2022015340号-1
正则表达式工具 cron表达式工具 密码生成工具

京公网安备 11010502049817号