WIP: fix(vk): the write-back diff pass has a checkpoint of its own in device-lost reports #1220
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
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
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!1220
Loading…
Reference in a new issue
No description provided.
Delete branch "TrashPanda/Longshot:fix/wb-diff-checkpoint"
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?
Type: fix · Risk: low · Tested on: Linux, RTX 4070 Ti · Needs: none
Why
When the game loses the GPU (
VK_ERROR_DEVICE_LOST, the 30-second hangs), the NVIDIA checkpoints are meant to namewhat the GPU was doing. In the reports from an RTX 5060 (#899) and a GTX 1660 Ti (#1008) both pipeline stages stop at
"write-back of pool", and that is ambiguous: the write-back diff compute pass runs right after the last pool's copy
and set no marker of its own, so a fault in that pass reads as the copy. This gives the pass its own marker, so the
next report says which of the two it was. It does not fix the hangs; it is what the next step on them needs.
How to reproduce
Seen on: Windows, RTX 5060 (#899) and GTX 1660 Ti (#1008), from their reports' logs; not reproduced here (this PC has lost no device)
Settings and switches: defaults (checkpoints are on by default on NVIDIA)
Steps: in Kakariko (#899: its graveyard, every time; #1008: walking around the village, once), play until the device is lost, then read the
vk: device lostlines inlongshot_log.txtExpected: the checkpoint at the stop names the work the GPU was doing
Actual: both stages stop at
write-back of pool <address>, which is either that pool's copy or the write-back diff pass dispatched right after itWhat changed
The write-back diff pass sets a checkpoint before its dispatch, and the device-lost report names it.
gpu/vk/vk_memory.cpp,memory_end_submission():checkpoint_mark(cmd, n, 'w')between the pass's push constantsand its
vkCmdDispatch, with the chunk count as its key.gpu/vk/vk_draw.cpp,checkpoint_kind():'w'reads "write-back diff pass, chunk count".tests/test_wb_diff_checkpoint.py: the marker sits between the push and the dispatch, and the report names it.Measurements
Nothing to measure: one
vkCmdSetCheckpointNVmore in a submission with a write-back diff, recorded only with checkpoints on, read only after a lost device.Flags and settings
None.
Testing
Tested:
python -I -B tests/run_all.pyon Linux, before the rebase and on the rebased code: every failure alsofails on
mainon this PC, whose toolchain lacks what those checks need (listed in a comment).tests/test_wb_diff_checkpoint.pyfails onmainand passes here. In the game: Ubuntu 26.04.1, RTX 4070 Ti, NVIDIA595.99.02, checkpoints on (the default on NVIDIA): ten 6-minute tours of Kakariko and the Market
(
scripts/memtour.py) and two screenshot runs with this marker recording, with no device lost.Not tested: a device-lost report showing the new marker. It needs a GPU that loses the device, which this PC
has not done.
Must be tested: None before merge. After it, the next device-lost log from an affected card (#899, #1008, #839)
says "write-back diff pass" or "write-back of pool" at the stop, which tells which one to look at.
Risks
What could break: nothing that renders. A checkpoint is a marker in the command buffer.
Turning it off:
RX_VK_CHECKPOINTS=0(all checkpoints), or revert the commit.Compatibility: Nothing changes.
Issues
See #899
See #1008
See #839
See #811
Checklist
Everyone
type(scope): description) of the status line's type.main.python -I -B tests/run_all.pypasses (any failure that also fails onmainis named).third_party/untouched (a new folder with aPROVENANCE.mdinstead).When it applies
Assisted-by:/Co-Authored-By:trailers.mainand passing here.Tested in game: Ubuntu 26.04.1, RTX 4070 Ti, NVIDIA 595.99.02, checkpoints on (the NVIDIA default): ten 6-minute tours of Kakariko and the Market and two screenshot runs with the marker recording; no device lost, play as on main.
Checks that fail on
main@0cab3548on this PC (Ubuntu 26.04.1; its toolchain lacks what they need),python -I -B tests/run_all.py:tests/test_audio_output_devices.pytests/test_bug_report.pytests/test_bug_report_defaults.pytests/test_crash_record.pytests/test_crt_options.pytests/test_dlss_feature_size.pytests/test_failed_compile_keeps_objects.pytests/test_fsr_uniform_ownership.pytests/test_guest_imported.pytests/test_hardware_report.pytests/test_import_reach.pytests/test_lift_lookups.pytests/test_linux_preflight.pytests/test_linux_update.pytests/test_make_game_cache.pytests/test_missing_nup.pytests/test_mods_size_table.pytests/test_nonuniform_image_arrays.pytests/test_parallel_init_order.pytests/test_pending_guest_import.pytests/test_replay_write_order.pytests/test_run_all_changed.pytests/test_vk_occlusion_queries.pytests/test_walk.pytests/test_walk_key.pyThis PR's run fails the same ones and nothing else (
tests/test_control.pytimed out once in the full run on #1222's branch and passes alone).View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.