Not able to start the docker container #11733
|
Hey All, My first time trying to use LocalAI and failing to start the container. Compose file: services:
api:
image: localai/localai:latest-gpu-nvidia-cuda-13
# For CUDA 13, use: localai/localai:latest-gpu-nvidia-cuda-13
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/readyz"]
# start_period, not timeout, is the knob for a slow first boot: startup
# preload can download tens of GB before the API binds, and failures
# inside the start period leave the container `starting` rather than
# marking it unhealthy. timeout is a per-probe deadline.
start_period: 60m
interval: 1m
timeout: 10s
retries: 3
ports:
- 8080:8080
environment:
- DEBUG=false
volumes:
- ./models:/models:cached
# CDI driver configuration (recommended for NVIDIA Container Toolkit 1.14+)
# This uses the nvidia.com/gpu resource API
deploy:
resources:
reservations:
devices:
- driver: nvidia.com/gpu
count: all
capabilities: [gpu]…/Projects/localai ❯ nvidia-ctk -v
NVIDIA Container Toolkit CLI version 1.20.0
…/Projects/localai ❯ nvidia-smi
Tue Aug 25 21:24:08 2026
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 610.57.04 KMD Version: 610.57.04 CUDA UMD Version: 13.3 |
+-----------------------------------------+------------------------+----------------------+
| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+========================+======================|
| 0 NVIDIA GeForce RTX 5090 Off | 00000000:01:00.0 Off | N/A |
| 0% 40C P8 9W / 575W | 66MiB / 32607MiB | 0% Default |
| | | N/A |
+-----------------------------------------+------------------------+----------------------+
+-----------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=========================================================================================|
| No running processes found |
+-----------------------------------------------------------------------------------------+
…/Projects/localai ❯ nvidia-ctk cdi list
INFO[0000] Found 3 CDI devices
nvidia.com/gpu=0
nvidia.com/gpu=GPU-2aa233f8-6f8f-d498-0adf-808460be767c
nvidia.com/gpu=allHope that enough info. |
Replies: 1 comment 3 replies
|
Your host setup looks fine, it's the compose syntax. For CDI the device name belongs in deploy:
resources:
reservations:
devices:
- driver: cdi
device_ids:
- nvidia.com/gpu=allDrop If that still doesn't take, the other half is the daemon. CDI landed as an experimental feature in Docker 25 and wants And if you'd rather not deal with CDI at all, the legacy form still works and doesn't touch it: - driver: nvidia
count: all
capabilities: [gpu]Your |
It wasn't removed — it was added.
capabilitiesbecame a required property of each entry underdeploy.resources.reservations.devicesin compose-go v2.3.0, which shipped in Compose v2.30.0. Before that the schema had norequiredkey there at all, which is why nearly every example you'll find online omits it. Validation is client-side and runs before anything driver-specific, so namingdriver: cdidoesn't exempt you from it.The value itself doesn't matter in your case. When a device request names a driver, the daemon selects by driver name and skips capability matching entirely, and the CDI handler only ever reads
DeviceIDs. So this is enough to get past it: