Update docker compose templates to not rely on NVIDIA runtime

Plenty of setups may have either nvidia container toolkit without the runtime wrapper, or no toolkit at all.
These updated templates allow for all those cases while still providing support for NVIDIA GPUs.
This commit is contained in:
Josh.5
2024-03-15 04:52:32 +13:00
parent 728acd0ba1
commit 28c19ed1b2
3 changed files with 62 additions and 16 deletions

View File

@@ -1,9 +1,10 @@
---
version: "3.9"
services:
steam-headless:
image: josh5/steam-headless:latest
restart: unless-stopped
runtime: ${DOCKER_RUNTIME}
shm_size: ${SHM_SIZE}
ipc: host # Could also be set to 'shareable'
ulimits:
@@ -18,6 +19,17 @@ services:
- seccomp:unconfined
- apparmor:unconfined
# GPU PASSTHROUGH
deploy:
resources:
reservations:
# Enable support for NVIDIA GPUs.
#
# Ref: https://docs.docker.com/compose/gpu-support/#enabling-gpu-access-to-service-containers
devices:
- capabilities: [gpu]
device_ids: ["${NVIDIA_VISIBLE_DEVICES}"]
# NETWORK:
network_mode: host
hostname: ${NAME}
@@ -65,7 +77,7 @@ services:
- /dev/uinput
# Add AMD/Intel HW accelerated video encoding/decoding devices [OPTIONAL].
#- /dev/dri
# Add NVIDIA HW accelerated devices [OPTIONAL - must be run with runc docker runtime. If you use the nvidia runtime, this is not needed].
# Add NVIDIA HW accelerated devices [OPTIONAL - If you use the nvidia container toolkit, this is not needed].
#- /dev/nvidia0
#- /dev/nvidiactl
#- /dev/nvidia-modeset