From c73e9c4f025b1689dff0973eca113e09381ff81a Mon Sep 17 00:00:00 2001 From: Brandon Schneider Date: Sat, 30 May 2026 19:59:38 -0500 Subject: [PATCH] fix(infra): handle Cirrus Logic virtual VGA and DRM naming edge cases - Add Cirrus Logic (0x1013) and virtio (0x1af4) to vendor map - Fix DRM card parsing for names like "card0-VGA-1" - Virtual GPUs (cirrus, virtio) never classified as discrete - Virtual GPUs skip VA-API tier, fall to FRAMEBUFFER Racknerd microVM (2vCPU, 715MB, Cirrus VGA) correctly classified as FRAMEBUFFER tier: 1024x768 @ 16bpp = 1.57 MB DMA backplane. --- 4-Infrastructure/shim/device_capability_probe.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/4-Infrastructure/shim/device_capability_probe.py b/4-Infrastructure/shim/device_capability_probe.py index aa792f4c..77cdd088 100644 --- a/4-Infrastructure/shim/device_capability_probe.py +++ b/4-Infrastructure/shim/device_capability_probe.py @@ -98,6 +98,9 @@ VENDOR_MAP = { "0x10de": "nvidia", "0x1002": "amd", "0x8086": "intel", + "0x1013": "cirrus", + "0x1106": "via", + "0x1af4": "virtio", } # Discrete GPU device ID ranges (approximate) @@ -125,8 +128,10 @@ def _detect_gpus() -> List[GPUDevice]: for card_dir in sorted(drm_dir.glob("card*")): card_name = card_dir.name # e.g. "card0", "card1" + # Handle names like "card0", "card0-VGA-1" + base = card_name.split("-")[0] try: - card_id = int(card_name.replace("card", "")) + card_id = int(base.replace("card", "")) except ValueError: continue @@ -214,6 +219,10 @@ def _is_discrete_gpu(vendor: str, name: str, device_id: str) -> bool: # Intel is almost always integrated (except Arc) return "arc" in name_lower + # Virtual GPUs (Cirrus, virtio) are never discrete + if vendor in ("cirrus", "virtio", "via"): + return False + return False @@ -368,7 +377,7 @@ def _assign_tier(caps: DeviceCapabilities): # Check for AMD/Intel discrete with VA-API for gpu in caps.gpus: - if gpu.is_discrete and gpu.vaapi_profiles: + if gpu.is_discrete and gpu.vaapi_profiles and gpu.vendor_name not in ("cirrus", "virtio"): return ( ComputeTier.GPU_VAAPI, {"GPU": 1},