window: explain why each GPU was rejected in device selection #910

Manually merged
github merged 3 commits from gh-pr/910/head into gh-pr/910/base 2026-11-26 09:36:45 +00:00
Owner

@⁠Aryansh1520 on GitHub · 2026-09-29 18:47 UTC · original
Aryansh1520:fix/explain-gpu-rejection → main · +113 −211 · 1 files · 3 commits · merged 2026-09-29 20:08 UTC

Related to #489

When no GPU meets the requirements, the fatal error now lists each rejected GPU and the reasons encountered during selection. Missing-extension diagnostics name every missing extension, and storage-format diagnostics identify storage-image usage.

Could not find suitable device:
  AMD Radeon 780M Graphics (RADV PHOENIX): fragmentShaderBarycentric is not supported; ...
  NVIDIA GeForce RTX 5060 Laptop GPU: ...

The rejection helper logs and appends directly to the error report. Shared feature and format checks remove repeated conditions and messages without a reason vector or separate report formatter.

Device requirements, check order, selected-GPU filtering, and discrete-GPU preference are unchanged. macOS retains its warning-only feature checks, and both storage-format fallbacks remain intact. Later checks still stop after earlier rejections, so the report lists encountered reasons rather than every unsupported capability.

Validation:

  • Linux clang RelWithDebInfo emulator build passed.
  • Fresh independent audits found no selection or lifetime regressions.
  • Temporary differential harnesses compiled the original and rewritten selection code against the bundled Vulkan types. The initial 1,138 scenarios passed, followed by 5,678 extended scenarios under AddressSanitizer and UndefinedBehaviorSanitizer (2,839 normal and 2,839 with macOS conditional branches). Compared GPU selection, queue, complete selected capabilities, Vulkan query order, logs, fatal conditions, and rejection reports. Covered feature/requirement flags, API versions, extensions, surface usage, format masks and storage fallbacks, anisotropy, mixed GPU groups, requested indices, GPU preference, and literal %/brace characters in GPU names. The comparisons account only for intended report boundary newlines and the four clarified storage messages; separate assertions verify the new wording.
  • Rewritten function formatting and git diff --check passed.
  • Native macOS build and hardware startup were not rerun for this rewrite.
