Gracefully fail startup when only CPU Vulkan adapters are available#3743
Draft
ShivangSingh68 wants to merge 2 commits intoGraphiteEditor:masterfrom
Draft
Gracefully fail startup when only CPU Vulkan adapters are available#3743ShivangSingh68 wants to merge 2 commits intoGraphiteEditor:masterfrom
ShivangSingh68 wants to merge 2 commits intoGraphiteEditor:masterfrom
Conversation
Member
|
Gracefully shutting down when we know that a adapter is not supported is generally a good idea, but this is to harsh. There are adapters reported as CPU that support all features we need (for example my development VM). An acceptable approach would be checking if the adapter supports all features we need. |
Author
|
@timon-schelling yes I agree on your thought and made the respective changes to the file, can you please review? |
Member
|
@ShivangSingh68 for your reference, you will need to mark the PR as Ready for Review if you want it to be not ignored by us on the review team. |
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.
Fixes #3560
This PR fixes a startup crash that occurs on systems without a Vulkan-capable GPU.
Previously, Graphite would select a CPU-based Vulkan adapter (such as llvmpipe) and continue initialization. This would later trigger a wgpu validation error, followed by a panic and segmentation fault, making it difficult for users to understand that their system does not meet the graphics requirements.
Summary of changes
Detect and reject CPU-based Vulkan adapters during context initialization.
Fail early when no supported GPU adapter is available, instead of continuing into an invalid wgpu state.
Preserve existing adapter-selection logic while adding a clear support check to prevent crashes.
Impact
Prevents crashes and undefined behavior on unsupported systems.
Makes Graphite’s GPU requirements clearer to users.
Improves robustness and error handling during graphics initialization.
Testing
Confirmed normal startup on systems with a supported GPU.
Confirmed graceful failure (no panic or segmentation fault) when only CPU Vulkan adapters are present.
Verified with cargo check and cargo clippy --all-targets --all-features.