Device Management Overview
EagleEye does not wrap accelerators in a device abstraction that executes models. Instead it keeps three separate objects, all created once in MainBackend.__init__ and injected into operations that ask for them by constructor parameter name:
| Object | File | Role |
|---|---|---|
DeviceRegistry | src/utils/device_registry.py | Immutable inventory of inference devices discovered at startup |
ModelLibrary | src/utils/model_library.py | Managed model metadata and artifacts under files/models/ |
Mx3RuntimeCoordinator | src/utils/mx3_runtime.py | Owner of shared per-device MemryX MX3 runtimes and stream bindings |
An operation that runs inference typically takes a model_id and a device_id parameter, resolves the artifact with model_library.resolve_artifact(model_id, device_id), and loads it itself with the appropriate framework (Ultralytics/PyTorch, ONNX Runtime, TensorRT, or the MX3 coordinator).
Device ID formats
| Device | Canonical ID | Example |
|---|---|---|
| CPU | cpu | cpu |
| NVIDIA CUDA GPU | cuda:<index> | cuda:0, cuda:1 |
| MemryX MX3 | mx3:<index> | mx3:0, mx3:1 |
IDs are exact; aliases are not accepted. CUDA indices follow torch.cuda enumeration order. MX3 indices come from the /dev/memxN node number.
Lifecycle
DeviceRegistry.discover(logger=...)runs once inMainBackend.__init__. It always addscpu, adds one entry per CUDA device iftorchimports and reports CUDA available, and adds one entry per/dev/memx[0-9]*node on POSIX systems.- The registry, model library, and MX3 coordinator are passed to
EagleEyeInterface(registry and library only) and togenerate_all_pipelines(...). - Pipeline construction injects
device_registry,model_library, andmx3_coordinatorinto any operation whose__init__declares those parameter names. - Operations validate their configured
device_idthroughDeviceRegistry.get(device_id), which raisesDeviceNotFoundErrorfor unknown IDs.
There is no runtime registration or removal API: the inventory is fixed for the life of the process, and adding hardware requires a backend restart.
When to add a new device
Supporting new accelerator hardware means extending DeviceRegistry.discover with a new canonical ID prefix and teaching ModelLibrary.resolve_artifact which artifact slot that prefix can use. See New Device.