**@⁠Aryansh1520** on GitHub · 2026-09-29 18:47 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/910) `Aryansh1520:fix/explain-gpu-rejection` → `main` · +113 −211 · 1 files · 3 commits · merged 2026-09-29 20:08 UTC Related to #489 When no GPU meets the requirements, the fatal error now lists each rejected GPU and the reasons encountered during selection. Missing-extension diagnostics name every missing extension, and storage-format diagnostics identify storage-image usage. ```text Could not find suitable device: AMD Radeon 780M Graphics (RADV PHOENIX): fragmentShaderBarycentric is not supported; ... NVIDIA GeForce RTX 5060 Laptop GPU: ... ``` The rejection helper logs and appends directly to the error report. Shared feature and format checks remove repeated conditions and messages without a reason vector or separate report formatter. Device requirements, check order, selected-GPU filtering, and discrete-GPU preference are unchanged. macOS retains its warning-only feature checks, and both storage-format fallbacks remain intact. Later checks still stop after earlier rejections, so the report lists encountered reasons rather than every unsupported capability. Validation: - Linux clang RelWithDebInfo emulator build passed. - Fresh independent audits found no selection or lifetime regressions. - Temporary differential harnesses compiled the original and rewritten selection code against the bundled Vulkan types. The initial 1,138 scenarios passed, followed by 5,678 extended scenarios under AddressSanitizer and UndefinedBehaviorSanitizer (2,839 normal and 2,839 with macOS conditional branches). Compared GPU selection, queue, complete selected capabilities, Vulkan query order, logs, fatal conditions, and rejection reports. Covered feature/requirement flags, API versions, extensions, surface usage, format masks and storage fallbacks, anisotropy, mixed GPU groups, requested indices, GPU preference, and literal `%`/brace characters in GPU names. The comparisons account only for intended report boundary newlines and the four clarified storage messages; separate assertions verify the new wording. - Rewritten function formatting and `git diff --check` passed. - Native macOS build and hardware startup were not rerun for this rewrite.
"Could not find suitable device" gave no hint of what was missing; the
reasons only went to the log file, which users often cannot find (#489).

Device selection now records each rejection reason and the fatal error
lists every GPU with its reasons, for example:

  Could not find suitable device:
    AMD BC-250 (RADV GFX1013): fragmentShaderBarycentric is not supported

The missing-extension check also names each missing extension instead of
stopping at the first one without saying which. Device requirements and
selection are unchanged; the log keeps the same messages.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:36:45 +00:00
github manually merged commit e51b3b28e3 into gh-pr/910/base 2026-11-26 09:36:45 +00:00
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-09-29 18:51 UTC · original · edited 2026-09-29 20:08 UTC

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

📝 Walkthrough

Walkthrough

Vulkan physical-device selection now records rejection reasons for unsuitable GPUs. The checks include API version, queues, features, extensions, surface usage, formats, and anisotropy. Existing macOS exceptions for three unsupported features remain non-rejecting. CreateVulkan passes the report to device selection and includes it in the fatal error when no suitable device is found.

Suggested reviewers: nmzik

Priority: ⬇️ Low

Change: Refactor

Merge Risk: 🔵 Low · up to 99748

A rejected GPU may show a misleading reason in the fatal error. Correct the label before merging if practical; the reported issue does not block device selection.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly describes the main change: reporting why each GPU was rejected during Vulkan device selection.
Description check ✅ Passed The description directly explains the rejection-reporting changes, preserved behavior, diagnostics, and validation results.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

**@⁠coderabbitai[bot]** on GitHub · 2026-09-29 18:51 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/910#issuecomment-5896571119) · edited 2026-09-29 20:08 UTC <!-- This is an auto-generated comment: summarize by coderabbit.ai --> <!-- review_stack_entry_start --> <a href="https://app.coderabbit.ai/change-stack/KytyPS5/KytyPS5/pull/910?cs_source=review_comment"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui-dark.svg?v=2" alt="Review in Change Stack →" width="220" height="32"></a> Navigate logical layers of code changes, visualize relationships, and explore their blast radius. <!-- review_stack_entry_end --> <!-- walkthrough_start --> <details> <summary>📝 Walkthrough</summary> ## Walkthrough Vulkan physical-device selection now records rejection reasons for unsuitable GPUs. The checks include API version, queues, features, extensions, surface usage, formats, and anisotropy. Existing macOS exceptions for three unsupported features remain non-rejecting. `CreateVulkan` passes the report to device selection and includes it in the fatal error when no suitable device is found. **Suggested reviewers:** `nmzik` </details> <!-- walkthrough_end --> <!-- change_assessment_start --> **Priority:** ⬇️ Low <!-- change_assessment_commit:"99748e1c70551f059631619f0b628fc8f977c4b2" --> **Change:** Refactor <!-- change_assessment_end --> <!-- final_review_risk_start --> **Merge Risk:** _🔵 Low_ · up to `99748` <!-- final_review_risk_coverage:{"sourceCommitId":"99748e1c70551f059631619f0b628fc8f977c4b2","coveredCommitId":"99748e1c70551f059631619f0b628fc8f977c4b2","kind":"reviewed"} --> A rejected GPU may show a misleading reason in the fatal error. Correct the label before merging if practical; the reported issue does not block device selection. <!-- final_review_risk_end --> <!-- pre_merge_checks_walkthrough_start --> <details> <summary>🚥 Pre-merge checks | ✅ 4 | ❌ 1</summary> ### ❌ Failed checks (1 warning) | Check name | Status | Explanation | Resolution | | :----------------: | :--------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------- | | Docstring Coverage | ⚠️ Warning | Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 1 files. | Write docstrings for the functions missing them to satisfy the coverage threshold. | <details> <summary>✅ Passed checks (4 passed)</summary> | Check name | Status | Explanation | | :------------------------: | :------- | :-------------------------------------------------------------------------------------------------------------------------- | | Linked Issues check | ✅ Passed | Check skipped because no linked issues were found for this pull request. | | Out of Scope Changes check | ✅ Passed | Check skipped because no linked issues were found for this pull request. | | Title check | ✅ Passed | The title clearly describes the main change: reporting why each GPU was rejected during Vulkan device selection. | | Description check | ✅ Passed | The description directly explains the rejection-reporting changes, preserved behavior, diagnostics, and validation results. | </details> </details> <!-- pre_merge_checks_walkthrough_end --> <!-- tips_start --> --- Thanks for using [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=KytyPS5/KytyPS5&utm_content=910)! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. <details> <summary>❤️ Share</summary> - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code) </details> <sub>Comment `@coderabbitai help` to get the list of available commands.</sub> <!-- tips_end -->
@ -465,1 +363,4 @@
!CheckFormat(device, vk::Format::eB8G8R8A8Srgb, true, storage_features)) {
LOGF("Format vk::Format::eB8G8R8A8Srgb cannot be used as storage image\n");
check_format(vk::Format::eB8G8R8A8Unorm, storage_features, "storage image");
}
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-09-29 20:00 UTC · original · edited 2026-09-29 20:08 UTC

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

