HailoAsyncInference, venv, raspberry -> not found

I would like to use HailoAsyncInference on a raspberry/python/venv
copying from Hailo-Application-Code-Examples/runtime/python/detection_with_tracker/detection_with_tracker.py at main · hailo-ai/Hailo-Application-Code-Examples · GitHub
the line:
from utils import HailoAsyncInference
throws an error (Hailo(modelpath) works, but I need async)

How to fix?

Hi @Thor,

This is the code for the HailoAsyncInference.

Hi @nina-vilela
doesn’t work (raspberry pi5). I always get the following error. Running the same program using the not async run(), it works.
Fix?

[HailoRT] [error] CHECK failed - Failed to create vdevice. there are not enough free devices. requested: 1, found: 0
[HailoRT] [error] CHECK_SUCCESS failed with status=HAILO_OUT_OF_PHYSICAL_DEVICES(74)
[HailoRT] [error] CHECK_SUCCESS failed with status=HAILO_OUT_OF_PHYSICAL_DEVICES(74)
[HailoRT] [error] CHECK_SUCCESS failed with status=HAILO_OUT_OF_PHYSICAL_DEVICES(74)

and on forever

This could happen if you are initializing multiple instances of HailoAsyncInference, is that the case?

No
What I do I call Hailo() first to read the hef and do some stuff, but then I close it with hailo.close()
Then I invoke hailoasyncinference
Maybe Hailo.close doesn’t release all Hailo resources
Is there something else I should do to be able to open/ close Hailo multiple times in a program?
When a program exists, what does the os do to release the Hailo resource?

It seems like the device is not being properly freed. Is there some specific information you need from the HEF? You can get it from the HailoAsyncInference instead, you can add whatever you need there.