Repository navigation
fix(agc): turn off dma-buf import on the NVIDIA proprietary driver - #1380
Closed
overlordxrz-source wants to merge 1 commit into
Closed
overlordxrz-source wants to merge 1 commit into
overlordxrz-source wants to merge 1 commit into
Conversation
On the NVIDIA proprietary driver a dma-buf import of a udmabuf fails with VK_ERROR_OUT_OF_DEVICE_MEMORY and every later allocation on the device fails too, so since the import probe ran at device setup no device could be created there. Import dma-bufs only on drivers that are not VK_DRIVER_ID_NVIDIA_PROPRIETARY, in the device and in the recorder test device. Fixes boykopovar#1289
This was referenced Oct 8, 2026
9 tasks done
Contributor
|
Partial check on NVIDIA Linux: RTX 3060 Laptop, driver 595.91.07, merged onto df16c4c.
This machine cannot reproduce #1289 itself: main also passes, because |
Collaborator
9 tasks done
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.
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 from 815d274 run 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)