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

Merged
Dextroid17 merged 1 commit from upstream-pr/1329 into main 2026-10-08 07:09:20 +00:00
Dextroid17 commented 2026-10-07 23:41:09 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-07T23:41:09Z.


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 815d2747'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 df16c4c2.

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
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4779806178 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1329). Originally posted by [Dextroid17](https://github.com/Dextroid17) on 2026-10-07T23:41:09Z. --- ### 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 815d2747'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 df16c4c2. | | 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 <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes
Dextroid17 commented 2026-10-08 03:10:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-08T03:10:40Z.


@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.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6051381067 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1329#issuecomment-6051381067). Originally posted by [Dextroid17](https://github.com/Dextroid17) on 2026-10-08T03:10:40Z. --- @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 commented 2026-10-08 05:28:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by fisherjoey on 2026-10-08T05:28:44Z.


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 df16c4c2. ctest -R agc_driver -j1:

main df16c4c2 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.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6053023817 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1329#issuecomment-6053023817). Originally posted by [fisherjoey](https://github.com/fisherjoey) on 2026-10-08T05:28:44Z. --- 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` df16c4c2. `ctest -R agc_driver -j1`: | | `main` df16c4c2 | `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.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!1329
No description provided.