The storage fallback reports the wrong usage.

The fallback checks storage_features, which are eStorageImage | eTransferDst. The recorded reason still says "cannot be used as texture". A user can then read the report as a sampled-texture failure when the actual failure is storage-image support. Pass "storage image" as the usage in both fallback calls.

Proposed fix
-			check_format(vk::Format::eR8G8B8A8Unorm, storage_features, "texture");
+			check_format(vk::Format::eR8G8B8A8Unorm, storage_features, "storage image");
...
-			check_format(vk::Format::eB8G8R8A8Unorm, storage_features, "texture");
+			check_format(vk::Format::eB8G8R8A8Unorm, storage_features, "storage image");
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

		if (!skip_device &&
		    !CheckFormat(device, vk::Format::eR8G8B8A8Srgb, true, storage_features)) {
			LOGF("Format vk::Format::eR8G8B8A8Srgb cannot be used as texture\n");
			check_format(vk::Format::eR8G8B8A8Unorm, storage_features, "storage image");
		}

		if (!skip_device &&
		    !CheckFormat(device, vk::Format::eB8G8R8A8Srgb, true, storage_features)) {
			LOGF("Format vk::Format::eB8G8R8A8Srgb cannot be used as texture\n");
			check_format(vk::Format::eB8G8R8A8Unorm, storage_features, "storage image");
		}

✅ Addressed in commit e51b3b2

**@⁠coderabbitai[bot]** on GitHub · 2026-09-29 20:00 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/910#discussion_r4137745758) · edited 2026-09-29 20:08 UTC _🎯 Functional Correctness_ | _🟡 Minor_ | _⚡ Quick win_ **The storage fallback reports the wrong usage.** The fallback checks `storage_features`, which are `eStorageImage | eTransferDst`. The recorded reason still says "cannot be used as texture". A user can then read the report as a sampled-texture failure when the actual failure is storage-image support. Pass `"storage image"` as the usage in both fallback calls. <details> <summary>Proposed fix</summary> ```diff - check_format(vk::Format::eR8G8B8A8Unorm, storage_features, "texture"); + check_format(vk::Format::eR8G8B8A8Unorm, storage_features, "storage image"); ... - check_format(vk::Format::eB8G8R8A8Unorm, storage_features, "texture"); + check_format(vk::Format::eB8G8R8A8Unorm, storage_features, "storage image"); ``` </details> <!-- suggestion_start --> <details> <summary>📝 Committable suggestion</summary> > ‼️ **IMPORTANT** > Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements. ```suggestion if (!skip_device && !CheckFormat(device, vk::Format::eR8G8B8A8Srgb, true, storage_features)) { LOGF("Format vk::Format::eR8G8B8A8Srgb cannot be used as texture\n"); check_format(vk::Format::eR8G8B8A8Unorm, storage_features, "storage image"); } if (!skip_device && !CheckFormat(device, vk::Format::eB8G8R8A8Srgb, true, storage_features)) { LOGF("Format vk::Format::eB8G8R8A8Srgb cannot be used as texture\n"); check_format(vk::Format::eB8G8R8A8Unorm, storage_features, "storage image"); } ``` </details> <!-- suggestion_end --> <!-- fingerprinting:phantom:medusa:pangolin --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:3b9db39f197bbbd7bfa0e107 --> <!-- This is an auto-generated comment by CodeRabbit --> ✅ Addressed in commit e51b3b2
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-09-29 20:00 UTC · original · reviewed

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 211f4421-cc1f-4ed1-893c-7e3b1383ba15

📥 Commits

Reviewing files that changed from the base of the PR and between 42e4659e12 and 99748e1c70.

📒 Files selected for processing (1)
  • src/graphics/presentation/window/vulkanWindow.cpp

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

**@⁠coderabbitai[bot]** on GitHub · 2026-09-29 20:00 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/910#pullrequestreview-5357700899) · **reviewed** **Actionable comments posted: 1** --- <details> <summary>ℹ️ Review info</summary> <details> <summary>⚙️ Run configuration</summary> **Configuration used**: Repository: KytyPS5/KytyPS5/.coderabbit.yaml **Review profile**: CHILL **Plan**: Advanced **Run ID**: `211f4421-cc1f-4ed1-893c-7e3b1383ba15` </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between 42e4659e12d7b0bc6616331c213f98d187269ed8 and 99748e1c70551f059631619f0b628fc8f977c4b2. </details> <details> <summary>📒 Files selected for processing (1)</summary> * `src/graphics/presentation/window/vulkanWindow.cpp` </details> **Included review availability:** This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review. </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
This discussion has been locked. Commenting is limited to contributors.
No description provided.