[Environment] Anaconda/Miniconda installation under Linux + Baidu Paddle environment construction + Cudnn (3090 graphics card + CUDA11.8 + cudnn8.6.0)

Tsinghua source help link:https://mirror.tuna.tsinghua.edu.cn/help/anaconda/
Download link:< /span>https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/

Other deep learning环境相关博文:[stable-diffusion] GUI environment installation for dreambooth, lora, and sd model fine-tuning under 4090 graphics card (cuda driver, pytorch, xformer)

1. anaconda/miniconda installation

1.1 Download to linux

If the wget command is for installation, directly download it in windows and copy it.

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

Download interface
Insert image description here

1.2 Installation process

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

Insert image description here

空格skip + yes

Insert image description here
Agree to the agreement
Enter yes
Insert image description here

Select installation location (default available)

Insert image description here

initialize conda + yes

Otherwise you need to enter the environment variable yourself
Insert image description here
The command will be written automatically ~/.bashrc Otherwise you need to add it manually,
Insert image description here

1.3 Installation completed + switch to domestic source

Check whether the conda command can be used

conda

Insert image description here

conda adds domestic sources


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 adds domestic sources

Add Baidu link

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

Other domestic

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

2. Install cudnn (required for any framework)

3090TI+ cuda11.8 + cudnn 8.6.0+
The cuda driver + CUDA Toolkit has been installed by operation and maintenance. You can search for other details Tutorial.

Insert image description here

downloadcudnn

Download:https://developer.nvidia.com/cudnn
官方指南: https:// docs.nvidia.com/deeplearning/cudnn/install-guide/
After downloading, transfer it to the server, or you can download it directly
Insert image description here

Unzip on server
 tar -xvf cudnn-linux-x86_64-8.6.0.163_cuda11-archive.tar.xz

Screenshot of the decompression process
Insert image description here

Copy to system library
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*

3. Deep learning framework paddle installation

Official documentation:https://www.paddlepaddle.org.cn/install/quickdocurl=/documentation/docs/zh/install/pip/linux-pip.html< /span>

Official installation instructions

Insert image description here

paddle choose the right version

Insert image description here

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

Verify installation,

Enter directly on bash

python 
import paddle
paddle.utils.run_check()

Insert image description here

If cudnn is not installed correctly, an error will be reported.

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;

Insert image description here

Guess you like

Origin blog.csdn.net/imwaters/article/details/133994891