Skip to content

Commit 1597c33

Browse files
committed
Reject software renderers in GPU probe (only accept DiscreteGpu/IntegratedGpu)
1 parent 5bbd57b commit 1597c33

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

crates/pecos-gpu-sims/src/gpu_probe.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,18 @@ pub fn request_default_gpu_device(
6161
device_type: info.device_type,
6262
};
6363

64+
// Reject software renderers and unknown device types -- they technically
65+
// "work" but OOM on real workloads (common on CI runners without real GPUs)
66+
match info.device_type {
67+
wgpu::DeviceType::DiscreteGpu | wgpu::DeviceType::IntegratedGpu => {}
68+
other => {
69+
return Err(GpuStartupError::DeviceCreation {
70+
info,
71+
error: format!("Device type {other:?} is not a hardware GPU"),
72+
});
73+
}
74+
}
75+
6476
let (device, queue) = pollster::block_on(adapter.request_device(&wgpu::DeviceDescriptor {
6577
label: Some(label),
6678
required_features: wgpu::Features::empty(),

0 commit comments

Comments
 (0)