Repository navigation
Conversation
… out (RT-INTEL-IMPORT-SETTLE) Intel's Windows Vulkan driver (32.0.101.7092, Iris Xe) goes on working with a host import's pages after vkAllocateMemory has returned, and loses the device at the next vkQueueSubmit when the pages are freed before it is done, also when vkFreeMemory came first. d3d12_existing_heap opens existing heaps, releases them and frees their pages at once, so the device was already lost when the title-placed buffer's copy was submitted: "ExecuteCommandLists failed: unsupported", then a failed Signal, three times. On an Intel GPU, OpenExistingHeapFromAddress and a title-placed buffer (device slot 133) now copy four bytes out of the new import on the device's queue and wait for that (DeviceState::settle_host_import) before the object is handed out. Other vendors take the same path as before. d3d12_existing_heap gains check_pages_freed_at_once: three existing heaps and three placed buffers released with their pages freed at once, then a copy. On the Iris Xe it fails 10 of 10 times without the layer change and passes with it; an RTX 4060 passes either way. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
runtime/shims/d3d12_vulkan_device.cpp: DeviceState keeps main's host_imports counter and the PR's settle_host_imports flag, and main's allocate_image next to the PR's settle_host_import. In Resource::create_host_buffer (slot 133) main now holds DeviceState::memory_mutex around the import's vkAllocateMemory; settle_host_import allocates its scratch buffer through allocate(), which takes that mutex, so the import records its memory type under the lock and settle_host_import runs once the loop has left it (the recursion GGandCo noted on the PR). docs/d3d12_vulkan.md: main's Images row; the Heaps row gets main's two insertions and the PR's Intel paragraph. Co-authored-by: MalexAson <360820579+MalexAson@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Current main after ProjectLeonida#2566; no new conflicts on top of the earlier carry merge. Co-authored-by: MalexAson <360820579+MalexAson@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Verified by MoonEyes (another owner than OreoFR) on head Unit test only: no run of the title (this is the Vulkan path). AI-assisted (Claude Code). |
KelboLive
left a comment
There was a problem hiding this comment.
The vendor gate, both call sites and the memory_mutex move check out, and the new path is functional on this machine when force-enabled (settle_host_imports = true builds, 3/3 ctests pass, no validation errors). On NVIDIA the feature is inert, as intended.
One blocker for Intel, though, and it is in the queue the new path creates. settle_host_import builds the shared device_.staging_queue as a plain VulkanQueue(*context, info.queue, info.queue_family) (d3d12_vulkan_device.cpp:13941-13942) with neither make_synchronous() nor set_skip_before_execute(true), while staged_copy only configures that queue when it creates it (:16471-16484). Whichever path creates it first wins, and the first host import normally happens at load, so on a real Intel title:
- every later
WriteToSubresource/ReadFromSubresourcecopy lands oninfo.queue, the title's own direct queue, instead of the spare queue the D9 note deliberately picked (:16463-16466); before_execute_/after_execute_(frame write-back and shadow refresh,:22020) now run for every internal staging copy — exactly what the flag at:16483exists to forbid;- with
LEONIDA_SUBMIT_ASYNC>0,execute()only enqueues (:3302,:3312) andstaged_copy'swait_submitted()(:16491) can read a stalesubmitted_gpu_(:3553-3555) and return before the copy ran, soReadFromSubresourcemayunpack()(:16500) stale bytes.
Create the queue exactly as staged_copy does (or use a dedicated one), and prefer make_synchronous() + wait_submitted() over idle() (:13946) — that is vkQueueWaitIdle on the title's shared queue, which the same file notes blocks every submission (:3550-3552).
Test gap worth stating in the body: the new check_pages_freed_at_once passes with the feature on or off on this machine — replacing settle_host_import's body with return true still passes 3/3 — so it guards Intel CI only. One real Intel run before merge would cover what this box cannot.
Everything else here is clean: ctest -R d3d12_existing_heap 3/3, the LEONIDA_SUBMIT_ASYNC=2 run, the docs tests, check_no_game_data, and merge-tree against current main (685 commits behind, clean).
|
Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime ( |
Carries #1259 by @MalexAson, because it conflicts with
mainafter #2566 and the reminder to mergemain(#1259 (comment)) got no answer within the delay of the carry rule. If the author comes back, this carry is dropped.Item:
RT-INTEL-IMPORT-SETTLE-CARRY(claimed in #2570 (comment); original itemRT-INTEL-IMPORT-SETTLE).What this branch is
2702cd33c, unchanged (no rebase, author commits kept).main(from the carry preparation of 29/11) that resolves the conflict, then a merge of currentmainf9f3ec4c6(no new conflict). Both merge commits carryCo-authored-bythe author.What conflicted and how it was resolved
docs/d3d12_vulkan.md:main's Images row; the Heaps row getsmain's two insertions and the PR's Intel paragraph.runtime/shims/d3d12_vulkan_device.cpp(3 hunks):DeviceStatekeepsmain'shost_importscounter and the PR'ssettle_host_importsflag, andmain'sallocate_imagenext to the PR'ssettle_host_import.Resource::create_host_buffer,mainnow holdsDeviceState::memory_mutex()around the import'svkAllocateMemory. The PR calleddevice_.settle_host_import(memory_, i)inside that loop, right after the allocation succeeded;settle_host_importallocates its 4-byte scratch buffer throughallocate(), which takes the same mutex, so calling it there would re-lock it (the recursion GGandCo pointed out on d3d12: on Intel the GPU reads a fresh host import before it is handed out (RT-INTEL-IMPORT-SETTLE) #1259). The loop now only records the imported memory type (imported_type = i) under the lock, anddevice_.settle_host_import(memory_, imported_type)runs once, after the loop and the!memory_check, beforevkBindBufferMemory, outside the lock. Same call, same arguments, same point relative to the bind; its return value is ignored as in the PR. The other caller (OpenExistingHeapFromAddress) holds no lock and is unchanged.The Intel path itself (
settle_host_importstrue only for vendor 0x8086) was not run here: a verifier with an Intel GPU is the useful one.Tests
mainf9f3ec4c6merged), Windows 11, Python 3.12, no GPU used: C++ only: left to this PR's CI (no local C++ build in this run).main), Windows 11, RTX 4070 Laptop:d3d12_existing_heap*,d3d12_host_prefix,d3d12_mapped_plane_async5/5 OK (NVIDIA: the Intel path is not exercised);gta6rtimports identical tomain.python -I scripts/check_no_game_data.pyon every file this PR changes: clean.ctest, the full translator suite).Depends on: none.
Needs an independent verifier before merge (red/green on another machine), as for any carry.
AI-assisted (Claude Code, oreofr-agent).
🤖 Generated with Claude Code