Device selection
Choose the device type (runtime + hardware) your model runs on. This guide covers supported types, discovery, deterministic vs. fallback selection, and pinning specific cards.
Last updated
Was this helpful?
Was this helpful?
from degirum_tools import ModelSpec
model_spec = ModelSpec(
model_name="…",
zoo_url="degirum/hailo",
inference_host_address="@local",
)
model = model_spec.load_model()print(
"supported:", model.supported_device_types
) # e.g., ['HAILORT/HAILO8L', 'HAILORT/HAILO8']model.device_type = "HAILORT/HAILO8L" # Pick a type to query
print("available indices:", model.devices_available) # e.g., [0] or [0,1]# Lock to one runtime/hardware type
model_spec = ModelSpec(
..., model_properties={"device_type": "HAILORT/HAILO8L"}
)
model = model_spec.load_model()# Prefer HAILO8, then HAILO8L, then CPU as a last resort
model_spec = ModelSpec(
...,
model_properties={
"device_type": ["HAILORT/HAILO8", "HAILORT/HAILO8L", "CPU"]
},
)
model = model_spec.load_model() # First available winsmodel.device_type = "HAILORT/HAILO8L"
print(model.devices_available) # e.g., [0, 1]
model.devices_selected = [1] # Choose card #1