fix(agc): turn off dma-buf import on the NVIDIA proprietary driver #1380
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1380"
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?
Imported from boykopovar/AnyPS5. Originally posted by overlordxrz-source on 2026-10-08T01:14:24Z.
What
Fixes #1289. Since #943, no Vulkan device can be created on the NVIDIA proprietary driver on Linux: the dma-buf write-protection probe that
decideImportWatchruns at device setup fails atvkAllocateMemorywithVK_ERROR_OUT_OF_DEVICE_MEMORY, and every later allocation on that device fails the same way (first visible asvkAllocateDescriptorSets color transfer: Vulkan result -2). The GPU tests then return 77 and are counted as skipped.dma-buf import is now chosen by
DmaBufImportUsable(GuestBufferMemory.cpp): it needsVK_KHR_external_memory_fdandVK_EXT_external_memory_dma_bufas before, and is off whenVkPhysicalDeviceDriverProperties::driverIDisVK_DRIVER_ID_NVIDIA_PROPRIETARY. The driver is read throughVK_KHR_driver_properties(the instance is Vulkan 1.1, so the 1.2 core struct cannot be used without the extension); a driver without that extension is not checked.VulkanDeviceand the recorder test device both use it, so neither the probe nor the shared direct memory imports from815d2747run on that driver. Host-pointer imports are unchanged. This is the first fix proposed in the issue.The cause on the driver side is not known, so the gap is recorded in TechnicalDebt. NVK (
VK_DRIVER_ID_MESA_NVK) and every other driver keep dma-buf import.Tested
Not tested on an NVIDIA GPU or any GPU: I have no NVIDIA/Linux machine. The host is aarch64 Debian 13, where the project cannot be built.
GuestBufferMemory.cpp,VulkanDevice.cppandtests/Recorder.cppcompile for x86_64-linux-gnu (Zig 0.16 clang, libstdc++ 14 headers,-Wall -Wextra); the only warnings on changed lines are the-Wmissing-field-initializersones the surrounding Vulkan struct initialisers already produce.DmaBufImportUsablewas run on its own against a fakevkGetPhysicalDeviceProperties2: NVIDIA proprietary gives false; RADV, NVK and lavapipe give true; withoutVK_KHR_driver_propertiesit gives true and does not query; withoutVK_EXT_external_memory_dma_bufit gives false.python3 tools/check_conventions.py --base origin/mainpasses.It would help if someone with an NVIDIA GPU on Linux could confirm that the agc GPU tests run again (the issue reports 407/407 with
APS5_WRITE_WATCH_IMPORTS=watch, which skips the same probe).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 (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by hashaam1217 on 2026-10-08T02:25:18Z.
Partial check on NVIDIA Linux: RTX 3060 Laptop, driver 595.91.07, merged onto
df16c4c2.DmaBufImportUsablereturns false on the proprietary driver: the dma-buf probe no longer runs.This machine cannot reproduce #1289 itself: main also passes, because
/dev/udmabufis not accessible to this user and the probe fails atopen. Details: https://github.com/boykopovar/AnyPS5/issues/1289#issuecomment-6050898411Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-08T02:45:10Z.
Closing: #1329 makes the same change for #1289 (dma-buf import off for
VK_DRIVER_ID_NVIDIA_PROPRIETARY, recorder device included), was opened first and was run on an NVIDIA GPU. If this one handles something #1329 doesn't, please comment on #1329 with what it misses.Pull request closed