Repository navigation
GPU: a failed allocation fails the frame, not the context (#1812) - #1919
Closed
ded-achtung wants to merge 1 commit into
Closed
ded-achtung wants to merge 1 commit into
ded-achtung wants to merge 1 commit into
Conversation
…ld#1812) within_memory caught out-of-memory and internal errors, but the next use of the invalid texture (a view, a copy) is a validation error; uncaught, it retired the GPU context for the session and every later frame rendered on the CPU. Validation errors are now caught in the same scope: the frame retries on the CPU and the GPU keeps going. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 20, 2026
Author
|
Closing as a duplicate of #1326 (@tylerjenningsw, opened Oct 13 for #1319), which I missed when I opened this. It adds the same 🤖 Generated with Claude Code |
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.
Found while testing #1812. One allocation failure retired the GPU for the rest of the session, and every later frame rendered on the CPU.
Problem
Gpu::within_memorycatchesOutOfMemoryandInternalerrors, and the preview then retries the frame on the CPU with fewer GPU frames kept. That is the intended path from #106 and #591.A texture whose allocation failed is invalid, though. Its next use, a
create_viewor a copy in the same render, is a validation error. Nothing caught that error, so it reached the uncaptured-error handler and retired the context:On the #1812 project this happened in most cold-start playbacks: 16 workers allocate at once while the caches are empty.
Change
within_memoryalso pushes aValidationerror scope. Scopes are thread-local in wgpu 30, so this only catches errors from the guarded work. Out-of-memory is still reported first. The frame then fails the way an out-of-memory frame already does: the CPU renders it, uploads are cleared, and the GPU keeps working.Result
Desktop playback of the #1812 project, 10 runs, together with #1917 and #1918:
Test
within_memory_catches_the_use_of_a_failed_texturecreates a texture over the size limit and makes a view of it inside the guard. It checks that the work returns an error, thatcheck_healthis stillOk, and that the next guarded work succeeds. Onmainthe test fails, because the uncaptured error retires the context.🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Documentation