Repository navigation
Conversation
…naries across updates Re-apply boykopovar#13931, reverted in boykopovar#14839, including the maintainer's architecture notes and pipeline-binary skip message. Preserve main's Recorder TestConfigurationError handling while restoring the binaryTest constructor argument. Retain main's debt entries. Link the binary-store test against libSceAgcDriver after main moved DeviceProcLookups out of the header. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On an NVIDIA Linux driver, device creation crashed right after the global pipeline-binary key query returned VK_SUCCESS, so boykopovar#13931 was reverted in boykopovar#14839. The cause is not established. Key queries now write into a guarded scratch output, and the store is enabled only when the result, sType, pNext, key size and guard are all valid; otherwise it stays disabled with one log line and the driver pipeline cache is used. This catches bounded output overruns and malformed keys, not a driver that corrupts registers. agc_driver_pipeline_binary_startup creates the production device with the shader cache enabled and requires the store to be ready where the device has VK_KHR_pipeline_binary. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resolve the descriptor-layout conflict in VulkanDevice.cpp: keep main's scratch pool layouts and let the binary key tell 0, 1 or 2 extra sets apart, so keys of layouts without a scratch pool stay the same. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019xuZ6BonuXDhiVUjiuoLx2
Contributor
Author
|
@oneandonlydean I merged AI-assisted: yes (Claude Code) |
This branch has not been deployed
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.
What
I reapply #13931, reverted in #14839: driver pipeline caches survive source updates, and eligible compute pipelines are captured and restored with
VK_KHR_pipeline_binary, with ordinary driver-cache fallback. Against mergedmaind893997f1aI keep main's recorder error handling and debt entries, and link the store test againstlibSceAgcDriverbecauseDeviceProcLookupsmoved out of the header. After mergingmaind893997f1a, the binary layout key also tells main's scratch-pool layouts apart (0, 1 or 2 additional descriptor sets); layouts without a scratch pool keep the same contribution to the key.New in this PR: global and per-pipeline key queries write into separate, 64-byte-aligned heap scratch followed by a 64-byte guard filled with
0xa5, and a key is accepted only afterVK_SUCCESS, an intact guard, the expectedsType, a nullpNextand a size from 1 toVK_MAX_PIPELINE_BINARY_KEY_SIZE_KHR.A rejected per-pipeline key falls back to an ordinary build for that pipeline. I have not found the cause of the NVIDIA Linux startup crash in the code: the call uses the Khronos function-pointer type from the device resolver, the output structure is initialised, and the feature is enabled before the call. These checks detect malformed keys and writes that reach the guard; they cannot contain arbitrary driver corruption or clobbered registers, and they cannot stop a crash inside the call.
APS5_NO_PIPELINE_BINARIESstill turns the store off before the call. I am keeping this PR as a draft so it can be checked on the affected machine first.Tested
Windows, NVIDIA GeForce RTX 4080, driver 610.88. No title or performance claim.
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,ctest -j 1 -V, the 134 existing tests registered in the files this PR touches (pipeline cache, recorder and Vulkan test-device tests):maind893997f1a134/134, this PRc8244e0269134/134. The validation layer loaded in both logs, neither reports a missing requested layer, and neither has aVUID-orSYNC-HAZARD-line.sTypeor non-nullpNextfor global and per-pipeline keys, a corrupted guard and the fallback after a rejected global key. The new tests require the added scratch type andIsReady; their passing results do not reproduce the Linux crash. With the startup test,agc_pipeline_binary_vulkanand threeagc_pipeline_cache_allocationmodes, all 17 tests this PR adds pass under the settings above.agc_driver_pipeline_binary_startup(new): creates the production device with the shader cache enabled in a temporary directory and requires the store to be ready when the device hasVK_KHR_pipeline_binary(exit 77 withskipped, the device lacks VK_KHR_pipeline_binaryotherwise). Here it printspipeline binary startup: global-key query completed successfully; store ready; device=NVIDIA GeForce RTX 4080; driver=NVIDIA 610.88.ANYPS5_NO_SHADER_CACHEnorAPS5_NO_PIPELINE_BINARIESset, validation layer loaded): 83/83 pass: the startup test, the binary-store and pipeline-cache tests,agc_driver_small_copy_sync, bothagc_driver_address_passestests, the otheragc_drivertests that do not disable the cache, and the automatically addedagc_driver_pm4_replayfixture (which disables the shader cache itself). NoVUID-line.agc_pipeline_binary_vulkansaves binary records for two pipelines and restores both in the next process. Onmaind893997f1a, the 65 of these tests that exist there, plus the fixture, pass 66/66. The binary round-trip test uses trivial shaders and an empty layout, so it does not test scratch-pool layouts.This machine never reproduced the crash, so these runs show the path works here, not that the Linux crash is gone. @oneandonlydean, you offered to test a candidate on the affected RTX 4090: could you run this on that installation after building this branch?
env -u ANYPS5_NO_SHADER_CACHE -u APS5_NO_PIPELINE_BINARIES \ ANYPS5_REQUIRE_VULKAN=1 \ VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \ ctest --test-dir build -j 1 -V \ -R '^(agc_driver_pipeline_binary_startup|agc_pipeline_binary_(vulkan|store.*)|agc_pipeline_cache.*|agc_driver_small_copy_sync|agc_driver_address_passes_(targets_split|draw_transitions))$'The most useful result for me would be the startup line (
store ready), the[pipeline-binary] disabled: unusable global key (...)line, which names why the key was rejected and reports the driver-cache fallback, or a backtrace ifvkGetPipelineKeyKHRstill crashes. A run without the validation layer, as in your report, would also help. I will mark this ready for review only after that result.Checklist
main; no other open PR implements the same functionsMerged with
maind893997f1a, without a force-push; a trial merge with the newerd48f11ab16has no conflicts. Before this merge,tools/pr_overlap.pyreported conflicting lines with fix(agc): build one compute pipeline when results differ only in a table's size #8212, perf(agc): GPU descriptor heap on VK_EXT_descriptor_heap (APS5_GPU_HEAP) #9508, perf(agc): copy only the vertex records a draw fetches #9875, fix(agc): read capture deltas and replay them while queues wait on the title #12567, fix(agc): leave GPU-stored words out of frame capture deltas #12568, fix(agc): relaunch the frame replay when a host region blocks a captured GPU range #12696, perf(recompiler): back compute scratch with a device buffer slot pool #12764, fix(agc): write back BDA stores into writable heap mirrors #12840 and test(agc): enable the portability subset with its features in the recorder tests' device #13942 (ARCHITECTURE.md,VulkanDevice.cpp,Recorder.cpp), and some comparisons could not be completed. A GitHub search found no open PR implementing driver pipeline caches or pipeline binaries.NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt fileNo unimplemented exports or silent stubs are added.
.mdfiles or images added to the repository (attach them to this PR)No third-party code is added.
🤖 Generated with Claude Code