Repository navigation
fix(job-manager): account for GPU barrier command capacity - #10811
oneandonlydean merged 2 commits into
Conversation
MarcZX10
left a comment
There was a problem hiding this comment.
I reviewed the capacity accounting and the new boundary/storage fixtures. git diff --check and the current-main conventions check pass; hosted eligibility, intake, labels, report, and conventions checks pass. The repository path filters skip product builds/tests. I did not run the Vulkan tests locally.
I manually compared the shared Export.cpp hunk with #10249: that PR changes how SubmitCompute reads the shader pointers, while this PR changes completion-packet accounting; the edits are separate and compatible. The new fixture also uses the allowed single outstanding Wait at a time, and the overflow case releases its held GPU gate before checking the tail fence. I found no blocking issue in this diff.
|
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.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
@Felipebmaitan Full CI fails the Windows skip check because the new test |
ahmadmuj
left a comment
There was a problem hiding this comment.
Reviewed head fcbca74 (base 70c72b6), merged locally onto current main 14c99b5 (clean). Linux: WSL2 Ubuntu 24.04, GCC 13.3, Release, lavapipe (llvmpipe, LLVM 20). Since the hosted linux job was skipped, this is the first Linux run I know of.
What I ran:
- Focused suite with
ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation:ctest -R 'agc_driver_job_manager_compute|guest_job_manager|guest_ulobjmgr'is 32/32, no GPU skip. The newagc_driver_job_manager_compute_capacityruns in 0.27 s. - Red control: same tree with main's
libSceJobManager/Export.cpp.barrier_storagefails ("GPU barrier command storage differs from the original module"),barrier_capacity_overflowfails ("GPU sync exceeded the original module command capacity"), andbarrier_capacitystill passes, like you described. Suite 30/32. Restored your file: 32/32 again. - Both AGC tests 20 times with
--repeat until-fail:20 -j 2: all pass, slowest 0.56 s, so the 3 s fence deadline over ~450 submissions has plenty of room on lavapipe. - Validation: the only VUID lines are
VUID-VkDeviceCreateInfo-pNext-pNextfromvkCreateDevice(unknown pNext struct type 1000574000), 6 on main and 6 on this PR. Nothing from the command stream. tools/check_conventions.py --base origin/mainpasses.
I also read the Sequence accounting against the AGC builders. reclaimSyncTail is only set right after a sync reserves syncWords and is cleared on every reclaim, dispatch submit, retire and Open, so commandUsed can't underflow, and a flush never writes past its reservation. With the test shader the sizes come out to 39-word dispatch, 37-word sync, 5-word tail, which gives your 304/284/188/492 distances and 224 groups plus dispatch 225 before sync 225 runs out of space. Main's flat 8-word completion is what the red run trips on.
No issues found. Limits: lavapipe only, no console and no original module here, so the 224 native bound comes from your module run, not from me.
|
@oneandonlydean Addressed in fcbca74: renamed the test to Reproduced the failure locally with Windows CI's |
|
@Felipebmaitan Thanks, the rename and the move to the AGC registrations are what was needed, and both JobManager tests pass here on the new name too. Full CI on this head has already passed on Linux and Windows, including |
What
The capacity overflow test is registered with the AGC execution tests as
agc_driver_job_manager_compute_capacity, so Windows CI's unchanged skip policy recognizes the intentionally unbuilt execution-test stub.Supersedes #10300, which GitHub refuses to reopen even with its original head restored.
Match the original module's bounded command-area use across GPU barriers. With two large markers followed by small dispatches, native accepts 224 GPU+Sync groups, accepts Dispatch 225, then exhausts on Sync 225; current main's smaller completion packets admit all 255 groups.
Measure the Sync footprint and reclaimable tail with the existing AGC builders. Pure GPU Sync reserves the full footprint; consecutive empty Syncs consume no additional space; terminal CPU/Wait work reclaims the unused tail. Mixed CPU/GPU groups use normal completion packets. Encode each boundary once so work submitted ahead of an older Sync retains its own accounting. Submission still uses explicit release packets; the native Rewind/protocol difference remains recorded in debt.
Refreshed onto main
70c72b6d5c81f5e8f119a1d543d5312340917493after all prerequisites merged (#10166, #10188, #10202, #10213, #10231, #10244, #10254, #10264, #10272). The diff now contains only this capacity topic, its tests and the directly related debt entry. Preserve main's canonical API headers and worker-wait wakeup fix; adapt new fixtures toISequence. The last-minute #8988getrusagepointer-safety merge was also incorporated;git range-diffconfirms the reviewed capacity patch is unchanged by that rebase. After the paired runs, main advanced through #9169, #9529, #9059 and #9519. Their socket, LibreSSL, TLS-export and FreeType changes do not touch this topic;git merge-tree --write-tree HEAD origin/mainmerges cleanly againstd8db8faef5. The paired test results remain pinned to70c72b6d5c. No speed claim.Tested
Windows 11 Pro / WinLibs GCC 15.2.0, NVIDIA GeForce RTX 5080 driver 621.01:
Exact main
70c72b6d5c: focused JobManager/ulobjmgr CTest 31/31 passed, 17.11 seconds. Updated implementation: 32/32 passed, 18.11 seconds. These are correctness runs, not performance measurements.Both runs used
ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validationandctest -Von the same machine/GPU. Main and change each contain zeroVUID-messages and zero missing-validation-layer messages; no GPU skips.Red/green on
941ace5f34(its JobManager source is unchanged by the subsequent fix(libkernel): check getrusage output pointers #8988 merge): run the newbarrier_storageandbarrier_capacity_overflowfixtures against a rebuilt main JobManager, then the updated JobManager. Main exits 1 with the expected spacing/capacity assertions; this change exits 0 for both. The positive capacity fixture covers 224 groups, guard bytes, and storage reuse after Wait; overflow must reject Sync 225 while preserving already submitted work through a separate tail fence.Adversarial source review covered integration, capacity arithmetic, boundary encoding, pure/empty/mixed/terminal barriers, lookahead, waits, reuse, locking and shutdown. It found an unexpected-exception cleanup hazard in the new fixtures; a scope guard now releases the gate and stops manager/driver workers before gate/fence/packet storage leaves scope. Two follow-up adversarial reviews found no remaining blockers; the final review also verified the native failure is independent of this patch. Three temporary fault-injection executables exercised a held storage gate, an early capacity-loop exception and a pending fence: all returned the expected failure status 1 after cleanup, with no validation errors or missing-layer messages.
Built the current relinker, NID patcher, focused test targets and patched JobManager/AGC/kernel/libc/ulobjmgr/RazorCpu runtime dependencies from source. Conventions and whitespace checks pass. No new third-party dependency or repository investigation file.
cmake --build build --target agc_driver_job_manager_compute_tests guest_job_manager_profiler_tests guest_job_manager_tests guest_job_manager_failure_tests guest_job_manager_registration_tests job_manager_compute_progress_tests guest_ulobjmgr_tests --parallel 12 ctest --test-dir build -R 'agc_driver_job_manager_compute|guest_job_manager|guest_ulobjmgr' -V python tools/check_conventions.py --base origin/main python tools/pr_overlap.py --branch feat/jobmanager-barrier-capacityPython 3.11 was invoked as
python; this Windows machine'spython3command is an inactive Microsoft Store alias.Fresh owned-original-module comparison through normal relinker startup used module SHA-256
881a191e0c7509edc09b7360cfe470bc5692b2ef8ef2fadcbebe0ef23bdb933d, the final compute fixture, shared reference bindings and synthetic application process metadata. Both new positive cases (barrier_storage,barrier_capacity) pass on the host fallback and original module. Native isolatedsize,execution,storage,capacity,deferred_inputsandcompute_shutdownpass as well.Native-reference limitation: the existing
gpu_barriersCPU-release overlap gate fails under the current host driver (WAIT_REG_MEMtimeout;CPU work did not release GPU work beyond its preceding sync). The aggregate nativecomputerun therefore fails too. A separately compiled helper from the exact main fixture reproduces the same native failure. Neither native run stages or loads the changed host JobManager implementation. The host fallback's aggregate compute test passes on main and this change. This inherited native-protocol/parity gap is recorded indocs/dev/debt/libSceJobManager.md; a complete original-module suite pass is not claimed. No fresh Linux, PS5 hardware, or calling-title testing is claimed; the former PR description's old stacked-head results do not certify this refreshed head.Overlap review checked open work and the merged prerequisite stack. #10249 is the only open PR sharing the original three changed files: its JobManager hunk rewrites shader-pointer decoding in
SubmitCompute, independently of this capacity accounting. The overlap tool cannot compare that PR automatically because it already conflicts with main; its hunk was inspected manually. #10717's worker tests, #10654/#8314's other ACB controls and #10744's reference-runner refusals do not implement this change. No open implementation dependency remains.Checklist
Based on current
main; no other open PR implements the same functionsOne topic per PR; follow-ups go in a new PR
No comments in code except technical debt
Unimplemented paths throw (
NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt fileNo notes, investigation
.mdfiles or images added to the repository (attach them to this PR)New third-party code is a submodule built from source
Generic behaviour, not specific to one title
Depends on: none
Fixes: none
Unblocks: none
GPUs tested: NVIDIA GeForce RTX 5080, driver 621.01, Windows 11 Pro
AI-assisted: yes