Repository navigation
Conversation
MarcZX10
left a comment
There was a problem hiding this comment.
I reviewed the unlocked prewarm path and its fallback: preparation only creates a pipeline when Stage A already has a descriptor layout, successful objects are shared through the variant/push-stage cache, and failures fall back to the locked creation path. The dispatch still completes the same prepared resources before recording. The focused cache tests and Windows runtime evidence are documented in the PR; CI conventions/eligibility/intake/report pass, while platform build jobs are skipped. I did not independently run the GPU tests here.
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
|
|
Closing as a duplicate of #4897, which moves the same pipeline creation out of GpuMutex, opened first. It also lets two queues share one creation of a variant and keeps a failed creation an error, where this one swallows it with catch (...) and retries it under the lock. |
What
Pre-warms compute pipelines in
VulkanDevice::PrepareDispatch(andPrewarmComputePipeline) outsideGuestMemory::GpuMutex(), adopting the cached or prepared pipeline objects inVulkanDevice::dispatch.On
main, compute pipelines were compiled synchronously insideVulkanDevice::dispatch()while holdingGuestMemory::GpuMutex(). When games dispatch large compute programs (such as Astro Bot PPSA21567 with 871,935 SPIR-V words),vkCreateComputePipelinesstalled queue 0x40 under the GPU mutex for 12,188 ms, starving queue 0x0 and freezing presentation for over 12 seconds.This change:
PrepareDispatchoutside the GPU mutex when descriptor layout is available (res->Layout() != VK_NULL_HANDLE), caching it instate->computePipelines.dispatch, bypassing synchronous compilation under the lock and eliminating lock starvation across queues.lockedBuild) whose layouts are not yet finalized in Stage A.createComputePipelinedefensively against uninitialized descriptor layouts.VertexFetch.cppverifying invalid SPIR-V rejection, pipeline pre-warming, cache lookup, and no-recreation on subsequent dispatches.docs/dev/ARCHITECTURE.md.Tested
Multi-sample Telemetry (#218):
Measured in Astro Bot (
PPSA21567) across repeated alternating runs during boot and level loading (worldmap) withAPS5_PROFILE_DRAW=1on RTX 5060 Ti 8GB, comparing againstorigin/main(665ad7da7):main(665ad7da7)main + PR(ff3f918fb)GpuMutexholdUnit Cost Breakdown:
vkCreateComputePipelinesavoidance under mutex: ~12,188 ms saved on large compute programs (871,935 SPIR-V words), amortized across 5,300+ dispatches to an average hold of 0.2 ms vs 12,188 ms.Unit Tests:
tests/agc_driver_vertex_fetch_testswith pinned assertions (Require):PrepareDispatchand not cached.computeShadernot cached prior to prewarm.PrepareDispatchprewarms pipeline, increasingComputePipelineCount()from baseline by exactly 1.PrepareDispatchandPrewarmComputePipelinereuse the cached object with count unchanged.tests/agc_driver_testsandtests/agc_driver_oversized_dispatch_tests.python3 tools/check_conventions.py(0 errors).Checklist