Gracefully fail startup when only CPU Vulkan adapters are available #3743
+15
−0
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.