fix(vk): a driver update warms the noted pipelines again before the game, not in play #789
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/upscaling
beanstalk: approved @ 1697603
beanstalk: approved @ 2c5a62e
beanstalk: approved @ 4fd82b7
beanstalk: approved @ 64d6d09
beanstalk: approved @ 6f91fae
beanstalk: approved @ 70a78f9
beanstalk: approved @ 8015c9a
beanstalk: approved @ 8d361dc
beanstalk: approved @ 9d8356e
beanstalk: approved @ abf2227
beanstalk: approved @ d82f202
beanstalk: approved @ e5f1e40
beanstalk: approved @ ee8ab5f
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
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
testing wanted
ci: approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!789
Loading…
Reference in a new issue
No description provided.
Delete branch "dyst/Longshot:fix/warm-after-driver-update"
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: Windows 11 (game-free checks) · Needs: Windows or Linux, a GPU with mesh shaders (NVIDIA RTX, AMD RDNA 2 or later), a driver update
Why
After a GPU driver update, the first start of the game is laggy and stutters while it compiles pipelines in play; only the start after that is smooth. A player reported this in MagicBeanDev/LongshotLauncher#90.
The cause: a driver update changes the driver's
pipelineCacheUUID, so our pipeline cache file is refused and the cache starts empty. But the marker that says "every noted pipeline is built into the cache" stays. WithRX_VK_LOAD=create, the default on GPUs with mesh shaders, that start skips the warm-up and compiles the noted pipelines in play. Project ReLink, a fork of Longshot, found the same gap (db54a4bc, aabc7ad8).How to reproduce
Seen on: Windows, an NVIDIA RTX card, after a driver update
Settings and switches: defaults (RX_VK_LOAD=create on a GPU with mesh shaders)
Steps: play once so the noted pipelines are warmed, update the GPU driver, start the game again, walk into the Market
Expected: a warm-up before the title (the start-up screen counts the pipelines), then smooth play
Actual: no warm-up, and stutter in play while the pipelines compile; the log has
vk: pipeline cache ... (0 KB)with the old file still incache\What changed
A pipeline cache file that the driver refuses now removes the pipelines' marker too, as a file dropped for another translator already did. So the start after a driver update warms again before the game.
gpu/vk/vk_draw.cpppcache_init: notes a file that was there but couldn't be taken (pcache_file_rejected), and logs it (vk: pipeline cache: ... was made for another driver or GPU).gpu/vk/vk_draw.cppprecompile_run: reads the cache (pcache_init()) before it looks at the marker, and removes the marker when the file was dropped or refused.tests/test_pcache_stamp.pychecks the order and the removal.tests/test_warm_bounded.pyandtests/pipeline_play_cache_test.cppfollow the changed source.Measurements
Not measured: what changes is which start warms the pipelines, not the frame. The game-free checks under Testing show the order. A tester's first start after a driver update is the measurement: whether there's a warm-up, and whether the Market stutters.
Flags and settings
None.
Testing
Tested:
Rebased onto
main@7bacf846(this PR @a157ea71): the 113 checks that read this diff (listed below), not the whole suite, throughtests/run_all.py --jobs 6on Windows 11 with the Builder's llvm-mingw (v2.0.14 tools): 99 passed, 3 failed, 11 skipped for want of the Vulkan headers; those 11 again withRX_CPMset to the Builder's CPM cache: all 11 pass. The 3 failures also fail on main @7bacf846, with the same message:test_linux_driver_fault_guard(POSIX signals),test_pipeline_tourandtest_vk_occlusion_queries. (The full suite on main @1310ecc6: 500 passed, 17 failed, 79 skipped.)The 113 checks
nx2/test_cbuf_table_extent.pynx2/test_dump_ssbo_read.pynx2/test_mesh_dynamic_state.pytests/test_bake_ds.pytests/test_bank_gen.pytests/test_bc_raw_targets.pytests/test_check_pr_description.pytests/test_desc_clock.pytests/test_desc_counts.pytests/test_dev_packs.pytests/test_device_lost_exit.pytests/test_dispatch_clock.pytests/test_dlss_checks.pytests/test_draw_binds.pytests/test_draw_side_effects.pytests/test_draw_stream_visibility.pytests/test_drawn_page_map.pytests/test_driver_cache_room.pytests/test_driver_faults.pytests/test_dummy_views.pytests/test_equal_depth_margin.pytests/test_fallback_buffer_cleanup.pytests/test_fallback_depth_hold.pytests/test_fallback_loaded.pytests/test_fallback_pipeline_state.pytests/test_fallback_size_policy.pytests/test_flat_map.pytests/test_framegen_preset.pytests/test_fsr_uniform_ownership.pytests/test_gpl_cold_library.pytests/test_gpl_library_cache.pytests/test_handle_lookup.pytests/test_handle_table_arrays.pytests/test_intel_compiler_gate.pytests/test_intel_quick_compute.pytests/test_jobs_failure.pytests/test_jobs_wait_runs_queued.pytests/test_linux_driver_fault_guard.pytests/test_linux_pressure.pytests/test_load_default.pytests/test_masked_clear_failure.pytests/test_mem_trim.pytests/test_menu_env_on.pytests/test_mesh_args_cleanup.pytests/test_mesh_fallback.pytests/test_mesh_fallback_failed_once.pytests/test_mesh_query_feature.pytests/test_module_ids.pytests/test_parallel_dry_marks.pytests/test_parallel_rb_refresh.pytests/test_pass_hazard.pytests/test_pcache_fetch_lock.pytests/test_pcache_header_read.pytests/test_pcache_stamp.pytests/test_pipeline_cache_save.pytests/test_pipeline_notes_open.pytests/test_pipeline_play_cache.pytests/test_pipeline_share.pytests/test_pipeline_state_computes.pytests/test_pipeline_state_counts.pytests/test_pipeline_state_portable.pytests/test_pipeline_states.pytests/test_pipeline_tour.pytests/test_precompile_compute_guard.pytests/test_precompile_pipeline_cleanup.pytests/test_predict_resume.pytests/test_predict_types.pytests/test_predicted_check.pytests/test_prepare_cache_save.pytests/test_prepare_cpus.pytests/test_prepare_seed_stamp.pytests/test_prepare_stall.pytests/test_prepare_workers.pytests/test_prepared_stamps.pytests/test_prof_sampling.pytests/test_program_cache_format.pytests/test_program_cache_one_variant.pytests/test_program_cache_reader.pytests/test_psychov35_dlss.pytests/test_psychov35_taau.pytests/test_push_state.pytests/test_quick_pipelines.pytests/test_radv_mesh_optimizer.pytests/test_reactive_mask.pytests/test_recomplauncher_json.pytests/test_recorder_own_idle.pytests/test_recording_admission.pytests/test_replay_copies.pytests/test_rumble_menu.pytests/test_same_draw.pytests/test_same_dyn.pytests/test_sampler_admission.pytests/test_shader_module_guard.pytests/test_shader_stamp_cache.pytests/test_shader_stamp_inputs.pytests/test_shadow_mask_guard.pytests/test_startup_progress.pytests/test_state_list_plain.pytests/test_taau_env_lookup.pytests/test_taau_fxaa.pytests/test_taau_typed_dispatch.pytests/test_table_track.pytests/test_texture_handle_banks.pytests/test_texture_squeeze.pytests/test_third_party_objects.pytests/test_tls_objects.pytests/test_tree_shadow_mask.pytests/test_ub_threads.pytests/test_upscale_fallback.pytests/test_upscaler_rows.pytests/test_vertex_bind.pytests/test_vk_occlusion_queries.pytests/test_warm_bounded.pytests/run_all.py pcache fallback_loaded pipeline_notes_open gpl_library pipeline_play_cache mesh_fallback warm precompile prepareon Windows: 19 passed.test_make_game_preparefails, as it does on a cleanmainon this PC.vk_draw.cppcompiles with the build's flags: the same three__tryerrors asmain, from a flag my check lacks, nothing else.Not tested:
Must be tested:
Windows, NVIDIA RTX (or any GPU with mesh shaders):
cache\longshot_vk_pipelines.bin's header to stand in for one.Expect
vk: pipeline cache: ... was made for another driver or GPUin the log and a warm-up before the title, then no compiles in play (by hand).Risks
What could break: a start whose cache file is refused now warms the noted pipelines before the game. That can take minutes on a slow PC, once, where play would have stuttered instead. A damaged file counts as refused too, and the same holds.
Turning it off: revert the commit.
Compatibility: nothing changes for a player until their driver changes; the caches and saves are untouched.
Issues
See MagicBeanDev/LongshotLauncher#90 (laggy first start after an NVIDIA driver update).
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.tests/that reads changed source updated in this PR, not weakened.🤖 Generated with Claude Code
ead75bb77aa157ea7137Rebased onto main @
7bacf846(this PR @a157ea71). The 113 checks that read this diff: 3 fail, all three also on main @7bacf846with the same message; nothing else fails. No change to the code.WIP: fix(vk): a driver update warms the noted pipelines again before the game, not in playto fix(vk): a driver update warms the noted pipelines again before the game, not in playView command line instructions
Checkout
From your project repository, check out a new branch and test the changes.