MCPcopy
hub / github.com/nikopueringer/CorridorKey / detect_device

Method detect_device

backend/service.py:187–197  ·  view source on GitHub ↗

Detect best available compute device using centralized device_utils.

(self)

Source from the content-addressed store, hash-verified

185 # --- Device & Engine Management ---
186
187 def detect_device(self) -> str:
188 """Detect best available compute device using centralized device_utils."""
189 try:
190 from device_utils import resolve_device
191
192 self._device = resolve_device()
193 except ImportError:
194 self._device = "cpu"
195 logger.warning("device_utils not available — using CPU")
196 logger.info(f"Compute device: {self._device}")
197 return self._device
198
199 def get_vram_info(self) -> dict[str, float]:
200 """Get GPU VRAM info in GB. Returns empty dict if not CUDA."""

Callers

nothing calls this directly

Calls 1

resolve_deviceFunction · 0.90

Tested by

no test coverage detected