-cpu flag

This commit is contained in:
Dobromir Popov
2026-07-09 08:19:15 +03:00
parent 4ed585bf54
commit 9ec4ca9ce1
8 changed files with 121 additions and 11 deletions

View File

@@ -171,6 +171,18 @@ def _gpu_inventory_profile(gpu: dict | None, ram_mb: int) -> dict | None:
return profile
def with_forced_cpu(hw: dict) -> dict:
"""Return a hardware profile forced to CPU execution.
Keeps detected GPU metadata for diagnostics and tracker registration context,
but clears CUDA availability so startup and the model backend stay on CPU.
"""
forced = dict(hw)
forced["device"] = "cpu"
forced["cuda_available"] = False
return forced
def detect_hardware() -> dict:
"""Detect GPU model and available VRAM. Returns hardware profile dict."""
ram_mb = _detect_ram_mb()