Basic hardware check

Hello,
I want to integrate a simple hardware-existance check in my program.

The following code works, but HailoRT generates output on std err even when using export HAILORT_LOGGER_PATH=NONE

  int verifyHailo8()
  {
      int hail8Present = 1;

      auto result = hailort::VDevice::create();

      if (!result.has_value())
      {
          hail8Present = 0;
      }
      return hail8Present;
  }
[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)
[HailoRT] [error] CHECK_SUCCESS failed with status=HAILO_OUT_OF_PHYSICAL_DEVICES(74)
Hailo 8 present 0

I could start the program with ./program 2> /dev/null and effectively get the result I want, but I was wondering is there is a way to turn off stderr from HailoRT.

I could not find any logging API function to handle this.
Working on HailoRT 4.20.

Thanks.

Hi @Stefano_Nicolis,
Try setting the following:
export HAILORT_CONSOLE_LOGGER_LEVEL="critical"

1 Like

That can work!
I should have tried that, but I got carried away looking for a way to totally disable logging.
My idea was that I don’t need logging at all as I can manage the program with the return codes.

Thanks.