WIP: fix(vk): a temporal upscaler's passes have device-lost checkpoints of their own #2293
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2293
Loading…
Reference in a new issue
No description provided.
Delete branch "d4nkn3ss/Longshot:fix/upscaler-checkpoints"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
For #2205. Four NVIDIA device-lost reports with DLSS on (#2205, #2238, #2208, #2201: four cards, drivers 610.88 to
621.35, four maps) all stop at the same checkpoint: the draw of program
d905f52b7517c681, a one-draw pass at the outputsize, reached; nothing after it. Right after the game's upscale network's draw, the temporal chain (
draw_engine,gpu/vk/vk_temporal.cpp) records its input passes, the engine's evaluate (NGX_VULKAN_EVALUATE_DLSS_EXTfor DLSS) and itsoutput pass, with no checkpoint of their own, so a hang in any of them reads as that draw.
This puts a checkpoint before each of the three, keyed by the network's program, and names them in the report
(
checkpoint_kind,gpu/vk/vk_draw.cpp):upscaler's input passes, for network ...,upscaler's evaluate, for network ...,upscaler's output pass, for network .... It is a diagnostic, not a fix: the next report of this kind says whetherthe GPU was in the DLSS evaluate or in the draw before it. It covers every engine on the chain (DLSS, DLAA, FSR 3.1,
XeSS); FSR 4's own evaluate (
vk_fsr4.cpp) is not on it and is unchanged. As #1220 did for the write-back diff pass.To see it on main: a device-lost report from a run with DLSS on, as #2205's: its
RUNNING afterline names thenetwork's draw even when the GPU was in the DLSS evaluate after it.
Read first: the three
checkpoint_markcalls indraw_engine.Testing
Tested: Windows 11 (26300), RTX 3080, NVIDIA 621.14, a build of this branch @
63b799ea: four minutes walking the childMarket from the repo's
market-entrancesave with AMD FSR 3.1 upscaling (this PC's builds have no DLSS: the NGX SDK is notfetched), so
draw_engineand the new markers ran every frame (AMD FSR 3.1: 600 frames drawnin each status line, theupscaler: the scene's cameraline that onlydraw_enginewrites). No device-lost, fatal or failed-evaluation line,held at the 60 cap, and the screenshot at the end is a normal picture. A device-lost report itself can't be made to happen
here, so the report's new lines were not seen.
Checks:
tests/test_upscaler_checkpoints.pyfails on main (no markers, the kinds unnamed) and passes here. The 211 checksthat read
vk_temporal.cpp,vk_draw.cpporvk_internal.h: 201 passed, 3 skipped (nospirv-valon Windows), 7 failed,and the same 7 fail on main @
753fb5af(test_dev_packs,test_linux_driver_fault_guard,test_pipeline_tour,test_sampler_admission,test_saveload_warm_cache,test_pipeline_state_computes,test_tracy_funcs: Windows-only tooland environment failures). The renderer built with llvm-mingw (clang).
Still to test:
reporters, or anyone with a DLSS build).
Measurements
Nothing to measure: three markers a frame, beside the one already set before each of the frame's ~2300 draws and dispatches; no change to what is drawn.
Risks
vkCmdSetCheckpointNV(or AMD buffer marker) for each of three points a frame, only while an upscaler on thechain draws;
RX_VK_CHECKPOINTS=0turns them off with the rest.Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named).main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
mainand passes here.Linux toolchain on this PC (Still to test).
checkpoint_markcomment invk_internal.hnamesthe new ones.
Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.🤖 Generated with Claude Code
Markers before draw_engine's input passes ('p'), before the engine's evaluate ('e': DLSS, FSR 3.1, XeSS) and before its output pass ('o'), keyed by the network's program and named in checkpoint_kind. Four NVIDIA device-lost reports with DLSS on stopped at one output-size draw's marker with the chain's work after it unmarked (issue 2205): the next such report says which of the three the GPU was in. Assisted-by: Claude Code Co-Authored-By: Claude Opus 5.5 <[email protected]>Tested in game: Windows 11, RTX 3080, NVIDIA 621.14: 4 min in the child Market with FSR 3.1 through draw_engine, build
63b799ea; no device-lost/fatal lines, normal picture@review
Recommendation: Approve. The markers cover the three intended stages, but their labels can misidentify work in pre-bloom and frame-generation modes. A device-lost report and the remaining supported-platform runs are needed to confirm the diagnostic works in practice. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge.
Adds checkpoints around temporal upscaler input preparation, evaluation and output so a device-lost report can narrow down where the GPU stopped. The change reuses the existing checkpoint machinery at the cost of three markers per engine invocation.
Should fix (2): not blocking, but worth doing before merging.
gpu/vk/vk_draw.cpp:5381: The new labels call every key a network program, but the pre-bloom path passes the program of the draw that first reads the scene. (more on the line) Do: Use a label that identifies the key as the program at which the upscaler ran, or distinguish pre-bloom markers from network markers.gpu/vk/vk_temporal.cpp:1770: The output marker also covers frame-generation input copies recorded after the output dispatch. (more on the line) Do: Add a checkpoint before the frame-generation input work, or label the output checkpoint to include that work.Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)
gpu/vk/vk_temporal.cpp:1760: The diagnostic has not yet been observed in a device-lost report from the DLSS path it is intended to distinguish. (more on the line) Do: Obtain a report from a DLSS build reproducing the reported device loss and check the marker and stage lines.gpu/vk/vk_temporal.cpp:1724: The added GPU commands have not been exercised on the other affected Tier 1 platforms. (more on the line) Do: Build and run an enabled temporal upscaler on Linux and exercise the AMD buffer-marker path on supported Tier 1 hardware.@fixcan do L1 and L2.Checks: Still running: 9 checks.
More: does it help, other systems, switches, what was read
Does it help: Unproven for the reported failure: the source check is reported to fail on main and pass here, but no device-lost report with the new markers has been observed. The Windows RTX 3080 FSR 3.1 run completed normally for four minutes; it did not exercise DLSS or a device loss.
Other systems: The calls also run for DLAA, FSR 3.1 and XeSS on the temporal chain, including DLAA before bloom, and use NVIDIA checkpoints or AMD buffer markers when enabled. Windows FSR 3.1 was exercised; Linux, AMD hardware and an actual DLSS device-lost report remain untested. FSR 4's separate evaluate path is unchanged.
Switches: None added, changed or removed. Existing RX_VK_CHECKPOINTS controls these markers.
Reviewed:
63b799eae6against753fb5af68: Read the diff, commits, repository rules, PR template, standards, test, checkpoint implementation and report path, draw_engine and its callers, and the frame-generation input paths. The full vk_draw.cpp and vk_temporal.cpp outputs were truncated; their unrelated portions were skimmed. docs/review-checklist.md and ../Tooling/AGENTS.md were absent.; nothing run (a code review).Checked and fine:
Testing: No code or tests were run for this review. The PR reports a Windows llvm-mingw build and in-game FSR 3.1 run; Linux build and device-lost report remain outstanding. Listed CI checks are still running.
Overlaps and merge order: Not checked; network unavailable.
Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
@ -5378,6 +5378,8 @@ const char* checkpoint_kind(char c) {: c == 'b' ? "write-back of pool" : c == 'w' ? "write-back diff pass, chunk count" : c == 'u' ? "upload of texture": c == 'g' ? "GPU unswizzle of texture": c == 's' ? "mirror syncs' pass, chunk count": c == 'p' ? "upscaler's input passes, for network" : c == 'e' ? "upscaler's evaluate, for network"L1 (should fix): The new labels call every key a network program, but the pre-bloom path passes the program of the draw that first reads the scene.
When: With DLAA before bloom enabled, temporal_pre_bloom passes the bloom-triggering draw's p.key to draw_engine; a checkpoint report labels that key as a network and can send an investigation to the wrong program.
Do: Use a label that identifies the key as the program at which the upscaler ran, or distinguish pre-bloom markers from network markers.
@ -1720,1 +1721,4 @@VK_ACCESS_2_TRANSFER_READ_BIT); // (the scene's colour, depth, and actor buffers, written before)// (longshot, issue 2205) markers of their own for the chain's passes, the evaluate and the output: in a device-lost// report they read as the network's draw (key) otherwise, its marker the last one before themcheckpoint_mark(cmd, key, 'p');L4 (should fix): The added GPU commands have not been exercised on the other affected Tier 1 platforms.
When: The reported run uses NVIDIA on Windows; AMD's buffer-marker path and Linux execution have no reported run with these additional commands.
Do: Build and run an enabled temporal upscaler on Linux and exercise the AMD buffer-marker path on supported Tier 1 hardware.
@ -1753,6 +1757,7 @@ bool draw_engine(VkCommandBuffer cmd, State& s, int mode, const Camera& cam, uinlogf("vk: upscaler: the scene's camera: near %.3f, far %.1f, vertical field of view %.1f degrees", cam.near_z,cam.far_z, cam.fov_y * 57.29578f);}checkpoint_mark(cmd, key, 'e');L3 (should fix): The diagnostic has not yet been observed in a device-lost report from the DLSS path it is intended to distinguish.
When: A normal FSR 3.1 run records the calls but does not show which checkpoint stages a real NVIDIA device-lost report returns or whether they distinguish the evaluate from its surrounding work.
Do: Obtain a report from a DLSS build reproducing the reported device loss and check the marker and stage lines.
@ -1762,6 +1767,7 @@ bool draw_engine(VkCommandBuffer cmd, State& s, int mode, const Camera& cam, uinengine.failed = true;return false; // (the network writes its output over whatever the evaluation did)}checkpoint_mark(cmd, key, 'o');L2 (should fix): The output marker also covers frame-generation input copies recorded after the output dispatch.
When: With DLSS Frame Generation active, dlss_fg_inputs records depth and motion image copies after the output pass without another checkpoint. A hang in those copies can therefore be reported as the upscaler's output pass; FSR frame interpolation can similarly record a motion copy.
Do: Add a checkpoint before the frame-generation input work, or label the output checkpoint to include that work.
@fix
I didn't fix this pull request: the change I made would take out 5 of the 10 lines this pull request adds outside its tests, which undoes it rather than fixing it. So L1 and L2 are the author's now. Nothing was pushed.
Automated fix by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.