fix(agent): make GPU passthrough optional
Heimdall Gitea / Build and tests (pull_request) Successful in 16m45s
Heimdall Gitea / Publish versioned release (pull_request) Skipped
Heimdall Gitea / Build and scan agent image (pull_request) Successful in 7m31s
Heimdall Gitea / Build and scan server image (pull_request) Successful in 7m44s
Heimdall Gitea / Publish Docker Hub latest tags (pull_request) Skipped

This commit is contained in:
Arnaud Dartois committed 2026-10-25 00:01:42 +02:00
1 parent 8d116bd3cc
commit a2f75a00a7
9 files changed
+85 -56

No files matched your search

+12
View File
@@ -0,0 +1,12 @@
# Optional AMD device passthrough for Agent GPU inventory.
# The current Agent image still runs ONNX inference on CPU.
services:
heimdall-agent:
profiles:
- gpu-amd-inventory
devices:
- /dev/kfd:/dev/kfd
- /dev/dri:/dev/dri
group_add:
- "${VIDEO_GID:-44}"
- "${RENDER_GID:-109}"
+11
View File
@@ -0,0 +1,11 @@
# Optional Intel render-device passthrough for Agent GPU inventory.
# The current Agent image still runs ONNX inference on CPU.
services:
heimdall-agent:
profiles:
- gpu-intel-inventory
devices:
- /dev/dri:/dev/dri
group_add:
- "${VIDEO_GID:-44}"
- "${RENDER_GID:-109}"
+13
View File
@@ -0,0 +1,13 @@
# Optional NVIDIA device passthrough for Agent GPU inventory.
# The current Agent image still runs ONNX inference on CPU.
services:
heimdall-agent:
profiles:
- gpu-nvidia-inventory
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]
+2 -26
View File
@@ -154,32 +154,8 @@ services:
Agent__AgentName: ${HEIMDALL_AGENT_NAME:-agent-01}
Agent__HeartbeatIntervalSeconds: ${HEIMDALL_HEARTBEAT_INTERVAL:-30}
Agent__StateDirectory: /var/lib/heimdall
# ONNX Runtime GPU provider selection
ORT_PROVIDER: ${AGENT_ORT_PROVIDER:-CUDA}
ORT_CUDA_DEVICE_ID: ${AGENT_CUDA_DEVICE_ID:-0}
# GPU device exposure (NVIDIA CUDA, AMD ROCm, Intel VAAPI/iGPU)
# Override in docker-compose.local.yml for specific GPU hardware:
# deploy:
# resources:
# reservations:
# devices:
# - driver: nvidia
# count: 1
# capabilities: [gpu]
# Or for AMD ROCm:
# devices:
# - /dev/kfd:/dev/kfd
# - /dev/dri:/dev/dri
# Or for Intel iGPU/VAAPI:
# devices:
# - /dev/dri:/dev/dri
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
# The published Agent image runs ONNX inference on CPU. Optional GPU
# passthrough overlays are only for device inventory/experimentation.
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://127.0.0.1:8081/healthz"]
interval: 30s
-29
View File
@@ -118,9 +118,6 @@ services:
build:
context: ..
dockerfile: docker/Dockerfile.agent
args:
# Select GPU runtime: nvidia | amd | intel | cpu (default)
TARGET_RUNTIME: ${AGENT_RUNTIME:-cpu}
# Host network: the agent must see the real camera LAN to run discovery.
# On a bridge network it only sees 172.x → the scanner skips (no local subnet).
network_mode: host
@@ -137,35 +134,9 @@ services:
Agent__HeartbeatIntervalSeconds: ${HEIMDALL_HEARTBEAT_INTERVAL:-30}
Agent__StateDirectory: /var/lib/heimdall
Agent__RegistrationMaxRetries: ${HEIMDALL_REGISTRATION_RETRIES:-5}
# ONNX Runtime GPU provider selection
ORT_PROVIDER: ${AGENT_ORT_PROVIDER:-CUDA}
ORT_CUDA_DEVICE_ID: ${AGENT_CUDA_DEVICE_ID:-0}
volumes:
- agent_state:/var/lib/heimdall
user: "1654:1654"
# GPU device exposure (NVIDIA CUDA, AMD ROCm, Intel VAAPI/iGPU)
# Override in docker-compose.local.yml for specific GPU hardware:
# deploy:
# resources:
# reservations:
# devices:
# - driver: nvidia
# count: 1
# capabilities: [gpu]
# Or for AMD ROCm:
# devices:
# - /dev/kfd:/dev/kfd
# - /dev/dri:/dev/dri
# Or for Intel iGPU/VAAPI:
# devices:
# - /dev/dri:/dev/dri
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://127.0.0.1:8081/healthz"]
interval: 30s