(class_str: &str)
| 11 | const GPU_CLASS_DISPLAY_3D: u32 = 0x0302; |
| 12 | |
| 13 | fn is_gpu_class(class_str: &str) -> bool { |
| 14 | if class_str == GPU_CLASS_DISPLAY_VGA { |
| 15 | return true; |
| 16 | } |
| 17 | // 3D controller: 0x0302xx |
| 18 | if let Some(hex) = class_str.strip_prefix("0x") |
| 19 | && let Ok(val) = u32::from_str_radix(hex, 16) |
| 20 | { |
| 21 | return (val >> 8) == GPU_CLASS_DISPLAY_3D; |
| 22 | } |
| 23 | false |
| 24 | } |
| 25 | |
| 26 | /// Scan sysfs for NVIDIA GPUs eligible for VFIO passthrough. |
| 27 | pub fn probe_host_nvidia_vfio_readiness(sysfs: &SysfsRoot) -> Vec<PciInfo> { |
no outgoing calls
no test coverage detected