Repository navigation
GPU: stop drawing a frame once the device has failed - #1520
Merged
Merged
Conversation
Member
|
Merged, thank you @MatejKozlovsky! It landed on |
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
On heavy 4K comps the GPU runs out of memory partway through frame 0. The compositor keeps drawing the rest of that frame's layers on a device that has already failed. Each later layer fails as well, and frame 0 only goes back to the CPU after the full comp has been walked. In the trace, frame 0 of
c_effectsis declined 20.4 s into the export, 10 s after the GPU retired.Change
walk::draw_compnow checkscheck_health()before each layer (draw_precompalready does this). Once the device has failed, the frame returnsNoneright away and goes to the CPU renderer as before. That is 3 lines incrates/gpu/src/walk.rs. There is no behaviour change while the GPU is healthy.Independent of #1511 (the fallback-parallel PR); the two stack cleanly. No overlap with #1415, #1441 or #898.
Results
Vulkan, RTX 3090, 6 frames at 4K, 16 threads, H.264. Output compared as decoded framemd5.
Not covered
The OOM is already caught as soon as it happens:
on_uncaptured_errorretires the context synchronously, about 20 ms after the failing submit. It is not waiting on the readback timeout, so error scopes would not detect it any sooner. The remaining gap to CPU only (about 5 s with #1511) is the GPU work done before the OOM plus frame 0 rendering alone on the CPU. Skipping the GPU when a frame's estimated footprint does not fit would be the follow-up.Testing
cargo fmt --checkandclippy --no-deps -D warningsare clean.cargo test -p effectcraft-gpugives 210 passed and 2 failed (tests_fx_pixel2::stylize,tests_fx_stylize::posterize_thresholds_strobe_vignette). Both also fail on unmodified main on the same software adapter, so they are not caused by this change.