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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user