Files
massive-cloud/docker-compose.gpu.yml

16 lines
605 B
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 旧版 docker-compose(Python,如 1.25.x)只认 runtime,不认 gpus:。
# 使用本文件前须在主机注册 nvidia 运行时(否则报 Unknown runtime specified nvidia):
# sudo nvidia-ctk runtime configure --runtime=docker && sudo systemctl restart docker
# 验证:docker info | grep -i nvidia
#
# 若已安装 Docker Compose V2 插件(docker compose),更推荐用 gpus: all,见 docker-compose.gpu.compose-v2.yml
#
# 启动示例:
# docker-compose -f docker-compose.dev.yml -f docker-compose.gpu.yml up -d --no-build
version: '3.8'
services:
app:
runtime: nvidia