前提,你的debain12系统已经安装好cuda和cudnn以及NVIDIA驱动程序,并且测试过已经可以调用GPU显卡算力
一、安装nvidia-docker
1.添加 NVIDIA 官⽅ Docker APT 仓库的 GPG 密钥:
curl -s -L https://nvidia.github.io/nvidia-container-runtime/gpgkey | sudo apt-key add -
2.添加 NVIDIA 官⽅ Docker APT 仓库:
distribution=$(. /etc/os-release;echo I D ID IDVERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-container-runtime/debian10/nvidia-container-runtime.list\| sudo tee /etc/apt/sources.list.d/nvidia-container-runtime.list
3.更新 APT 仓库并安装 nvidia-docker2:
sudo apt-get update && sudo apt-get install nvidia-container-runtime
4.重启docker
sudo systemctl restart docker
5.运行命令
docker run -d --name experience
-p 8508:8508 -p 8509:8509
-v /root/api/panoramic_recognition_experience_api.py:/mmdetection/panoramic_recognition_experience_api.py
-v /root/api/periapical_recognition_experience_api.py:/mmdetection/periapical_recognition_experience_api.py
-v /root/api/config.py:/mmdetection/config.py
-v /root/api/Dental_model:/mmdetection/Dental_model
-v /root/api/experience:/mmdetection/experience
--gpus all experience