mirror of
https://github.com/allaunthefox/Research-Stack.git
synced 2026-08-11 21:50:34 +00:00
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.
This commit is contained in:
parent
ce0367405b
commit
c73e9c4f02
1 changed files with 11 additions and 2 deletions
|
|
@ -98,6 +98,9 @@ VENDOR_MAP = {
|
||||||
"0x10de": "nvidia",
|
"0x10de": "nvidia",
|
||||||
"0x1002": "amd",
|
"0x1002": "amd",
|
||||||
"0x8086": "intel",
|
"0x8086": "intel",
|
||||||
|
"0x1013": "cirrus",
|
||||||
|
"0x1106": "via",
|
||||||
|
"0x1af4": "virtio",
|
||||||
}
|
}
|
||||||
|
|
||||||
# Discrete GPU device ID ranges (approximate)
|
# Discrete GPU device ID ranges (approximate)
|
||||||
|
|
@ -125,8 +128,10 @@ def _detect_gpus() -> List[GPUDevice]:
|
||||||
|
|
||||||
for card_dir in sorted(drm_dir.glob("card*")):
|
for card_dir in sorted(drm_dir.glob("card*")):
|
||||||
card_name = card_dir.name # e.g. "card0", "card1"
|
card_name = card_dir.name # e.g. "card0", "card1"
|
||||||
|
# Handle names like "card0", "card0-VGA-1"
|
||||||
|
base = card_name.split("-")[0]
|
||||||
try:
|
try:
|
||||||
card_id = int(card_name.replace("card", ""))
|
card_id = int(base.replace("card", ""))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|
@ -214,6 +219,10 @@ def _is_discrete_gpu(vendor: str, name: str, device_id: str) -> bool:
|
||||||
# Intel is almost always integrated (except Arc)
|
# Intel is almost always integrated (except Arc)
|
||||||
return "arc" in name_lower
|
return "arc" in name_lower
|
||||||
|
|
||||||
|
# Virtual GPUs (Cirrus, virtio) are never discrete
|
||||||
|
if vendor in ("cirrus", "virtio", "via"):
|
||||||
|
return False
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -368,7 +377,7 @@ def _assign_tier(caps: DeviceCapabilities):
|
||||||
|
|
||||||
# Check for AMD/Intel discrete with VA-API
|
# Check for AMD/Intel discrete with VA-API
|
||||||
for gpu in caps.gpus:
|
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 (
|
return (
|
||||||
ComputeTier.GPU_VAAPI,
|
ComputeTier.GPU_VAAPI,
|
||||||
{"GPU": 1},
|
{"GPU": 1},
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue