Repository navigation
fix(agc): skip Linux host imports of ranges not mapped read-write - #1051
Conversation
|
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.
|
c9bf114 to
4324cc1
Compare
|
Checked the Added one commit: the TechnicalDebt line now says shared mappings of regular files, which the driver also refuses, are not checked for. Merging. |
4324cc1 to
ecfaef0
Compare
NVIDIA (595.91.07) refuses VK_EXT_external_memory_host imports of read-only or executable mappings with VK_ERROR_OUT_OF_DEVICE_MEMORY and then fails every later vkAllocateMemory on the device. Check the range is mapped read-write before importing on Linux, as the Windows path already does for read-only memory, and copy it otherwise. Refs boykopovar#1022
…e mappings Co-Authored-By: Claude <noreply@anthropic.com>
|
Rebased again on current |
ecfaef0 to
80456da
Compare
What
On Linux,
importAllocationnow checks that a range is mapped read-write (GuestMemory::Accessible(base, bytes, true)) before offering it toVK_EXT_external_memory_host. Ranges that fail the check are copied, as any refused import already is. This matches what the Windows branch does for read-only memory. A TechnicalDebt line records the driver behaviour.The NVIDIA driver refuses imports of mappings it cannot pin writable with
VK_ERROR_OUT_OF_DEVICE_MEMORY, and after that everyvkAllocateMemoryon the device fails the same way, including plain device-local allocations. Onmain, the read-only sections of the relinked image are offered for import, so the first refusal ends the title on its next texture or buffer allocation:Standalone repro (no AnyPS5): import one 1 MiB mapping, then allocate 16 MiB of device-local memory.
MAP_PRIVATErwMAP_PRIVATErwMAP_SHAREDrwMAP_SHAREDrwmprotectto r or rxMAP_PRIVATEr or rxMAP_SHAREDrwDirect memory (memfd
MAP_SHARED) is unaffected. Linux write watch uses userfaultfd write protection, so watched pages still read asrwin the mapping and stay importable.Fixes #1022.
Tested
Linux 7.2 (Nobara 44), GCC 16, RTX 5070 Ti, driver 595.91.07.
APS5_NO_HOST_IMPORT=1(about 0.4 fps) was the only way to keep it running. (It still needs Linux: guest paths are resolved case-sensitively, so titles miss files the console would find #1047 to get past its black screen, tracked in Demon's Souls PPSA01341 on Linux: idles on a black screen before the first logo video #1025.)ctest: 380 of 380 pass.agc_driver_lds_atomics64andagc_driver_scalar_sop1are excluded: they also fail on unmodifiedmainon this GPU (the first one hangs it, Xid 109).Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository