一、驱动安装
1、查看服务器linux版本及GPU信息:
cat /proc/version
Linux version 5.4.0-84-generic (buildd@lcy01-amd64-007) (gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)) #94~18.04.1-Ubuntu SMP Thu Aug 26 23:17:46 UTC 2021
lspci | grep -i nvidia
43:00.0 VGA compatible controller: NVIDIA Corporation Device 24b0 (rev a1)
43:00.1 Audio device: NVIDIA Corporation Device 228b (rev a1)
2、Nvidia显卡驱动:
wget -c url
nvidia-smi
NVIDIA-SMI 510.47.03 Driver Version: 510.47.03 CUDA Version: 11.6
NVIDIA RTX A4000
二、安装anaconda
1、查看体系架构
uname -a
Linux gpu01-beiserver 5.4.0-84-generic #94~18.04.1-Ubuntu SMP Thu Aug 26 23:17:46 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
arch
x86_64
cat /proc/cpuinfo
2、下载安装包
wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-2022.05-Linux-x86_64.sh --no-check-certificate
3、安装anaconda
bash Anaconda3-2022.05-Linux-x86_64.sh
source ~/.bashrc
conda --version
conda 4.12.0
三、创建虚拟环境
1、换源
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/bioconda/
# 切换回默认源
conda config --remove-key channels
# 若 offline mode 为 false 导致创建失败
conda config --set offline true
2、创建环境
conda create -n pt_gpu python=3.9
3、进入环境
conda activate pt_gpu