From c3085eb58d21bf6802325f180eb48e98f4e1a350 Mon Sep 17 00:00:00 2001 From: patrykorwat Date: Sat, 5 Sep 2026 05:47:39 +0000 Subject: [PATCH] axelera: enumerate devices explicitly and fail with an actionable error Context.list_devices() keys off the lspci BDF and needs the colon-form node to be present, so surface an empty enumeration at init with the fix-it hint instead of a bare device_connect(None) ConnectionError several frames deeper. Uses the DeviceInfo the runtime enumerated rather than relying on the pick-first implicit path. --- frigate/detectors/plugins/axelera.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/frigate/detectors/plugins/axelera.py b/frigate/detectors/plugins/axelera.py index bf0305077a..dd0cd7ff1f 100644 --- a/frigate/detectors/plugins/axelera.py +++ b/frigate/detectors/plugins/axelera.py @@ -436,10 +436,20 @@ class _AxeleraRuntimeInference: model_dir = os.path.dirname(model_json) self._ctx = runtime_factory() model = self._ctx.load_model(model_json) + # enumerate and connect to the DeviceInfo explicitly rather than + # letting the runtime pick: it surfaces the lspci/device-node + # mismatch as an empty list instead of a late connect failure + devices = self._ctx.list_devices() + if not devices: + raise RuntimeError( + "axelera: no Metis device enumerated; check that the " + "/dev/metis-:: node (colon form) is passed " + "into the container and the metis driver is loaded" + ) # hold the device connection on self: the runtime releases the device # when the connection object is garbage collected, so it must outlive # init for as long as the model instance uses it - self._conn = self._ctx.device_connect(None, num_sub_devices=1) + self._conn = self._ctx.device_connect(devices[0], num_sub_devices=1) self._instance = self._conn.load_model_instance( model, num_sub_devices=1, aipu_cores=1 )