perf(gpu): experimental GPU texture detiling with CPU fallback #604
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/lobomfz--VIctory-xmem!604
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-604"
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?
@tommiehansen on GitHub · 2026-12-05 16:17 UTC · original
tommiehansen:perf/phase8-gpu-detile-upstream-20261205→main· +1791 −3 · 7 files · 23 commits · draftWhy
CPU texture detiling can delay staging/upload preparation. Offloading layout conversion to GPU compute could help large compatible textures, but extra staging allocation and synchronization can make the complete upload slower. The initial software-backend measurements demonstrated exactly that risk.
What changes
Opt-in
VICTORY_GPU_DETILE=1; default remains off. Reject software, unknown and non-AMD adapters before allocating or taking snapshot locks. Admit only conservative shapes: useful payload at least 2 MiB, padding at most 12.5%, combined snapshot/linear allocation at most 64 MiB and bounded dispatch density. A process-wide 256 MiB aligned staging budget is reserved before allocation and held by the prepared resource through list reset. Budget exhaustion or rejected shape uses the original CPU path. Separate diagnostic WARP path retains exactness testing.Benchmark results
Historical diagnostic WARP measurements (four paired blocks per run) are not the current production admission behavior.
Current actual software fallback 47581549678: eight exact paired blocks, preparation +1.64%, total −0.72% median paired. This is a fallback control, not a detile speedup.
Why this should be merged
The bounded implementation makes physical testing of large compatible textures possible without activating the expensive software path or allowing unbounded staging. Retain draft: actual complete AMD upload cost must justify the added dispatch and allocation. The requested allocation ceiling is not measured peak VRAM.
Validation and compatibility
At
fb6b477, 47586341337 passed concurrent reservation (16 workers, exactly four admitted), overflow rejection, abandoned lease and recovery, and eight exact software fallback blocks. 47584091713 passed retention/budget checks; 47580505713 passed shape boundaries and diagnostic copy.Use the pinned AMD runner detile gate with
VICTORY_GPU_DETILE=1andVICTORY_GPU_DETILE_TEST_AMD=1on a physical supported AMD adapter, not forced WARP. Report actual activation, full staging/upload times, memory and exact bytes. Compare #653 separately; no hardware speedup or FPS established.2026-12-06 — allocation amortization
Opt-in
VICTORY_GPU_DETILE_REUSE=1adds exact-size retired staging/linear allocation reuse. At most two idle pairs and 32 MiB retained, included in the existing budget. Last Prepared/flight owner releases or pools allocation; try-lock and idle eviction avoid indefinite waiting. Default remains off. 47599663769 passed actual diagnostic WARP reuse with changed input, exact bytes and budget release; no physical cost claim. Follow-up38d688c4uses identical changing inputs for both reuse arms and requires 16 actual physical reuse hits vs zero when disabled. Current CI. The shared AMD runner now compares fresh GPU allocations vs warm reuse as well as CPU fallback with separate prep and complete upload timing. No default activation pending physical net benefit.2026-12-06 — concurrent retirement and size coverage
CI 47602005100, head
659a4b5c, passed production fallback, changed-source exact diagnostic reuse and new pool lifecycle test: four simultaneously live pairs have unique GPU addresses, no pooling while list-held, two retained idle pairs, actual retired-pair reuse, oversized 40 MiB retention rejection and complete budget release. The common return helper preserves the 32 MiB/2-pair limit.Head
a539786eextends the exact upload/readback fixture to 2/8/16 MiB RGBA8 tiled payloads. CI 47602628481 pending; shared physical gate requires exact matching sizes and reports fresh CPU/GPU and warm GPU reuse separately. Complete measured transfer includes readback common to both arms. No directly matched workload intersection with the linear, twin and BC-specific scopes of #655/#657/#659 established. Physical net timing still required; default off.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.