Repository navigation
Conversation
Owner
Author
|
Upstream PR xcl-dev#1044 was closed or merged. |
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.
When a
Wait32/64BitValueXfalls back to CPU polling (PendingWait::wait_until_satisfied) for a counter inside a sparse VRAM window, CPU memory only holds the last uploaded/copied-back value while GPU writes live in sparse VRAM. This reads back[va, va + width)from sparse VRAM (sparse::readback_now) before spinning and at 10 ms intervals during the sleep loop (plus a final readback on timeout). Addresses item #2 measured in#505(and keeps coherent-window / heap addresses lock-free on the fast path viauma::is_sparse). Part of xcl-dev#505.What is in it
crates/xcl/src/hle/d3d12x/sparse.rs:sparse::contains(va): checksgpu::uma::get().is_some_and(|u| u.is_sparse(va))before takingSTATEto verify an active sparse window coversva.crates/xcl/src/hle/d3d12x/list_x.rs:PendingWait::wait_until_satisfied/wait_until_satisfied_with: preserves the zero-overhead fast path when CPU memory already satisfies the wait; for unsatisfied sparse-window addresses, runssparse::readback_now(va, width)before spinning, throttled at 10 ms intervals while polling, and once on timeout expiry.pending_wait_sparse_readback_pulls_gpu_writes_and_skips_coherentverifying coherent waits never call readback and sparse waits pull delayed writes cleanly.pending_wait_reads_back_gpu_write_in_sparse_windowverifying a realCopyBufferRegioninto a sparse window buffer (invisible to CPU-only polling) is read back and satisfiesPendingWait::wait_until_satisfied.Tested
stable-x86_64-pc-windows-msvc), debug (scripts/test.ps1) and release (cargo build --release -p xcl).cargo test --workspace -- --test-threads=4(scripts/test.ps1): 729 passed, 0 failed, 41 ignored (SKIPPED GPU tests: 2 (no wave64:gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware)).cargo test -p xcl --lib pending_wait_ -- --test-threads=4: 3 passed, 0 failed (run 3 consecutive times with 0 flakes). Inpending_wait_reads_back_gpu_write_in_sparse_window, CPU-only polling (wait_until_satisfied_with(..., false, ...)) fails on the real GPU sparse-VRAM write beforewait_until_satisfiedpasses with sparse readback enabled.Regression run
main:
PR:
Not tested
Wait64BitValueXcounter explicitly lands in a sparse window on main (not yet triggered during our 60 s retail smoke run).AI use
#505and the D3D12.X sync/sparse implementation, wrote the fix and tests, and ran the test suite and retail smoke runs.Mirror of xcl-dev#1044 (auto-synced, do not edit).