Inquiry on Handling Timeout Errors

Hi Hailo

Currently, we are working based on the multi_device_example.

After several inferences, a timeout error occurs, and even after setting the input stream to HAILO_INFINITE to extend the duration, the problem of the error occurring and causing a halt has not been resolved.

We will continue to investigate for a fundamental solution, but for now, I would like to inquire about a method to reload the firmware and restart from within the code when such an error occurs.

For example, a way to reinitialize the virtual device and perform inference again after the error occurs.

Thanks

Hey @roiyim,

To recover from device timeouts effectively, the main steps are:

  1. Release the current virtual device
  2. Reset or reload the firmware if necessary
  3. Reinitialize the virtual device and pipeline from scratch

Example: Reinitializing After Timeout

from hailo_platform import VDevice, HEF, ConfigureParams, HailoRTException

def initialize_device(hef_path):
    vdevice = VDevice()
    hef = HEF(hef_path)
    network_group = vdevice.configure(hef, ConfigureParams())
    input_vstreams = network_group.get_input_vstream_infos()
    output_vstreams = network_group.get_output_vstream_infos()
    return vdevice, network_group, input_vstreams, output_vstreams

def handle_error(hef_path, input_data_generator):
    vdevice.release()  # Release the previous device
    # Reinitialize everything
    vdevice, network_group, input_vstreams, output_vstreams = initialize_device(hef_path)

What Happens During Reinitialization:

  • The loop releases the old device
  • Calls initialize_device() again to:
    • Create a new virtual device
    • Reload the HEF
    • Rebuild the inference pipeline

Things to Keep in Mind:

  • Always release the device cleanly before reinitializing
  • Catch HailoRTException to detect timeout events
  • Reinitialization must be done per device in multi-device setups

This method allows robust recovery from timeouts entirely in user space—no need for system reboots or kernel-level resets.

1 Like

Hi omria

Currently, we are working with C++ code.
I found the vdevice release function “hailo_release_vdevice()” in the C code, but I’m having difficulty locating the equivalent vdevice release function in the C++ code. Could you please let me know how to release the vdevice in C++?

Thanks