docker中调用GPU算力(debain12系统)

前提,你的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

相关推荐
程序员老赵4 小时前
Docker 部署 Redmine:老牌开源项目管理部署实测记录
docker·开源·团队管理
程序员老赵6 小时前
服务器文件不想 SFTP 上传?Docker 跑个 File Browser,浏览器就能管理
服务器·docker·开源
lichenyang4532 天前
Docker 学习笔记(五):Docker Compose,用一个 YAML 启动前端、后端和 MongoDB
docker
lichenyang4532 天前
Docker 学习笔记(四):Dockerfile,把项目打成自己的镜像
docker·容器
lichenyang4532 天前
Docker 学习笔记(三):Docker 网络、bridge、子网和容器互通
docker·容器
lichenyang4532 天前
Docker 学习笔记(二):docker run 的参数到底在控制什么?
docker·容器
Patrick_Wilson7 天前
从「改个端口」到 502:Next.js on k8s 的容器端口、Service 映射与 env 覆盖
docker·kubernetes·next.js
Suroy7 天前
DockerView-Go:用 Go 写一个终端 Docker 监控工具,顺便做了个 Web 仪表盘
docker
云恒要逆袭7 天前
运行你的第一个Docker容器
后端·docker·容器
宋均浩8 天前
# Docker 镜像瘦身实战:从 1.2G 到 80MB 的五个优化步骤
ci/cd·docker