This commit is contained in:
2025-12-24 01:41:15 -05:00
parent a6c118322d
commit f2a6138e44

View File

@@ -14,35 +14,36 @@ services:
restart_policy:
condition: on-failure
# --- HARDWARE PERMISSIONS (The Missing Link) ---
# Grant the container permission to lock memory and talk to drivers
# Run as root (Required for device access)
user: root
# Grant full hardware access
cap_add:
- IPC_LOCK
- SYS_PTRACE
- SYS_ADMIN
- SYS_RESOURCE
- SYS_NICE
# Add the container to the Host's 'video' (44) and 'render' (993) groups
# group_add:
# - "44"
# - "993"
user: root
# THE FULL PASS-THROUGH
devices:
# Map Host 'card1' (AMD) -> Container 'card0' (So it looks like Default GPU)
- /dev/dri/card1:/dev/dri/card0
- /dev/dri/renderD128:/dev/dri/renderD128
# Map the ENTIRE GPU folder (Let the driver figure it out)
- /dev/dri:/dev/dri
- /dev/kfd:/dev/kfd
volumes:
- /mnt/local-ssd/docker/ollama:/root/.ollama
environment:
# Force support for Navi 21 (6900 XT)
- HSA_OVERRIDE_GFX_VERSION=10.3.0
# Now that we spoofed card0, we tell ROCm to use Device 0
- ROCR_VISIBLE_DEVICES=0
# SELECT THE AMD CARD (Index 1 = card1)
- ROCR_VISIBLE_DEVICES=1
# Helpful fix for eGPUs over PCIe
- HSA_ENABLE_SDMA=0
- OLLAMA_HOST=0.0.0.0
- OLLAMA_KEEP_ALIVE=5m
- OLLAMA_DEBUG=1