From 182c72f709892f59b0625d7ec85b920db65ee757 Mon Sep 17 00:00:00 2001 From: Shivang_Singh68 Date: Tue, 10 Feb 2026 15:02:38 +0530 Subject: [PATCH 1/2] Gracefully fail when only CPU Vulkan adapters are available --- node-graph/libraries/wgpu-executor/src/context.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/node-graph/libraries/wgpu-executor/src/context.rs b/node-graph/libraries/wgpu-executor/src/context.rs index 3c0a4e4ecb..a1d8d840b0 100644 --- a/node-graph/libraries/wgpu-executor/src/context.rs +++ b/node-graph/libraries/wgpu-executor/src/context.rs @@ -81,6 +81,16 @@ impl ContextBuilder { }; instance.request_adapter(&request_adapter_options).await.ok() } + fn is_supported_adapter(adapter: &Adapter) -> bool { + let info = adapter.get_info(); + + //Reject CPU-based adapters (e.g. llvmpipe / software Vulkan) + if info.device_type == wgpu::DeviceType::Cpu { + return false; + } + true + } + async fn request_device(&self, adapter: &Adapter) -> Option<(Device, Queue)> { let device_descriptor = wgpu::DeviceDescriptor { label: None, @@ -111,6 +121,11 @@ impl ContextBuilder { let adapter = if let Some(adapter) = selected_adapter { adapter } else { self.request_adapter(&instance).await? }; + //Fail early if the selected adapter is not supported + if !Self::is_supported_adapter(&adapter) { + return None; + } + let (device, queue) = self.request_device(&adapter).await?; Some(Context { device: Arc::new(device), From e9e4e8dae7f73673d2d9b5e157d8dccac68e069b Mon Sep 17 00:00:00 2001 From: Shivang_Singh68 Date: Sat, 14 Feb 2026 11:47:32 +0530 Subject: [PATCH 2/2] Validate adapter based on required features instead of device type --- node-graph/libraries/wgpu-executor/src/context.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/node-graph/libraries/wgpu-executor/src/context.rs b/node-graph/libraries/wgpu-executor/src/context.rs index a1d8d840b0..d134f5a64c 100644 --- a/node-graph/libraries/wgpu-executor/src/context.rs +++ b/node-graph/libraries/wgpu-executor/src/context.rs @@ -81,11 +81,10 @@ impl ContextBuilder { }; instance.request_adapter(&request_adapter_options).await.ok() } - fn is_supported_adapter(adapter: &Adapter) -> bool { - let info = adapter.get_info(); + fn is_supported_adapter(adapter: &Adapter, required_features: Features) -> bool { + let supported_features = adapter.features(); - //Reject CPU-based adapters (e.g. llvmpipe / software Vulkan) - if info.device_type == wgpu::DeviceType::Cpu { + if !supported_features.contains(required_features) { return false; } true @@ -122,7 +121,7 @@ impl ContextBuilder { let adapter = if let Some(adapter) = selected_adapter { adapter } else { self.request_adapter(&instance).await? }; //Fail early if the selected adapter is not supported - if !Self::is_supported_adapter(&adapter) { + if !Self::is_supported_adapter(&adapter, self.features) { return None; }