赞
踩
sudo apt update
sudo apt install vim git proxychains openssh-server curl build-essential python3 -y
wget https://developer.download.nvidia.com/compute/cuda/12.2.0/local_installers/cuda_12.2.0_535.54.03_linux.run
chmod +x cuda_12.2.0_535.54.03_linux.run
sudo sh cuda_12.2.0_535.54.03_linux.run
# 根据提示添加环境变量在文件末尾
gedit ~/.bashrc
export PATH=$PATH:/usr/local/cuda-12.2/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-12.2/lib64
nvcc -V
# 需要注册账号登录
# 下载:https://developer.nvidia.com/downloads/compute/cudnn/secure/8.9.7/local_installers/12.x/cudnn-linux-x86_64-8.9.7.29_cuda12-archive.tar.xz/
tar -xvf cudnn-linux-x86_64-8.9.7.29_cuda12-archive.tar.xz
sudo cp cudnn-linux-x86_64-8.9.7.29_cuda12-archive/include/cudnn*.hh /usr/local/cuda/include
sudo cp cudnn-linux-x86_64-8.9.7.29_cuda12-archive/include/cudnn*.h /usr/local/cuda/include
sudo cp -P cudnn-linux-x86_64-8.9.7.29_cuda12-archive/lib/libcudnn* /usr/local/cuda/lib64
sudo chmod a+r /usr/local/cuda/include/cudnn*.h /usr/local/cuda/lib64/libcudnn*
cat /usr/local/cuda/include/cudnn_version.h | grep CUDNN_MAJOR -A 2
./Miniconda3-py310_24.1.2-0-Linux-x86_64.sh
# 修改conda镜像源
gedit ~/.condarc
# https://mirrors.tuna.tsinghua.edu.cn/help/anaconda/
source ~/.bashrc
# 修改python镜像源
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
conda clean -i
# 里面下载下面的文件 # 网址:https://download.docker.com/linux/ubuntu/dists/focal/pool/stable/amd64/ sudo dpkg -i containerd.io_1.6.31-1_amd64.deb sudo dpkg -i docker-ce-cli_26.1.0-1~ubuntu.20.04~focal_amd64.deb sudo dpkg -i docker-ce_26.1.0-1~ubuntu.20.04~focal_amd64.deb sudo dpkg -i docker-compose-plugin_2.26.1-1~ubuntu.20.04~focal_amd64.deb sudo dpkg -i docker-buildx-plugin_0.14.0-1~ubuntu.20.04~focal_amd64.deb # 修改docker镜像源 # 下面的地址需要自己申请:https://cr.console.aliyun.com/cn-hangzhou/instances/mirrors sudo mkdir -p /etc/docker sudo tee /etc/docker/daemon.json <<-'EOF' { "registry-mirrors": ["https://xxxx.mirror.aliyuncs.com"] } EOF sudo systemctl daemon-reload sudo systemctl restart docker
sudo curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg && curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
sudo sed -i -e '/experimental/ s/^#//g' /etc/apt/sources.list.d/nvidia-container-toolkit.list
sudo apt-get update
sudo apt-get install -y nvidia-container-toolkit
sudo apt-get install -y nvidia-docker2
sudo systemctl restart docker
sudo docker run --rm --gpus all nvidia/cuda:12.2.0-base-ubuntu22.04 nvidia-smi
sudo docker pull ultralytics/ultralytics
# Run with all GPUs
sudo docker run -it --ipc=host --gpus all ultralytics/ultralytics
# 具体网址:`https://docs.ultralytics.com/zh/guides/docker-quickstart/`
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。