Recover on CPU after CUDA inference failure - #2
Merged
Pedrojok01 merged 4 commits intoAug 23, 2026
Conversation
The three-element handle tuple trips clippy::type_complexity, which is denied in CI. Introduce a FeederHandles alias for it. The alias sits above spawn_feeder's doc comment: placing it directly above the fn separates the existing #[allow(clippy::too_many_arguments)] from its target. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MH5oQSAY4LyjHrreceGw6
Pedrojok01
approved these changes
Aug 23, 2026
Pedrojok01
left a comment
Owner
There was a problem hiding this comment.
Good catch, thank you for the fix!
LGTM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A CUDA execution provider can accept a session at startup but fail only when the first model kernel runs.
This happens with CUDA provider builds that do not contain a kernel image for a newer GPU architecture. For example, RTX 50 / Blackwell GPUs (SM 120) can fail with:
Changes
Retain the selected ONNX model bytes in the feeder.
When GPU inference fails, rebuild the segmenter with the CPU execution provider.
Retry the frame that triggered the GPU error on CPU, so the virtual camera continues immediately.
Publish the live backend state from the feeder to the Pipeline and GUI.
Show a persistent GPU unavailable · CPU footer badge after recovery.
Log an explicit warning explaining that GPU acceleration was disabled and CPU processing is now active.
Document the RTX 50 / Blackwell limitation and the requirement for a custom ONNX Runtime CUDA provider built with CMAKE_CUDA_ARCHITECTURES=120 (or native).
The fallback is intentionally not limited to Blackwell. Session creation alone does not prove that a CUDA provider can execute every model kernel, so any delayed GPU inference failure is recovered the same way.
Validation
cargo test --workspace
Manually reproduced on an RTX 5070:
Example log after this change:
[WARN lb_pipeline::lazy] GPU acceleration was disabled after an inference error;
LinuxBroadcast is now using CPU. ort run rvm: ... cudaErrorNoKernelImageForDevice ...
To restore GPU acceleration, install an ONNX Runtime CUDA provider built for this GPU.
Issue #1