Repository navigation
Conversation
|
ProjectScarlett run on the RX 6700 XT without the preload, as asked on #191. Short version: with this PR's Setup: RX 6700 XT (
What the failing runs have in common
I don't have a stack for the hung thread, only the watchdog's, so I can't say where it is waiting. Since the provider is identical in rows 1 and 2, it is something the title does through XMem between creating that first raster pipeline and its first compute pipeline.
Update, same day: the runs above shared the machine with other GPU tests of mine, so I repeated them with nothing else running (no other Proton guest or compile in any 5 s sample, load below 5), alternating the two trees:
Same crash log and same last provider line. So it is not a load effect: five of five runs with this PR's |
|
Thanks @JeffreyBytes for running that and catching the Moving this PR to Draft while we track down the root cause in |
|
Updated in Root causes & fixes
Verification (
|
80e55e1 to
5a795cb
Compare
|
Rebased cleanly onto First, sorry @JeffreyBytes for asking you to test the initial revision before we had run it locally ourselves, and thank you for catching the Real-world RX 6900 XT (
|
|
Independent NVIDIA control run for 5a795cb on main e76ff6a: RTX 4080 (10de:2704), NVIDIA 620.73.4, GE-Proton11-14. Rebuilt XMem, D3D12 provider, XMem guests and Lanes. Six isolated D3D12 memory controls passed: buffer-remap, buffer-layout, buffer-import, buffer-import-reject, buffer-unmap-alive, buffer-unmap-released (2,816 checked words in first three, no stand-ins). Fresh-prefix 15/15 selected guest gates: all 12 XMem gates, heaps, tables, Lanes replay. This verifies NVIDIA synthetic compatibility, not the AMD performance claim or retail execution. No changes to your PR branch. |
|
Retest on the RX 6700 XT, no preload, nothing else running on the machine: Setup: as above ( What works now
For comparison, the copy path on What still fails
The order of events is the same in all three: There is no The error code is the difference from the preload runs, which stopped at the same remap batch with If that is right, the rule would be that an address a held backing still covers stays private memory until the hold is released, whatever a remap or a promotion wants to put there. Two other things from the logs, in case they are useful:
Happy to rerun on a new commit, or with extra logging if you want to see which range is refused; the whole cycle takes about five minutes. |
|
Thanks @JeffreyBytes for the detailed 3-run RX 6700 XT logs — especially noting that Pushed
Verification (
|
|
I found a separate, reproducible coherence failure on your current head Two small regression tests in
The arena hold retains an Arc, not a view_holds entry. This is a demonstrated CPU-side model of stale backing writes, not proof of the AMD EPERM/device-loss cause. The tests are on my fork only; no new PR or change to your branch. |
…slots - Attach BackingGuard (ShadowPages + Hold) directly to each native ID3D12Heap via SetPrivateDataInterface so host memory remains pinned past vkd3d-proton's d3d12_resource_destroy (private_store teardown before d3d12_heap_decref / vkFreeMemory). - Keep held PrivateSpan slots PAGE_READWRITE instead of PAGE_NOACCESS when remapped as SecondaryAlias. - Return ERROR_INVALID_ADDRESS (not ERROR_NOT_FOUND) from resolve_backings for unmapped ranges in deferred_unmaps / XMem apertures, prevent coalescing across distinct BackingOrigins, and restore bookkeeping on deferred unmap/decommit failure. - Restore strict MEM_COMMIT + PAGE_READWRITE check in validate_shared_range, keeping the XMem-backed exemption scoped to place_gpu_target. - Add unit tests in heap_backing.rs and physical_backing.rs.
|
Retest of Setup: as before (
In all three the present rate falls steadily, then the last intervals are one to four frames in 14 to 18 s with lines like: The kernel log has the matching Memory. For run 3 I sampled the amdgpu counters (
The control dies at 144 s at the remap batch ( Lock errors: Happy to rerun with extra logging (for example the live hold count and total held bytes over time) if that helps. |
|
Update, with a correction to the memory comparison above. I reran both sides with What the traced runs show (
What I can't tell from this: whether the opens after the remap are the title legitimately streaming more than a 12 GB card can hold at 3840x2160, or imports that were retired by the remap staying alive (as far as I can read |
…alias memory - Track PrivateArena hold counts in Pool::arena_holds, adopt unheld PrivateArenas directly as PrivateView(cpu) (MEM_PRIVATE), and export TuxBoxSetBackingInvalidationCallback wired to GPU_APERTURE.retire_range so held-arena promotions retire stale d3d12 imports outside POOL's lock. - Skip populate_page_bytes and snapshot-copying for SlotRole::GpuAlias so GPU alias pages stay untouched zero-pages instead of dirtying duplicate physical RAM. - Export read-only TuxBoxIsPhysicalBacked for d3d12's is_backed_range check so place_gpu_target does not allocate phantom PrivateArenas. - Cache scattered import_scattered_buffer piece heaps in PagePools::pieces. - Add opt-in TUXBOX_TRACE_XMEM_BACKING=1 periodic hold/arena/deferred diagnostics. - Add regression tests in physical_backing.rs and heap_backing.rs.
0e927be to
d50a51c
Compare
|
Rebased onto latest Re: @Valdi320 (
|
|
Retest of
So about 1.4 GiB under hold at the end, no live arenas, and From this card's side I have nothing left against the PR: the One thing that is still different from your card, in case it means something: |
Implements the
runtime/xmem/half of #191 so RADV can import XMem physical pages directly viaVK_EXT_external_memory_hostwithout hitting libdrm'sAMDGPU_GEM_USERPTR_ANONONLYrejection or falling back to the #200 shadow copy. Pairs with #218 (already onmain) and #253.Part of #191
Summary
MEM_PRIVATE,PAGE_READWRITE):MEM_PRIVATEpages inside placeholder apertures rather than section views (runtime/xmem/src/physical_pages/private_views.rs,runtime/xmem/src/shared_pages.rs).SharedSectionso existing multi-view CPU aliases remain coherent.PrivateArena(VirtualAllocMEM_PRIVATE).runtime/xmem/src/physical_pages/backing.rs):TuxBoxAcquirePhysicalBacking,TuxBoxAcquirePhysicalBackingRuns, andTuxBoxReleasePhysicalBackingasPRIVATEsymbols inruntime/xmem/xmem.def.TuxBoxReleasePhysicalBacking(hold)drops the last reference, keeping importedMEM_PRIVATEhost pages valid across live GPU submissions.runtime/xmem/src/tests/physical_backing.rs):ERROR_NOT_FOUNDon foreign memory, held CPU views surviving unmap/free,PrivateArena+ conflicting-orderBackingRunsplitting +ERROR_MORE_DATA, and lazySharedSectionpromotion on a second CPU view.Verification
Tested on RX 6900 XT (
1002:73bf), Linux (7.3.6-1-cachyos), GE-Proton11-14 (1795427215), RADV:cargo check --locked --target x86_64-pc-windows-msvc --manifest-path runtime/xmem/Cargo.toml: passed (0 warnings)cargo test --locked --target x86_64-pc-windows-msvc --manifest-path runtime/xmem/Cargo.toml -- --test-threads=1: 4/4 passed (physical_pages::backing::tests)python -m unittest tests.test_repository_hygiene: 5/5 passedtools/check_d3d12_regressions.py --case buffer-remap --adapter 1002:73bf:PASS(4.418s,d3d12-buffer-remap PASS pci=1002:73bf words=768/768 identical=1 replacement=1,null_fallback_enabled: false)TuxBox d3d12_xs: game memory is imported through its XMem backingand threepath=importedentries, with zerocopied for the GPUmessages.tuxbox.py check --adapter 1002:73bf: all 10 groups passed:Lanes and fixtures on the GPU: 72/72 passed (170s, includingxmem-pagesandxmem-scatter)D3D12 regression controls: 19/19 passed (85s)Shader translator on the GPU: 40/40 passed (238s)