Desktop: Prefer the Vulkan WGPU adapter on Linux#4270
Conversation
|
!build desktop (Run ID 27945901504) |
There was a problem hiding this comment.
Code Review
This pull request refactors the WGPU context creation and adapter selection logic by introducing a builder pattern with selection support and sorting available adapters by priority. The feedback suggests improving robustness by falling back to other adapters if the preferred one fails to initialize, as well as refining the sorting logic to prioritize macOS/iOS (Metal) and to sort by device type before backend to ensure discrete GPUs are always preferred.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
3 issues found across 3 files
Confidence score: 2/5
- In
node-graph/libraries/wgpu-executor/src/context.rs, the Linux adapter sort can rank Vulkan CPU adapters above non-Vulkan hardware GPUs, so default selection may fall back to software rendering with major performance regression. Rebalance the ranking to prefer hardware adapters first (then backend preference) before merging. - In
node-graph/libraries/wgpu-executor/src/context.rs,request_devicefailure on the first candidate currently short-circuitsbuild()and can lead to a downstream.expect()panic, turning a recoverable driver/adapter issue into an app crash. Try the next sorted adapters and return a handled error path instead of panicking before merging. - In
desktop/wrapper/src/lib.rs, the public re-export ofWgpuBackendsappears unused in-repo, which is low risk but adds API surface and maintenance noise. Either remove it now or land it alongside its first consumer to keep the wrapper interface intentional.
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
|
|
|
No description provided.