[GH-ISSUE #4955] [Engine] Docker: only 6 of 10 visible GPUs are used; naming all 10 in GPU_ROLES kills the engine with "no CUDA-capable device" #2282

Open
opened 2026-11-04 01:58:09 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @cat3311 on GitHub (Nov 1, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4955

Strata 0.2.9-cuda13 (engine 0.1.55), also reproduced on 0.2.7-cuda13 (0.1.52).
Linux, driver 580.178.04, nvidia-container-toolkit 1.20.1 in CDI mode, 10x RTX 3080 Ti (sm_86), dual socket / 4 NUMA nodes.

What happens

  • With GPU_ROLES naming all 10 cards and count: all, the engine dies at
    "ggml_cuda_init: failed to initialize CUDA: no CUDA-capable device is detected",
    preceded by "--layer-split ... needs one distinct GPU per K in --split-device (1..9)".
  • With GPU_ROLES naming 6 cards it loads and serves normally
    ("layer split: layers 0-7 (CUDA0), ... one hand-off per window").
  • With GPUS=all / no roles, launch writes "gpu": [0,1,2,3,4,5] into the run config
    on its own, although the container sees 10 cards.

It is not the container runtime or the driver:

  • host: cuInit rc=0, cuDeviceGetCount=10
  • inside the strata image (docker compose run): nvidia-smi -L lists 10 GPUs,
    and ctypes on libcuda.so.1 gives cuInit 0 / count 10 with per-card attributes
    for all ten (sm=80, mhz=1665000), CUDA_DEVICE_ORDER=PCI_BUS_ID
  • adding an explicit CUDA_VISIBLE_DEVICES="0,...,N-1" to the service environment makes
    N-role launches work for N=6; N=10 with an explicit list still fails.

Also seen on a working 6-card run: "CUDA5: the layer split planned to keep 796 MiB free
here after loading; 245 MiB are free, so 551 MiB went to something the plan did not count."

Note: CUDA_VISIBLE_DEVICES="all" is invalid for CUDA (only NVIDIA_VISIBLE_DEVICES takes
"all"); with it the engine gets zero devices. Worth a clearer message in that case too.

Related: #4667 and its earlier auto-closed version #3899 (same Docker GPU_ROLES path, different symptom); the engine-side validation text "one distinct GPU per K in --split-device (1..9)" appears nowhere else in this tracker.

Originally created by @cat3311 on GitHub (Nov 1, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/4955 Strata 0.2.9-cuda13 (engine 0.1.55), also reproduced on 0.2.7-cuda13 (0.1.52). Linux, driver 580.178.04, nvidia-container-toolkit 1.20.1 in CDI mode, 10x RTX 3080 Ti (sm_86), dual socket / 4 NUMA nodes. What happens - With GPU_ROLES naming all 10 cards and `count: all`, the engine dies at "ggml_cuda_init: failed to initialize CUDA: no CUDA-capable device is detected", preceded by "--layer-split ... needs one distinct GPU per K in --split-device (1..9)". - With GPU_ROLES naming 6 cards it loads and serves normally ("layer split: layers 0-7 (CUDA0), ... one hand-off per window"). - With GPUS=all / no roles, launch writes "gpu": [0,1,2,3,4,5] into the run config on its own, although the container sees 10 cards. It is not the container runtime or the driver: - host: cuInit rc=0, cuDeviceGetCount=10 - inside the strata image (docker compose run): nvidia-smi -L lists 10 GPUs, and ctypes on libcuda.so.1 gives cuInit 0 / count 10 with per-card attributes for all ten (sm=80, mhz=1665000), CUDA_DEVICE_ORDER=PCI_BUS_ID - adding an explicit CUDA_VISIBLE_DEVICES="0,...,N-1" to the service environment makes N-role launches work for N=6; N=10 with an explicit list still fails. Also seen on a working 6-card run: "CUDA5: the layer split planned to keep 796 MiB free here after loading; 245 MiB are free, so 551 MiB went to something the plan did not count." Note: CUDA_VISIBLE_DEVICES="all" is invalid for CUDA (only NVIDIA_VISIBLE_DEVICES takes "all"); with it the engine gets zero devices. Worth a clearer message in that case too. Related: #4667 and its earlier auto-closed version #3899 (same Docker GPU_ROLES path, different symptom); the engine-side validation text "one distinct GPU per K in --split-device (1..9)" appears nowhere else in this tracker.
Author
Owner

@cat3311 commented on GitHub (Nov 1, 2026):

Follow-up from the same box: ladder with explicit CUDA_VISIBLE_DEVICES + matching GPU_ROLES,
identical image/volume/compose except N:

  • N=6 (CVD "0..5", roles 0-5): serves — "layer split: layers 0-7 (CUDA0), ... one hand-off per window"
  • N=8 (CVD "0..7", roles 0-7): serves — loads in ~105 s, "Main: GPU 8 ... Off: GPU 9, GPU 10"
  • N=9 (CVD "0..8"): dies at "Loading the model... 15 s" with
    ggml_cuda_init: failed to initialize CUDA: no CUDA-capable device is detected
  • N=10 (CVD "0..9"): same failure
    So the working boundary is between 8 and 9 stages, the same whether count: all or
    explicit device_ids. With no roles and GPUS=all, launch itself writes "gpu": [0..5].
    The validation string mentions "--split-device (1..9)", i.e. up to 10 stages should be
    addressable; in practice 9 already yields zero devices for ggml_cuda_init while the same
    container (same run command) shows cuDeviceGetCount=10 via ctypes on libcuda.so.1.
<!-- gh-comment-id:6564544356 --> @cat3311 commented on GitHub (Nov 1, 2026): Follow-up from the same box: ladder with explicit CUDA_VISIBLE_DEVICES + matching GPU_ROLES, identical image/volume/compose except N: - N=6 (CVD "0..5", roles 0-5): serves — "layer split: layers 0-7 (CUDA0), ... one hand-off per window" - N=8 (CVD "0..7", roles 0-7): serves — loads in ~105 s, "Main: GPU 8 ... Off: GPU 9, GPU 10" - N=9 (CVD "0..8"): dies at "Loading the model... 15 s" with ggml_cuda_init: failed to initialize CUDA: no CUDA-capable device is detected - N=10 (CVD "0..9"): same failure So the working boundary is between 8 and 9 stages, the same whether `count: all` or explicit device_ids. With no roles and GPUS=all, launch itself writes "gpu": [0..5]. The validation string mentions "--split-device (1..9)", i.e. up to 10 stages should be addressable; in practice 9 already yields zero devices for ggml_cuda_init while the same container (same run command) shows cuDeviceGetCount=10 via ctypes on libcuda.so.1.
Author
Owner

@cat3311 commented on GitHub (Nov 1, 2026):

Ladder on the same box (same image/volume/compose; only CUDA_VISIBLE_DEVICES + matching GPU_ROLES change), GPUs empty:

  • 6 devices "0..5": serves — "layer split across 6 GPUs", caches hold 10196 of 24576 pairs (~79.9% routed mass)
  • 8 devices "0..7": serves — "layer split across 8 GPUs", caches hold 13793 of 24576 (~91.4%), hit rate 81.9%
  • 9 devices "0..8": dies at CUDA init; the validation text prints "--split-device (1..8)", i.e. the launch side sees all 9
  • 10 devices "0..9": same, "(1..9)"
    The boundary is exactly between 8 and 9 visible CUDA devices: ggml_cuda_init reports
    "no CUDA-capable device is detected" although ctypes in the same container returns cuDeviceGetCount=10.
    Looks like a fixed 8-device array in engine init rather than anything topology/driver related.
    Separate oddity: with GPUS=all and no roles, launch writes "gpu": [0..5] regardless of the 10 visible cards.
<!-- gh-comment-id:6564650802 --> @cat3311 commented on GitHub (Nov 1, 2026): Ladder on the same box (same image/volume/compose; only CUDA_VISIBLE_DEVICES + matching GPU_ROLES change), GPUs empty: - 6 devices "0..5": serves — "layer split across 6 GPUs", caches hold 10196 of 24576 pairs (~79.9% routed mass) - 8 devices "0..7": serves — "layer split across 8 GPUs", caches hold 13793 of 24576 (~91.4%), hit rate 81.9% - 9 devices "0..8": dies at CUDA init; the validation text prints "--split-device (1..8)", i.e. the launch side sees all 9 - 10 devices "0..9": same, "(1..9)" The boundary is exactly between 8 and 9 visible CUDA devices: ggml_cuda_init reports "no CUDA-capable device is detected" although ctypes in the same container returns cuDeviceGetCount=10. Looks like a fixed 8-device array in engine init rather than anything topology/driver related. Separate oddity: with GPUS=all and no roles, launch writes "gpu": [0..5] regardless of the 10 visible cards.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#2282
No description provided.