【环境】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

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

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

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

1.2 安装过程

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

在这里插入图片描述

空格跳过 + yes

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

选择安装位置(可默认)

在这里插入图片描述

初始化 conda + yes

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

1.3 安装完成+切换国内源

查看conda命令是否能用

conda

在这里插入图片描述

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

pip添加国内的源

添加百度的链接

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

其他国内

阿里云镜像源 
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

二、安装 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

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

复制到系统库
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*

三、 深度学习框架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

验证安装,

直接在bash上输入

python 
import paddle
paddle.utils.run_check()

在这里插入图片描述

如果没正确安装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;

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/imwaters/article/details/133994891