Skip to content

fix(agc): keep dma-buf import off the NVIDIA proprietary driver - #1329

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
Dextroid17:fix/agc-nvidia-dmabuf-probe
Oct 8, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
Dextroid17:fix/agc-nvidia-dmabuf-probe

Conversation

@Dextroid17

Copy link
Copy Markdown
Contributor

What

This is #1289, reproduced first-hand on a different NVIDIA stack (details below).

Since #943 every GPU test fails on the NVIDIA proprietary Linux driver: ProbeDmaBufImportWriteProtection runs while each device is set up, and on this driver its import corrupts the device. The import succeeds, the allocation right after it fails with VK_ERROR_OUT_OF_DEVICE_MEMORY, and every later allocation on that device fails with it.

This keeps dma-buf import off VK_DRIVER_ID_NVIDIA_PROPRIETARY, which is option 1 from the report: neither the probe nor 815d274's shared-backing imports run there. No test provides shared backing, so those imports are not exercised by the suite; they are left off rather than assumed to work on this driver. The Recorder test device takes the same decision, so a developer build behaves like the shipped one.

Tested

Linux (CachyOS, GCC, Release, BUILD_TESTING=ON), RTX 3080 Ti, driver 615.71.09, main at df16c4c.

without this change with it
full suite, ctest -j 16 324 / 408 pass (84 fail) 408 / 408 pass
ctest -R agc_driver -j 16 82 / 166 pass (84 fail) 166 / 166 pass

The 84 failures without the change all carry the report's line:

[write-watch] dma-buf imports keep write protection: unknown (probe failed at vkAllocateMemory, -2); imported ranges are compared

One difference from the reporting machine: the device is created here (Vulkan device ready device=…) and the corruption shows up at the next allocation — vkCreateComputePipelines: Vulkan result -13 in the first failing test — rather than at vkAllocateDescriptorSets. Same probe line, same trigger.

Control that places the probe rather than the imports: APS5_WRITE_WATCH_IMPORTS=watch skips both probes while leaving context.dmaBufImport set, and the suite is green (408/408). So the probe is what breaks the device here.

agc_driver_recorder_tests (EXCLUDE_FROM_ALL) still builds after the same change. No CI test is added: CI runs on lavapipe, whose driver id is not NVIDIA, so the new condition never fires there and a test of it there would assert nothing. The measurement above is the evidence instead.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes

The dma-buf import probe corrupts the device on the NVIDIA proprietary Linux
driver: the import itself succeeds, the allocation right after it fails
(vkAllocateMemory, VK_ERROR_OUT_OF_DEVICE_MEMORY), and every later allocation on
that device fails with it. The probe runs while each device is set up, so every
GPU execution test on that driver fails.

Measured on an RTX 3080 Ti, driver 615.71.09, main at df16c4c, ctest -j 16:

- without this change: 84 of 408 tests fail, all 84 of them agc_driver
  execution tests (84 of 166);
- APS5_WRITE_WATCH_IMPORTS=watch, which skips both probes but leaves
  context.dmaBufImport set: 408 of 408 pass, which places the probe, not the
  shared-backing imports, at the failure.

dma-buf import is now off on VK_DRIVER_ID_NVIDIA_PROPRIETARY, which stops the
probe and 815d274's imports together. No test provides shared backing, so those
imports are not exercised here; they are left off rather than assumed to work on
this driver. The Recorder test device takes the same decision, so a developer
build behaves like the shipped one.

Tested: Linux (CachyOS, GCC, Release, BUILD_TESTING=ON), full suite 408 of 408
with the change, 324 of 408 without it. CI runs on lavapipe, whose driver id is
not NVIDIA, so the new condition does not fire there.
@Dextroid17

Copy link
Copy Markdown
Contributor Author

@adriadam10 ready for eyes — keeps the dma-buf import probe off on the NVIDIA proprietary driver, in VulkanDevice.cpp and the duplicate decision in tests/Recorder.cpp. Four checks green.

@fisherjoey

Copy link
Copy Markdown
Contributor

Reproduced on 595.91.07, the driver where #1289 didn't reproduce for @hashaam1217. Here the user can open /dev/udmabuf (logind ACL), so the probe gets as far as the import.

Nobara 44 (Linux 7.2), GCC 16.2.1, Release, BUILD_TESTING=ON. This PR merged onto main df16c4c. ctest -R agc_driver -j1:

main df16c4c main + this PR
RTX 5070 Ti, driver 595.91.07 66 / 166 pass 166 / 166 pass
RADV (Ryzen 5 7600X iGPU, Mesa 26.2.1) 166 / 166 pass 166 / 166 pass

All 100 failures on main log [write-watch] dma-buf imports keep write protection: unknown (probe failed at vkAllocateMemory, -2); imported ranges are compared. After that, 70 fail with vkCreateComputePipelines: Vulkan result -13, 29 with Vulkan result -2, and one times out. The CPU tests (-E agc_driver) give the same result as on main: only guest_force_tls_destructor fails, on both.

So the driver fails the same way on 595.91.07 and on 615.71.09.

@oneandonlydean
oneandonlydean merged commit 051d17d into boykopovar:main Oct 8, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc*

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants