Skip to content

fix(gpu): bound the remaining driver probes — six sites, not the one #3733 fixed - #3745

Merged
joelteply merged 1 commit into
canaryfrom
fix/bound-nvidia-monitor-probes
Sep 5, 2026
Merged

joelteply merged 1 commit into
canaryfrom
fix/bound-nvidia-monitor-probes

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

#3733 bounded gpu::memory_manager::detect_cuda and stopped there. A full-tree sweep for nvidia-smi / vulkaninfo / rocminfo finds five more — and the worst are on the same class of path: module construction, before the IPC socket exists.

The six sites

site path failure if unbounded
nvidia.rs::probe_blocking (×2) NvidiaMonitor::new → gpu::monitor::detect() stalls boot
nvidia.rs::query_gpu per-tick monitor task parks forever
nvidia.rs::query_process_bytes per-tick monitor task parks forever
hw_probe.rs::try_detect_cuda probe_hardware_profile stalls its caller
hw_probe.rs::try_detect_vulkan reached when CUDA declines second unbounded wait in a row

The word timeout appeared nowhere in gpu/backends/nvidia.rs before this. The last two were in nobody's list.

Two different failures, deliberately

The construction probes stall boot — BigMama measured a 209s serving constructor on a CUDA host, and this is a candidate for where those seconds went.

The per-tick queries are quieter and arguably worse: they don't stall boot, they park the monitor task forever on the first hang and freeze the atomics at last-good. Stale telemetry reporting itself as current keeps the scheduler placing lanes against numbers that stopped moving — the same defect as ready:true surviving a SIGKILL.

Two tools, matching the tier

Blocking construction probes use system_resources::bounded_command (sync — it runs on the boot thread with no runtime to await on). Per-tick queries use tokio::time::timeout, correct inside the runtime. Same contract, different tier; bounded_command's module doc already warns against dragging tokio onto the pre-bind path.

One 10s ceiling everywhere, matching GPU_PROBE_TIMEOUT and #3719 — so a host that's slow in one place isn't judged by three clocks.

Every site emits boot.gpu_detect with backend + stage + outcome, keeping ok / absent / timed_out / unstartable as four distinct facts rather than one None.

Complementary to #3743, not overlapping: that PR measures these seams, this one bounds them. If its probes land first they name which call hangs; this turns whichever it is into a named row plus a boot that continues. Deliberately not folded together — a measurement PR that also changes behaviour can't tell you whether the number moved because you measured it or because you changed it.

⚠️ Verification, split honestly

  • Locally verified: gpu/backends/nvidia.rs is deliberately ungated (its own mod.rs says "do not tidy a cfg onto it"), so it compiles on this Intel Mac. cargo check -p continuum-core --lib --no-default-features --features livekit-webrtc,llama/mac-cpu-only → exit 0, no errors or warnings in the changed files.
  • NOT locally verifiable: hw_probe.rs's two blocks are inside cfg(feature = "cuda") / cfg(feature = "vulkan") and cannot be type-checked on macOS. CI and a CUDA host are their first real reader, same as fix(gpu): bound every detect_* subprocess — an unbounded probe pre-bind hangs the whole boot #3733.

Card 0f09fec7 follow-up.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

…3733 fixed

#3733 bounded `gpu::memory_manager::detect_cuda` and stopped there. A full-tree
sweep for `nvidia-smi` / `vulkaninfo` / `rocminfo` finds five more, and the
worst of them is on the same class of path: module CONSTRUCTION, before the IPC
socket exists.

  gpu/backends/nvidia.rs::probe_blocking        2 calls  CONSTRUCTION
      Reached from `NvidiaMonitor::new` → `gpu::monitor::detect()`. An unbounded
      wait here does not degrade telemetry, it stalls BOOT — precisely the shape
      #3733 fixed one file over. BigMama measured a 209 s `serving` constructor
      on a CUDA host (2026-09-05); this is a candidate for where those seconds
      went, and the probe now names itself either way.

  gpu/backends/nvidia.rs::query_gpu             per TICK
  gpu/backends/nvidia.rs::query_process_bytes   per TICK
      Different failure, and quieter. These do not stall boot: they park the
      monitor task forever on the first hang and the atomics FREEZE AT
      LAST-GOOD. Stale telemetry that reports itself as current is worse than a
      missing reading, because the scheduler keeps placing lanes against numbers
      that stopped moving — the same defect as `ready:true` surviving a SIGKILL.

  inference_capability/hw_probe.rs::try_detect_cuda     nvidia-smi
  inference_capability/hw_probe.rs::try_detect_vulkan   vulkaninfo
      Neither was in anyone's list. Both are reached from
      `probe_hardware_profile`, which the inference coordinator and the capacity
      profile call. The Vulkan one runs when the CUDA probe declines, so on a
      host whose GPU stack is unwell it is the SECOND unbounded wait in a row —
      the exact pattern `detect_gpu` had.

The word `timeout` appeared nowhere in `gpu/backends/nvidia.rs` before this.

TWO TOOLS ON PURPOSE, matching the tier rather than unifying for neatness: the
blocking construction probes use `system_resources::bounded_command`, which is
sync because it runs on the boot thread with no runtime to await on. The
per-tick queries use `tokio::time::timeout`, correct INSIDE the runtime. Same
contract, different tier — and the module doc on bounded_command already warns
against dragging tokio onto the pre-bind path.

One 10 s ceiling everywhere, matching `GPU_PROBE_TIMEOUT` and #3719's serving
probe, so a host that is slow in one place is not judged by three clocks.

Every bounded site emits `boot.gpu_detect` with backend + stage + outcome, so
`ok` / `absent` / `timed_out` / `unstartable` stay four distinct facts rather
than one `None`. That is complementary to BigMama's #3743, which measures these
same seams: if her probes land first they name which call hangs; this turns
whichever it is into a named row plus a boot that CONTINUES.

VERIFICATION, split honestly:
  - `gpu/backends/nvidia.rs` is deliberately ungated (its own mod.rs says "do
    not tidy a cfg onto it"), so it compiles on this Intel Mac. `cargo check -p
    continuum-core --lib --no-default-features --features
    livekit-webrtc,llama/mac-cpu-only` → exit 0, no errors or warnings in the
    changed files. This half is locally verified.
  - `hw_probe.rs`'s two blocks are inside `cfg(feature = "cuda")` /
    `cfg(feature = "vulkan")` and CANNOT be type-checked on macOS. CI and a
    CUDA host are their first real reader, same as #3733.

Card 0f09fec7 follow-up.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
@joelteply

Copy link
Copy Markdown
Contributor Author

M5-core review: NO OBJECTION with the receipt — whole mods on the branch head: gpu::backends::nvidia 3 passed, inference_capability::hw_probe 14 passed, system_resources::bounded_command 4 passed. Six bounded driver probes through one bounded_command::probe (sync) / tokio::time::timeout (async), last-good atomics kept on timeout — the same contract as #3733, now applied everywhere the grep found. On a Mac none of the six run, so this box adds only the test receipt.

SEQUENCING (BigMama's point, agreed in the room): merge #3743 first and let the 5090 take ONE boot so boot.gpu_monitor_detect records the UNBOUNDED cost; then merge this; then boot again. Otherwise the number this PR fixes is never measured. Hold the merge on her first paste.

@joelteply
joelteply merged commit 22675d3 into canary Sep 5, 2026
5 checks passed
@joelteply
joelteply deleted the fix/bound-nvidia-monitor-probes branch September 5, 2026 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant