[HailoRT] [error] CHECK failed - max_desc_page_size given 16384 is bigger than hw max desc page size 4096

Hi, I want to use hailo8L on Pi5, so I install hailort4.18 follow this guid:

And my inference code is like below:

# General imports used throughout the tutorial
from multiprocessing import Process

import numpy as np

from hailo_platform import (
    HEF,
    ConfigureParams,
    FormatType,
    HailoSchedulingAlgorithm,
    HailoStreamInterface,
    InferVStreams,
    InputVStreamParams,
    InputVStreams,
    OutputVStreamParams,
    OutputVStreams,
    VDevice,
)

# from hailo_sdk_client import ClientRunner, InferenceContext

# Setting VDevice params to disable the HailoRT service feature
params = VDevice.create_params()
params.scheduling_algorithm = HailoSchedulingAlgorithm.NONE

# The target can be used as a context manager ("with" statement) to ensure it's released on time.
# Here it's avoided for the sake of simplicity
target = VDevice(params=params)

# Loading compiled HEFs to device:
model_name = "mbf"
hef_path = f"{model_name}.hef"
hef = HEF(hef_path)

# Get the "network groups" (connectivity groups, aka. "different networks") information from the .hef
configure_params = ConfigureParams.create_from_hef(hef=hef, interface=HailoStreamInterface.PCIe)
network_groups = target.configure(hef, configure_params)
network_group = network_groups[0]
network_group_params = network_group.create_params()

# Create input and output virtual streams params
# Quantized argument signifies whether or not the incoming data is already quantized.
# Data is quantized by HailoRT if and only if quantized == False .
input_vstreams_params = InputVStreamParams.make(network_group, quantized=False, format_type=FormatType.FLOAT32)
output_vstreams_params = OutputVStreamParams.make(network_group, quantized=True, format_type=FormatType.UINT8)

# Define dataset params
input_vstream_info = hef.get_input_vstream_infos()[0]
output_vstream_info = hef.get_output_vstream_infos()[0]
image_height, image_width, channels = input_vstream_info.shape
num_of_images = 10
low, high = 2, 20

# Generate random dataset
dataset = np.random.randint(low, high, (num_of_images, image_height, image_width, channels)).astype(np.float32)


input_data = {input_vstream_info.name: dataset}

with InferVStreams(network_group, input_vstreams_params, output_vstreams_params) as infer_pipeline:
    with network_group.activate(network_group_params):
        infer_results = infer_pipeline.infer(input_data)
        # The result output tensor is infer_results[output_vstream_info.name]
        print(f"Stream output shape is {infer_results[output_vstream_info.name].shape}")

And I am sure hailo driver is installed:

(hailo_env) ain@raspberrypi5:~ $ hailortcli fw-control identify
Executing on device: 0000:01:00.0
Identifying board
Control Protocol Version: 2
Firmware Version: 4.18.0 (release,app,extended context switch buffer)
Logger Version: 0
Board Name: Hailo-8
Device Architecture: HAILO8L
Serial Number: HLDDLBB243202208
Part Number: HM21LB1C2LAE
Product Name: HAILO-8L AI ACC M.2 B+M KEY MODULE EXT TMP

And I get error like bellow:

