Repository navigation
Expand file tree
/
Copy pathdocker-compose.gpu.yml
More file actions
46 lines (45 loc) · 2.25 KB
/
Copy pathdocker-compose.gpu.yml
File metadata and controls
46 lines (45 loc) · 2.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# GPU override for Agentic-J (amd64, NVIDIA GPU via CDI).
#
# The GPU is provided through the Container Device Interface (CDI) — the portable path
# supported by modern nvidia-container-toolkit, rootless Docker/Podman, and Docker 25+
# with `features: { "cdi": true }` in /etc/docker/daemon.json. Verify the host first:
# docker info | grep -iA2 'CDI spec' # must list the CDI spec directories
# nvidia-ctk cdi list # must enumerate nvidia.com/gpu=all, =0, ...
# If those are empty, enable CDI on the host:
# sudo nvidia-ctk cdi generate --output=/etc/cdi/nvidia.yaml
# add "features": { "cdi": true } to /etc/docker/daemon.json, then restart docker.
#
# Build: docker compose -f docker-compose.yml -f docker-compose.gpu.yml build
# Run: docker compose -f docker-compose.yml -f docker-compose.gpu.yml up -d
#
# CUDA_TAG: cu126 default; torch 2.11.0 wheels exist only for cu126 (driver 560+)
# and cu128 (driver 570+).
services:
imagentj:
image: ${IMAGENTJ_IMAGE:-agenticj:gpu-local}
build:
args:
USE_GPU: "true"
CUDA_TAG: ${CUDA_TAG:-cu126}
environment:
# Labkit sizes its GPU pool as (OpenCL global memory / 500 MB) contexts. On a
# unified-memory GPU (GB10 / DGX Spark) OpenCL reports all of system RAM — 130 GB,
# 261 contexts — and the parallel preview in the Labkit window opens them until the
# driver fails with CL_OUT_OF_HOST_MEMORY ("Too many contexts have been created and
# not released"). "<count> <name>" caps the pool; the name is a substring match,
# so "NVIDIA" fits any NVIDIA card.
- LABKIT_OPENCL_DEVICES=${LABKIT_OPENCL_DEVICES:-2 NVIDIA}
# Use the plain OCI runtime and let CDI inject the GPU — this is what makes the
# file portable to hosts that have no named 'nvidia' runtime. On a host whose
# default runtime is 'nvidia', this also avoids double-injection.
runtime: runc
deploy:
resources:
reservations:
devices:
# CDI device request. To scope to specific GPUs on a shared node, replace
# 'nvidia.com/gpu=all' with e.g. 'nvidia.com/gpu=0' (see `nvidia-ctk cdi list`).
- driver: cdi
device_ids:
- nvidia.com/gpu=all
capabilities: [gpu]