fix(agc): skip devices without required BDA features #4847

Open
Isrrael101 wants to merge 1 commit from upstream-pr/4847 into main
Isrrael101 commented 2026-10-12 23:53:09 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Isrrael101 on 2026-10-12T23:53:09Z.


What

The GPU selector accepts a discrete adapter with graphics, compute and presentation queues before checking its required BDA features. WSL's Dozen adapter for an RTX 3060 is selected despite lacking VK_KHR_8bit_storage, so device initialization fails instead of using the available compatible lavapipe device.

Probe the existing byte-storage and buffer-device-address requirements before accepting each candidate. Log the rejection reason and continue selecting among compatible adapters. Explicit ANYPS5_GPU filtering still applies. Document the selection requirements.

Tested

Ubuntu 26.04 under WSL, Intel i7-11370H, Mesa 26.2.4. Full relinker and patched system-library build completed.

  • agc_driver_device_selection passed with Dozen and lavapipe both installed; the unsupported NVIDIA and Intel Dozen adapters were skipped.
  • agc_driver_bda_device passed with VK_DRIVER_FILES=/usr/share/vulkan/icd.d/lvp_icd.json (the default adapter skips this test because it lacks byte storage).
  • Eight existing tests covering guest exception handlers, raised exceptions, address synchronization, _umtx_op, guest module directories and Intel conversion passed.
  • Conventions and git diff --check passed.
  • 7 Days to Die - Console Edition (PPSA16645) rendered its loading screen and reached the license-agreement screen with automatic lavapipe selection. A five-minute run and a subsequent six-minute run completed without the startup abort, ending at the configured time limits. The agreement was not accepted. Gameplay and online services are not verified; this is not a full compatibility claim.

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; no silent stubs added
  • No notes, investigation files or images added to the repository
  • No new third-party code
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: PPSA16645 startup GPU selection; no existing Game bring-up discussion found; gameplay remains unverified
  • AI-assisted: yes, with Codex
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4836364637 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4847). Originally posted by [Isrrael101](https://github.com/Isrrael101) on 2026-10-12T23:53:09Z. --- ### What The GPU selector accepts a discrete adapter with graphics, compute and presentation queues before checking its required BDA features. WSL's Dozen adapter for an RTX 3060 is selected despite lacking `VK_KHR_8bit_storage`, so device initialization fails instead of using the available compatible lavapipe device. Probe the existing byte-storage and buffer-device-address requirements before accepting each candidate. Log the rejection reason and continue selecting among compatible adapters. Explicit `ANYPS5_GPU` filtering still applies. Document the selection requirements. ### Tested Ubuntu 26.04 under WSL, Intel i7-11370H, Mesa 26.2.4. Full relinker and patched system-library build completed. - `agc_driver_device_selection` passed with Dozen and lavapipe both installed; the unsupported NVIDIA and Intel Dozen adapters were skipped. - `agc_driver_bda_device` passed with `VK_DRIVER_FILES=/usr/share/vulkan/icd.d/lvp_icd.json` (the default adapter skips this test because it lacks byte storage). - Eight existing tests covering guest exception handlers, raised exceptions, address synchronization, `_umtx_op`, guest module directories and Intel conversion passed. - Conventions and `git diff --check` passed. - 7 Days to Die - Console Edition (PPSA16645) rendered its loading screen and reached the license-agreement screen with automatic lavapipe selection. A five-minute run and a subsequent six-minute run completed without the startup abort, ending at the configured time limits. The agreement was not accepted. Gameplay and online services are not verified; this is not a full compatibility claim. ### Checklist - [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 - [x] Unimplemented paths throw; no silent stubs added - [x] No notes, investigation files or images added to the repository - [x] No new third-party code - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Unblocks: PPSA16645 startup GPU selection; no existing Game bring-up discussion found; gameplay remains unverified - [x] AI-assisted: yes, with Codex
BunnyFl commented 2026-11-02 21:36:13 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by BunnyFl on 2026-11-02T21:36:13Z.

Review: APPROVED


Reads right. QueryBdaByteFeatures and QueryBdaFeatures refuse a missing extension or feature through Graphics::Require, which throws std::runtime_error (Graphics/include/Context.hpp:31-41), so the new catch in the selection loop sees exactly those refusals and moves to the next device. The device chosen is then queried again with the same two calls (Execution/src/VulkanDevice.cpp:1061-1062 at this head). Those calls throw on the same conditions there (VulkanDevice.cpp:1061-1062), so a device skipped by the new check would have failed that setup anyway and no previously working GPU is lost. With ANYPS5_GPU naming only an unsupported device, selection still ends in the "no usable device whose name contains ANYPS5_GPU=..." error (:1027), after the skip reason is logged.

Tested on Windows 11, WinLibs GCC 15.2.0, with this head merged onto main: agc_driver_device_selection, agc_driver_bda_device and agc_driver_bda_device_selection_cpu pass, nothing skipped. The ctest output of this run has no "Skipping physical device" line. The Dozen case itself wasn't reproduced here.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5743704102 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4847#pullrequestreview-5743704102). Originally posted by [BunnyFl](https://github.com/BunnyFl) on 2026-11-02T21:36:13Z. **Review:** APPROVED --- Reads right. `QueryBdaByteFeatures` and `QueryBdaFeatures` refuse a missing extension or feature through `Graphics::Require`, which throws `std::runtime_error` (`Graphics/include/Context.hpp:31-41`), so the new `catch` in the selection loop sees exactly those refusals and moves to the next device. The device chosen is then queried again with the same two calls (`Execution/src/VulkanDevice.cpp:1061-1062` at this head). Those calls throw on the same conditions there (`VulkanDevice.cpp:1061-1062`), so a device skipped by the new check would have failed that setup anyway and no previously working GPU is lost. With `ANYPS5_GPU` naming only an unsupported device, selection still ends in the "no usable device whose name contains ANYPS5_GPU=..." error (`:1027`), after the skip reason is logged. Tested on Windows 11, WinLibs GCC 15.2.0, with this head merged onto `main`: `agc_driver_device_selection`, `agc_driver_bda_device` and `agc_driver_bda_device_selection_cpu` pass, nothing skipped. The ctest output of this run has no "Skipping physical device" line. The Dozen case itself wasn't reproduced here.
MarcZX10 commented 2026-11-23 03:08:14 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-23T03:08:14Z.

Review: APPROVED


Reviewed — looks good

The reviewed change at b05e5cf8ecf4f410750c38a6f281f273babb816d checks BDA and byte-storage requirements before adapter selection, and the inspected code supports merging.

What I ran

No commands or tests were run. I read the supplied diff and targeted code through repo_read.py.

Results

Check Result Note
Diff and changed code review passed Both changed files reviewed
Tests not run Test results in the PR description were not independently verified

Findings

Blocking

None.

Non-blocking

None.

Not verified

The PR's reported builds, tests, and game startup runs were not independently verified. No negative control was run. Files read: description.md, commits.md, manifest.json, diff.patch, core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp (targeted ranges), core/libs/prx/libSceAgcDriver/Execution/src/BdaFeatures.cpp, and docs/user/USAGE.md (targeted range). No changed files were excluded; both files marked reviewed in the manifest were read.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6016131322 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4847#pullrequestreview-6016131322). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-23T03:08:14Z. **Review:** APPROVED --- # Reviewed — looks good The reviewed change at `b05e5cf8ecf4f410750c38a6f281f273babb816d` checks BDA and byte-storage requirements before adapter selection, and the inspected code supports merging. ## What I ran No commands or tests were run. I read the supplied diff and targeted code through `repo_read.py`. ## Results | Check | Result | Note | |---|---|---| | Diff and changed code review | passed | Both changed files reviewed | | Tests | not run | Test results in the PR description were not independently verified | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified The PR's reported builds, tests, and game startup runs were not independently verified. No negative control was run. Files read: `description.md`, `commits.md`, `manifest.json`, `diff.patch`, `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` (targeted ranges), `core/libs/prx/libSceAgcDriver/Execution/src/BdaFeatures.cpp`, and `docs/user/USAGE.md` (targeted range). No changed files were excluded; both files marked `reviewed` in the manifest were read. ## To get this to a good state Nothing is required.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/4847:upstream-pr/4847'
git switch 'upstream-pr/4847'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/4847'
git switch 'upstream-pr/4847'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/4847'
git switch 'upstream-pr/4847'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/4847'
git switch 'main'
git merge --squash 'upstream-pr/4847'
git switch 'main'
git merge --ff-only 'upstream-pr/4847'
git switch 'main'
git merge 'upstream-pr/4847'
git push origin 'main'
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!4847
No description provided.