(hailo_env) ain@raspberrypi5:~/face_hailo $ python run.py 
[HailoRT] [error] CHECK failed - max_desc_page_size given 16384 is bigger than hw max desc page size 4096
[HailoRT] [error] CHECK_SUCCESS failed with status=HAILO_INTERNAL_FAILURE(8)
[HailoRT] [error] CHECK_SUCCESS failed with status=HAILO_INTERNAL_FAILURE(8)
[HailoRT] [error] CHECK_SUCCESS failed with status=HAILO_INTERNAL_FAILURE(8)
[HailoRT] [error] CHECK_SUCCESS failed with status=HAILO_INTERNAL_FAILURE(8)
[HailoRT] [error] CHECK_SUCCESS failed with status=HAILO_INTERNAL_FAILURE(8)
[HailoRT] [error] CHECK_SUCCESS failed with status=HAILO_INTERNAL_FAILURE(8)
[HailoRT] [error] CHECK_SUCCESS failed with status=HAILO_INTERNAL_FAILURE(8)
[HailoRT] [error] CHECK_SUCCESS failed with status=HAILO_INTERNAL_FAILURE(8)
[HailoRT] [error] CHECK_SUCCESS failed with status=HAILO_INTERNAL_FAILURE(8)
[HailoRT] [error] CHECK_SUCCESS failed with status=HAILO_INTERNAL_FAILURE(8)
[HailoRT] [error] CHECK_SUCCESS failed with status=HAILO_INTERNAL_FAILURE(8)
Traceback (most recent call last):
  File "/home/ain/hailo_env/lib/python3.11/site-packages/hailo_platform/pyhailort/pyhailort.py", line 3503, in configure
    configured_ngs_handles = self._vdevice.configure(hef._hef, configure_params_by_name)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
hailo_platform.pyhailort._pyhailort.HailoRTStatusException: 8

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/ain/face_hailo/run.py", line 37, in <module>
    network_groups = target.configure(hef, configure_params)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ain/hailo_env/lib/python3.11/site-packages/hailo_platform/pyhailort/pyhailort.py", line 3502, in configure
    with ExceptionWrapper():
  File "/home/ain/hailo_env/lib/python3.11/site-packages/hailo_platform/pyhailort/pyhailort.py", line 110, in __exit__
    self._raise_indicative_status_exception(value)
  File "/home/ain/hailo_env/lib/python3.11/site-packages/hailo_platform/pyhailort/pyhailort.py", line 155, in _raise_indicative_status_exception
    raise self.create_exception_from_status(error_code) from libhailort_exception
hailo_platform.pyhailort.pyhailort.HailoRTException: libhailort failed with error: 8 (HAILO_INTERNAL_FAILURE)

I just install hailort4.18 without install tapps.

(hailo_env) ain@raspberrypi5:~/face_hailo $ dmesg | grep hailo 
[    2.788125] hailo: Init module. driver version 4.18.0
[    2.789356] hailo 0000:01:00.0: Probing on: 1e60:2864...
[    2.789366] hailo 0000:01:00.0: Probing: Allocate memory for device extension, 11632
[    2.789385] hailo 0000:01:00.0: enabling device (0000 -> 0002)
[    2.789392] hailo 0000:01:00.0: Probing: Device enabled
[    2.789428] hailo 0000:01:00.0: Probing: mapped bar 0 - 0000000095b9bed5 16384
[    2.789434] hailo 0000:01:00.0: Probing: mapped bar 2 - 00000000a7e4227c 4096
[    2.789438] hailo 0000:01:00.0: Probing: mapped bar 4 - 000000003a5fe9ea 16384
[    2.789444] hailo 0000:01:00.0: Probing: Setting max_desc_page_size to 16384, (page_size=16384)
[    2.789456] hailo 0000:01:00.0: Probing: Enabled 64 bit dma
[    2.789460] hailo 0000:01:00.0: Probing: Using userspace allocated vdma buffers
[    2.789464] hailo 0000:01:00.0: Disabling ASPM L0s 
[    2.789469] hailo 0000:01:00.0: Successfully disabled ASPM L0s 
[    3.199962] hailo 0000:01:00.0: Firmware was loaded successfully
[    3.212253] hailo 0000:01:00.0: Probing: Added board 1e60-2864, /dev/hailo0

This problem is solved by this

Make sure the /etc/modprobe.d/hailo_pci.conf exists and contains the following line:
options hailo_pci force_desc_page_size=4096

create /etc/modprobe.d/hailo_pci.conf and input options hailo_pci force_desc_page_size=4096.

1 Like