From f2aad5079a436439b5a6aea30e58cb8020a2fc13 Mon Sep 17 00:00:00 2001 From: HailoRT-Automation <98901220+HailoRT-Automation@users.noreply.github.com> Date: Mon, 4 Mar 2024 19:25:35 +0200 Subject: [PATCH] v4.16.2 --- hailort/CMakeLists.txt | 2 +- hailort/libhailort/CMakeLists.txt | 2 +- .../bindings/gstreamer/CMakeLists.txt | 2 +- .../gstreamer/gst-hailo/gsthailonet2.cpp | 20 ++- .../gstreamer/gst-hailo/gsthailonet2.hpp | 3 +- .../hailo_platform/pyhailort/pyhailort.py | 2 +- .../bindings/python/platform/setup.py | 2 +- .../bindings/python/src/CMakeLists.txt | 2 +- .../data_quantization_example/CMakeLists.txt | 2 +- .../c/infer_pipeline_example/CMakeLists.txt | 2 +- .../c/multi_device_example/CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../power_measurement_example/CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../c/raw_streams_example/CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../c/vstreams_example/CMakeLists.txt | 2 +- .../cpp/async_infer_example/CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../cpp/infer_pipeline_example/CMakeLists.txt | 2 +- .../cpp/multi_device_example/CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../cpp/multi_process_example/CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../power_measurement_example/CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../cpp/raw_streams_example/CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../cpp/vstreams_example/CMakeLists.txt | 2 +- .../libhailort/src/device_common/control.cpp | 29 +++- .../soc_utils/partial_cluster_reader.cpp | 148 +++++++++++++++--- .../soc_utils/partial_cluster_reader.hpp | 27 +++- hailort/scripts/download_firmware_eth.cmd | 2 +- hailort/scripts/download_firmware_eth.sh | 2 +- hailort/scripts/download_hefs.cmd | 2 +- hailort/scripts/download_hefs.sh | 2 +- 40 files changed, 218 insertions(+), 79 deletions(-) diff --git a/hailort/CMakeLists.txt b/hailort/CMakeLists.txt index 2170e21..307878f 100644 --- a/hailort/CMakeLists.txt +++ b/hailort/CMakeLists.txt @@ -31,7 +31,7 @@ endif() # Set firmware version add_definitions( -DFIRMWARE_VERSION_MAJOR=4 ) add_definitions( -DFIRMWARE_VERSION_MINOR=16 ) -add_definitions( -DFIRMWARE_VERSION_REVISION=1 ) +add_definitions( -DFIRMWARE_VERSION_REVISION=2 ) if(HAILO_BUILD_SERVICE) add_definitions( -DHAILO_SUPPORT_MULTI_PROCESS ) endif() diff --git a/hailort/libhailort/CMakeLists.txt b/hailort/libhailort/CMakeLists.txt index 20402c4..b44ab0e 100644 --- a/hailort/libhailort/CMakeLists.txt +++ b/hailort/libhailort/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.0.0) set(HAILORT_MAJOR_VERSION 4) set(HAILORT_MINOR_VERSION 16) -set(HAILORT_REVISION_VERSION 1) +set(HAILORT_REVISION_VERSION 2) # Add the cmake folder so the modules there are found set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH}) diff --git a/hailort/libhailort/bindings/gstreamer/CMakeLists.txt b/hailort/libhailort/bindings/gstreamer/CMakeLists.txt index ba871c3..abe9284 100644 --- a/hailort/libhailort/bindings/gstreamer/CMakeLists.txt +++ b/hailort/libhailort/bindings/gstreamer/CMakeLists.txt @@ -8,7 +8,7 @@ if(NOT CMAKE_HOST_UNIX) message(FATAL_ERROR "Only unix hosts are supported, stopping build") endif() -find_package(HailoRT 4.16.1 EXACT REQUIRED) +find_package(HailoRT 4.16.2 EXACT REQUIRED) # GST_PLUGIN_DEFINE needs PACKAGE to be defined set(GST_HAILO_PACKAGE_NAME "hailo") diff --git a/hailort/libhailort/bindings/gstreamer/gst-hailo/gsthailonet2.cpp b/hailort/libhailort/bindings/gstreamer/gst-hailo/gsthailonet2.cpp index 3545fc1..69f8763 100644 --- a/hailort/libhailort/bindings/gstreamer/gst-hailo/gsthailonet2.cpp +++ b/hailort/libhailort/bindings/gstreamer/gst-hailo/gsthailonet2.cpp @@ -52,6 +52,7 @@ enum PROP_INPUT_FROM_META, PROP_NO_TRANSFORM, PROP_MULTI_PROCESS_SERVICE, + PROP_PASS_THROUGH, // Deprecated PROP_VDEVICE_KEY, @@ -332,6 +333,7 @@ static hailo_status gst_hailonet2_allocate_infer_resources(GstHailoNet2 *self) buffer = static_cast(gst_queue_array_pop_head(self->thread_queue)); self->buffers_in_thread_queue--; } + self->thread_cv.notify_all(); if (GST_IS_PAD(self->srcpad)) { // Checking because we fail here when exiting the application GstFlowReturn ret = gst_pad_push(self->srcpad, buffer); if ((GST_FLOW_OK != ret) && (GST_FLOW_FLUSHING != ret) && (!self->has_got_eos)) { @@ -482,9 +484,12 @@ static void gst_hailonet2_set_property(GObject *object, guint property_id, const case PROP_IS_ACTIVE: (void)gst_hailonet2_toggle_activation(self, self->props.m_is_active.get(), g_value_get_boolean(value)); break; + case PROP_PASS_THROUGH: + self->props.m_pass_through = g_value_get_boolean(value); + break; case PROP_OUTPUTS_MIN_POOL_SIZE: if (self->is_configured) { - g_warning("The network was already configured so changing the outputs minimum pool size will not take place!"); + g_warning("The network has already been configured, the output's minimum pool size cannot be changed!"); break; } self->props.m_outputs_min_pool_size = g_value_get_uint(value); @@ -620,6 +625,9 @@ static void gst_hailonet2_get_property(GObject *object, guint property_id, GValu case PROP_IS_ACTIVE: g_value_set_boolean(value, self->props.m_is_active.get()); break; + case PROP_PASS_THROUGH: + g_value_set_boolean(value, self->props.m_pass_through.get()); + break; case PROP_OUTPUTS_MIN_POOL_SIZE: g_value_set_uint(value, self->props.m_outputs_min_pool_size.get()); break; @@ -725,6 +733,11 @@ static void gst_hailonet2_class_init(GstHailoNet2Class *klass) "By default, the hailonet element will not be active unless it is the only one. " "Setting this property in combination with 'scheduling-algorithm' different than HAILO_SCHEDULING_ALGORITHM_NONE is not supported.", false, (GParamFlags)(G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS))); + g_object_class_install_property(gobject_class, PROP_PASS_THROUGH, + g_param_spec_boolean("pass-through", "Is Element pass-through", "Controls whether the element will perform inference or simply pass buffers through. " + "By default, the hailonet element will not be pass-through. " + "Setting this property to true disables inference, regardless of the scheduler settings.", false, + (GParamFlags)(G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS))); g_object_class_install_property(gobject_class, PROP_SCHEDULING_ALGORITHM, g_param_spec_enum("scheduling-algorithm", "Scheduling policy for automatic network group switching", "Controls the Model Scheduler algorithm of HailoRT. " @@ -798,6 +811,9 @@ static void gst_hailonet2_push_buffer_to_thread(GstHailoNet2 *self, GstBuffer *b { { std::unique_lock lock(self->thread_queue_mutex); + self->thread_cv.wait(lock, [self] () { + return self->buffers_in_thread_queue < self->props.m_outputs_max_pool_size.get(); + }); gst_queue_array_push_tail(self->thread_queue, buffer); self->buffers_in_thread_queue++; } @@ -1010,7 +1026,7 @@ static GstFlowReturn gst_hailonet2_chain(GstPad * /*pad*/, GstObject * parent, G GstHailoNet2 *self = GST_HAILONET2(parent); std::unique_lock lock(self->infer_mutex); - if (!self->props.m_is_active.get() || (nullptr == self->configured_infer_model)) { + if (self->props.m_pass_through.get() || !self->props.m_is_active.get()) { gst_hailonet2_push_buffer_to_thread(self, buffer); return GST_FLOW_OK; } diff --git a/hailort/libhailort/bindings/gstreamer/gst-hailo/gsthailonet2.hpp b/hailort/libhailort/bindings/gstreamer/gst-hailo/gsthailonet2.hpp index daba88f..119e7a8 100644 --- a/hailort/libhailort/bindings/gstreamer/gst-hailo/gsthailonet2.hpp +++ b/hailort/libhailort/bindings/gstreamer/gst-hailo/gsthailonet2.hpp @@ -66,7 +66,7 @@ struct HailoNet2Properties final { public: HailoNet2Properties() : m_hef_path(nullptr), m_batch_size(HAILO_DEFAULT_BATCH_SIZE), - m_device_id(nullptr), m_device_count(0), m_vdevice_group_id(nullptr), m_is_active(false), + m_device_id(nullptr), m_device_count(0), m_vdevice_group_id(nullptr), m_is_active(false), m_pass_through(false), m_outputs_min_pool_size(MIN_OUTPUTS_POOL_SIZE), m_outputs_max_pool_size(MAX_OUTPUTS_POOL_SIZE), m_scheduling_algorithm(HAILO_SCHEDULING_ALGORITHM_ROUND_ROBIN), m_scheduler_timeout_ms(HAILO_DEFAULT_SCHEDULER_TIMEOUT_MS), m_scheduler_threshold(HAILO_DEFAULT_SCHEDULER_THRESHOLD), m_scheduler_priority(HAILO_SCHEDULER_PRIORITY_NORMAL), @@ -95,6 +95,7 @@ public: HailoElemProperty m_device_count; HailoElemProperty m_vdevice_group_id; HailoElemProperty m_is_active; + HailoElemProperty m_pass_through; HailoElemProperty m_outputs_min_pool_size; HailoElemProperty m_outputs_max_pool_size; HailoElemProperty m_scheduling_algorithm; diff --git a/hailort/libhailort/bindings/python/platform/hailo_platform/pyhailort/pyhailort.py b/hailort/libhailort/bindings/python/platform/hailo_platform/pyhailort/pyhailort.py index 196f9f4..2c3e547 100644 --- a/hailort/libhailort/bindings/python/platform/hailo_platform/pyhailort/pyhailort.py +++ b/hailort/libhailort/bindings/python/platform/hailo_platform/pyhailort/pyhailort.py @@ -1488,7 +1488,7 @@ class HailoFormatFlags(_pyhailort.FormatFlags): SUPPORTED_PROTOCOL_VERSION = 2 SUPPORTED_FW_MAJOR = 4 SUPPORTED_FW_MINOR = 16 -SUPPORTED_FW_REVISION = 1 +SUPPORTED_FW_REVISION = 2 MEGA_MULTIPLIER = 1000.0 * 1000.0 diff --git a/hailort/libhailort/bindings/python/platform/setup.py b/hailort/libhailort/bindings/python/platform/setup.py index 4132ad2..f6b5f5a 100644 --- a/hailort/libhailort/bindings/python/platform/setup.py +++ b/hailort/libhailort/bindings/python/platform/setup.py @@ -69,6 +69,6 @@ if __name__ == "__main__": "linux_aarch64", ], url="https://hailo.ai/", - version="4.16.1", + version="4.16.2", zip_safe=False, ) diff --git a/hailort/libhailort/bindings/python/src/CMakeLists.txt b/hailort/libhailort/bindings/python/src/CMakeLists.txt index 836c118..91c03fb 100644 --- a/hailort/libhailort/bindings/python/src/CMakeLists.txt +++ b/hailort/libhailort/bindings/python/src/CMakeLists.txt @@ -49,7 +49,7 @@ set_target_properties(_pyhailort PROPERTIES # VISIBILITY_INLINES_HIDDEN YES ) -find_package(HailoRT 4.16.1 EXACT REQUIRED) +find_package(HailoRT 4.16.2 EXACT REQUIRED) target_link_libraries(_pyhailort PRIVATE HailoRT::libhailort) if(WIN32) diff --git a/hailort/libhailort/examples/c/data_quantization_example/CMakeLists.txt b/hailort/libhailort/examples/c/data_quantization_example/CMakeLists.txt index 3d3be16..6a2e675 100644 --- a/hailort/libhailort/examples/c/data_quantization_example/CMakeLists.txt +++ b/hailort/libhailort/examples/c/data_quantization_example/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.0.0) set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) -find_package(HailoRT 4.16.1 EXACT REQUIRED) +find_package(HailoRT 4.16.2 EXACT REQUIRED) SET_SOURCE_FILES_PROPERTIES(data_quantization_example.c PROPERTIES LANGUAGE C) diff --git a/hailort/libhailort/examples/c/infer_pipeline_example/CMakeLists.txt b/hailort/libhailort/examples/c/infer_pipeline_example/CMakeLists.txt index 04b389e..1fd6b7a 100644 --- a/hailort/libhailort/examples/c/infer_pipeline_example/CMakeLists.txt +++ b/hailort/libhailort/examples/c/infer_pipeline_example/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.0.0) set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) -find_package(HailoRT 4.16.1 EXACT REQUIRED) +find_package(HailoRT 4.16.2 EXACT REQUIRED) SET_SOURCE_FILES_PROPERTIES(infer_pipeline_example.c PROPERTIES LANGUAGE C) diff --git a/hailort/libhailort/examples/c/multi_device_example/CMakeLists.txt b/hailort/libhailort/examples/c/multi_device_example/CMakeLists.txt index 1d92d10..5ed386f 100644 --- a/hailort/libhailort/examples/c/multi_device_example/CMakeLists.txt +++ b/hailort/libhailort/examples/c/multi_device_example/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.0.0) set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) -find_package(HailoRT 4.16.1 EXACT REQUIRED) +find_package(HailoRT 4.16.2 EXACT REQUIRED) SET_SOURCE_FILES_PROPERTIES(multi_device_example.c PROPERTIES LANGUAGE C) diff --git a/hailort/libhailort/examples/c/multi_network_vstream_example/CMakeLists.txt b/hailort/libhailort/examples/c/multi_network_vstream_example/CMakeLists.txt index e5f5130..bea6c1c 100644 --- a/hailort/libhailort/examples/c/multi_network_vstream_example/CMakeLists.txt +++ b/hailort/libhailort/examples/c/multi_network_vstream_example/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.0.0) find_package(Threads REQUIRED) set(THREADS_PREFER_PTHREAD_FLAG ON) -find_package(HailoRT 4.16.1 EXACT REQUIRED) +find_package(HailoRT 4.16.2 EXACT REQUIRED) SET_SOURCE_FILES_PROPERTIES(multi_network_vstream_example.c PROPERTIES LANGUAGE C) diff --git a/hailort/libhailort/examples/c/notification_callback_example/CMakeLists.txt b/hailort/libhailort/examples/c/notification_callback_example/CMakeLists.txt index 2d62279..fe145e2 100644 --- a/hailort/libhailort/examples/c/notification_callback_example/CMakeLists.txt +++ b/hailort/libhailort/examples/c/notification_callback_example/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.0.0) set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) -find_package(HailoRT 4.16.1 EXACT REQUIRED) +find_package(HailoRT 4.16.2 EXACT REQUIRED) SET_SOURCE_FILES_PROPERTIES(notification_callback_example.c PROPERTIES LANGUAGE C) diff --git a/hailort/libhailort/examples/c/power_measurement_example/CMakeLists.txt b/hailort/libhailort/examples/c/power_measurement_example/CMakeLists.txt index 314f8da..76d85fd 100644 --- a/hailort/libhailort/examples/c/power_measurement_example/CMakeLists.txt +++ b/hailort/libhailort/examples/c/power_measurement_example/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.0.0) -find_package(HailoRT 4.16.1 EXACT REQUIRED) +find_package(HailoRT 4.16.2 EXACT REQUIRED) SET_SOURCE_FILES_PROPERTIES(power_measurement_example.c PROPERTIES LANGUAGE C) diff --git a/hailort/libhailort/examples/c/raw_async_streams_single_thread_example/CMakeLists.txt b/hailort/libhailort/examples/c/raw_async_streams_single_thread_example/CMakeLists.txt index 137a2d4..8477fc8 100644 --- a/hailort/libhailort/examples/c/raw_async_streams_single_thread_example/CMakeLists.txt +++ b/hailort/libhailort/examples/c/raw_async_streams_single_thread_example/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.0.0) -find_package(HailoRT 4.16.1 EXACT REQUIRED) +find_package(HailoRT 4.16.2 EXACT REQUIRED) SET_SOURCE_FILES_PROPERTIES(raw_async_streams_single_thread_example.c PROPERTIES LANGUAGE C) diff --git a/hailort/libhailort/examples/c/raw_streams_example/CMakeLists.txt b/hailort/libhailort/examples/c/raw_streams_example/CMakeLists.txt index d98dc87..2d4245e 100644 --- a/hailort/libhailort/examples/c/raw_streams_example/CMakeLists.txt +++ b/hailort/libhailort/examples/c/raw_streams_example/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.0.0) set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) -find_package(HailoRT 4.16.1 EXACT REQUIRED) +find_package(HailoRT 4.16.2 EXACT REQUIRED) SET_SOURCE_FILES_PROPERTIES(raw_streams_example.c PROPERTIES LANGUAGE C) diff --git a/hailort/libhailort/examples/c/switch_network_groups_example/CMakeLists.txt b/hailort/libhailort/examples/c/switch_network_groups_example/CMakeLists.txt index 4f4d7a2..e71deee 100644 --- a/hailort/libhailort/examples/c/switch_network_groups_example/CMakeLists.txt +++ b/hailort/libhailort/examples/c/switch_network_groups_example/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.0.0) set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) -find_package(HailoRT 4.16.1 EXACT REQUIRED) +find_package(HailoRT 4.16.2 EXACT REQUIRED) SET_SOURCE_FILES_PROPERTIES(switch_network_groups_example.c PROPERTIES LANGUAGE C) diff --git a/hailort/libhailort/examples/c/switch_network_groups_manually_example/CMakeLists.txt b/hailort/libhailort/examples/c/switch_network_groups_manually_example/CMakeLists.txt index dc3c3d0..aab5aec 100644 --- a/hailort/libhailort/examples/c/switch_network_groups_manually_example/CMakeLists.txt +++ b/hailort/libhailort/examples/c/switch_network_groups_manually_example/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.0.0) set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) -find_package(HailoRT 4.16.1 EXACT REQUIRED) +find_package(HailoRT 4.16.2 EXACT REQUIRED) SET_SOURCE_FILES_PROPERTIES(switch_network_groups_manually_example.c PROPERTIES LANGUAGE C) diff --git a/hailort/libhailort/examples/c/vstreams_example/CMakeLists.txt b/hailort/libhailort/examples/c/vstreams_example/CMakeLists.txt index 41f487e..0ef434b 100644 --- a/hailort/libhailort/examples/c/vstreams_example/CMakeLists.txt +++ b/hailort/libhailort/examples/c/vstreams_example/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.0.0) set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) -find_package(HailoRT 4.16.1 EXACT REQUIRED) +find_package(HailoRT 4.16.2 EXACT REQUIRED) SET_SOURCE_FILES_PROPERTIES(vstreams_example.c PROPERTIES LANGUAGE C) diff --git a/hailort/libhailort/examples/cpp/async_infer_example/CMakeLists.txt b/hailort/libhailort/examples/cpp/async_infer_example/CMakeLists.txt index 1495056..650edb4 100644 --- a/hailort/libhailort/examples/cpp/async_infer_example/CMakeLists.txt +++ b/hailort/libhailort/examples/cpp/async_infer_example/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.0.0) -find_package(HailoRT 4.16.1 EXACT REQUIRED) +find_package(HailoRT 4.16.2 EXACT REQUIRED) add_executable(cpp_async_infer_example async_infer_example.cpp) target_link_libraries(cpp_async_infer_example PRIVATE HailoRT::libhailort) diff --git a/hailort/libhailort/examples/cpp/async_infer_functionality_example/CMakeLists.txt b/hailort/libhailort/examples/cpp/async_infer_functionality_example/CMakeLists.txt index ca59931..06d4e34 100644 --- a/hailort/libhailort/examples/cpp/async_infer_functionality_example/CMakeLists.txt +++ b/hailort/libhailort/examples/cpp/async_infer_functionality_example/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.0.0) -find_package(HailoRT 4.16.1 EXACT REQUIRED) +find_package(HailoRT 4.16.2 EXACT REQUIRED) add_executable(cpp_async_infer_functionality_example async_infer_functionality_example.cpp) target_link_libraries(cpp_async_infer_functionality_example PRIVATE HailoRT::libhailort) diff --git a/hailort/libhailort/examples/cpp/infer_pipeline_example/CMakeLists.txt b/hailort/libhailort/examples/cpp/infer_pipeline_example/CMakeLists.txt index bd6ef4d..eccb90b 100644 --- a/hailort/libhailort/examples/cpp/infer_pipeline_example/CMakeLists.txt +++ b/hailort/libhailort/examples/cpp/infer_pipeline_example/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.0.0) -find_package(HailoRT 4.16.1 EXACT REQUIRED) +find_package(HailoRT 4.16.2 EXACT REQUIRED) add_executable(cpp_infer_pipeline_example infer_pipeline_example.cpp) target_link_libraries(cpp_infer_pipeline_example PRIVATE HailoRT::libhailort) diff --git a/hailort/libhailort/examples/cpp/multi_device_example/CMakeLists.txt b/hailort/libhailort/examples/cpp/multi_device_example/CMakeLists.txt index cf7b652..6913af9 100644 --- a/hailort/libhailort/examples/cpp/multi_device_example/CMakeLists.txt +++ b/hailort/libhailort/examples/cpp/multi_device_example/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.0.0) set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) -find_package(HailoRT 4.16.1 EXACT REQUIRED) +find_package(HailoRT 4.16.2 EXACT REQUIRED) add_executable(cpp_multi_device_example multi_device_example.cpp) target_link_libraries(cpp_multi_device_example PRIVATE HailoRT::libhailort Threads::Threads) diff --git a/hailort/libhailort/examples/cpp/multi_network_vstream_example/CMakeLists.txt b/hailort/libhailort/examples/cpp/multi_network_vstream_example/CMakeLists.txt index 96b1349..6f2ccbc 100644 --- a/hailort/libhailort/examples/cpp/multi_network_vstream_example/CMakeLists.txt +++ b/hailort/libhailort/examples/cpp/multi_network_vstream_example/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.0.0) find_package(Threads REQUIRED) set(THREADS_PREFER_PTHREAD_FLAG ON) -find_package(HailoRT 4.16.1 EXACT REQUIRED) +find_package(HailoRT 4.16.2 EXACT REQUIRED) add_executable(cpp_multi_network_vstream_example multi_network_vstream_example.cpp) target_link_libraries(cpp_multi_network_vstream_example PRIVATE HailoRT::libhailort Threads::Threads) diff --git a/hailort/libhailort/examples/cpp/multi_process_example/CMakeLists.txt b/hailort/libhailort/examples/cpp/multi_process_example/CMakeLists.txt index c24a4e8..433c6c4 100644 --- a/hailort/libhailort/examples/cpp/multi_process_example/CMakeLists.txt +++ b/hailort/libhailort/examples/cpp/multi_process_example/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.0.0) set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) -find_package(HailoRT 4.16.1 EXACT REQUIRED) +find_package(HailoRT 4.16.2 EXACT REQUIRED) add_executable(cpp_multi_process_example multi_process_example.cpp) target_link_libraries(cpp_multi_process_example PRIVATE HailoRT::libhailort Threads::Threads) diff --git a/hailort/libhailort/examples/cpp/notification_callback_example/CMakeLists.txt b/hailort/libhailort/examples/cpp/notification_callback_example/CMakeLists.txt index 31f4cf9..8929faf 100644 --- a/hailort/libhailort/examples/cpp/notification_callback_example/CMakeLists.txt +++ b/hailort/libhailort/examples/cpp/notification_callback_example/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.0.0) -find_package(HailoRT 4.16.1 EXACT REQUIRED) +find_package(HailoRT 4.16.2 EXACT REQUIRED) add_executable(cpp_notification_callback_example notification_callback_example.cpp) target_link_libraries(cpp_notification_callback_example PRIVATE HailoRT::libhailort) diff --git a/hailort/libhailort/examples/cpp/power_measurement_example/CMakeLists.txt b/hailort/libhailort/examples/cpp/power_measurement_example/CMakeLists.txt index 4493ef1..83f4dd5 100644 --- a/hailort/libhailort/examples/cpp/power_measurement_example/CMakeLists.txt +++ b/hailort/libhailort/examples/cpp/power_measurement_example/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.0.0) -find_package(HailoRT 4.16.1 EXACT REQUIRED) +find_package(HailoRT 4.16.2 EXACT REQUIRED) add_executable(cpp_power_measurement_example power_measurement_example.cpp) target_link_libraries(cpp_power_measurement_example PRIVATE HailoRT::libhailort) diff --git a/hailort/libhailort/examples/cpp/raw_async_streams_multi_thread_example/CMakeLists.txt b/hailort/libhailort/examples/cpp/raw_async_streams_multi_thread_example/CMakeLists.txt index adb93ba..1b03be6 100644 --- a/hailort/libhailort/examples/cpp/raw_async_streams_multi_thread_example/CMakeLists.txt +++ b/hailort/libhailort/examples/cpp/raw_async_streams_multi_thread_example/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.0.0) set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) -find_package(HailoRT 4.16.1 EXACT REQUIRED) +find_package(HailoRT 4.16.2 EXACT REQUIRED) add_executable(cpp_raw_async_streams_multi_thread_example raw_async_streams_multi_thread_example.cpp) target_link_libraries(cpp_raw_async_streams_multi_thread_example PRIVATE HailoRT::libhailort Threads::Threads) diff --git a/hailort/libhailort/examples/cpp/raw_async_streams_single_thread_example/CMakeLists.txt b/hailort/libhailort/examples/cpp/raw_async_streams_single_thread_example/CMakeLists.txt index bde7dba..cf7e24d 100644 --- a/hailort/libhailort/examples/cpp/raw_async_streams_single_thread_example/CMakeLists.txt +++ b/hailort/libhailort/examples/cpp/raw_async_streams_single_thread_example/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.0.0) set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) -find_package(HailoRT 4.16.1 EXACT REQUIRED) +find_package(HailoRT 4.16.2 EXACT REQUIRED) add_executable(cpp_raw_async_streams_single_thread_example raw_async_streams_single_thread_example.cpp) target_link_libraries(cpp_raw_async_streams_single_thread_example PRIVATE HailoRT::libhailort Threads::Threads) diff --git a/hailort/libhailort/examples/cpp/raw_streams_example/CMakeLists.txt b/hailort/libhailort/examples/cpp/raw_streams_example/CMakeLists.txt index b426240..709110a 100644 --- a/hailort/libhailort/examples/cpp/raw_streams_example/CMakeLists.txt +++ b/hailort/libhailort/examples/cpp/raw_streams_example/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.0.0) set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) -find_package(HailoRT 4.16.1 EXACT REQUIRED) +find_package(HailoRT 4.16.2 EXACT REQUIRED) add_executable(cpp_raw_streams_example raw_streams_example.cpp) target_link_libraries(cpp_raw_streams_example PRIVATE HailoRT::libhailort Threads::Threads) diff --git a/hailort/libhailort/examples/cpp/switch_network_groups_example/CMakeLists.txt b/hailort/libhailort/examples/cpp/switch_network_groups_example/CMakeLists.txt index 8fed362..1b3a689 100644 --- a/hailort/libhailort/examples/cpp/switch_network_groups_example/CMakeLists.txt +++ b/hailort/libhailort/examples/cpp/switch_network_groups_example/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.0.0) set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) -find_package(HailoRT 4.16.1 EXACT REQUIRED) +find_package(HailoRT 4.16.2 EXACT REQUIRED) add_executable(cpp_switch_network_groups_example switch_network_groups_example.cpp) target_link_libraries(cpp_switch_network_groups_example PRIVATE HailoRT::libhailort Threads::Threads) diff --git a/hailort/libhailort/examples/cpp/switch_network_groups_manually_example/CMakeLists.txt b/hailort/libhailort/examples/cpp/switch_network_groups_manually_example/CMakeLists.txt index ec95769..8b5c1f2 100644 --- a/hailort/libhailort/examples/cpp/switch_network_groups_manually_example/CMakeLists.txt +++ b/hailort/libhailort/examples/cpp/switch_network_groups_manually_example/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.0.0) find_package(Threads REQUIRED) set(THREADS_PREFER_PTHREAD_FLAG ON) -find_package(HailoRT 4.16.1 EXACT REQUIRED) +find_package(HailoRT 4.16.2 EXACT REQUIRED) add_executable(cpp_switch_network_groups_manually_example switch_network_groups_manually_example.cpp) target_link_libraries(cpp_switch_network_groups_manually_example PRIVATE HailoRT::libhailort Threads::Threads) diff --git a/hailort/libhailort/examples/cpp/vstreams_example/CMakeLists.txt b/hailort/libhailort/examples/cpp/vstreams_example/CMakeLists.txt index 8ef9e3a..f0a8ad0 100644 --- a/hailort/libhailort/examples/cpp/vstreams_example/CMakeLists.txt +++ b/hailort/libhailort/examples/cpp/vstreams_example/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.0.0) set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) -find_package(HailoRT 4.16.1 EXACT REQUIRED) +find_package(HailoRT 4.16.2 EXACT REQUIRED) add_executable(cpp_vstreams_example vstreams_example.cpp) target_link_libraries(cpp_vstreams_example PRIVATE HailoRT::libhailort Threads::Threads) diff --git a/hailort/libhailort/src/device_common/control.cpp b/hailort/libhailort/src/device_common/control.cpp index b8d6aab..1ad286c 100644 --- a/hailort/libhailort/src/device_common/control.cpp +++ b/hailort/libhailort/src/device_common/control.cpp @@ -88,6 +88,14 @@ Expected control__parse_identify_results(CONTROL_PROTOC board_info.device_architecture = static_cast(BYTE_ORDER__ntohl(identify_response->device_architecture)); + // Device architecture can be HAILO_ARCH_HAILO15H or HAILO_ARCH_HAILO15M - but the FW will always return HAILO_ARCH_HAILO15H + // Based on a file the SCU gives us we can deduce the actual type + if (HAILO_ARCH_HAILO15H == board_info.device_architecture) { + auto dev_arch_exp = PartialClusterReader::get_actual_dev_arch_from_fuse(board_info.device_architecture); + CHECK_EXPECTED(dev_arch_exp); + board_info.device_architecture = dev_arch_exp.release(); + } + /* Write identify results to log */ LOGGER__INFO("firmware_version is: {}.{}.{}", board_info.fw_version.major, @@ -3065,15 +3073,22 @@ Expected Control::get_partial_clusters_layout_bitmap(Device &device) return std::stoi(std::string(force_layout_env)); } - auto device_arch_exp = device.get_architecture(); - CHECK_EXPECTED(device_arch_exp); - if (HAILO_ARCH_HAILO8L != device_arch_exp.value() && HAILO_ARCH_HAILO15M != device_arch_exp.value()) { + auto dev_arch_exp = device.get_architecture(); + CHECK_EXPECTED(dev_arch_exp); + const auto dev_arch = dev_arch_exp.release(); + // In Both cases of Hailo15H and Hailo15M read fuse file (If no file found will return default value of all clusters) + if ((HAILO_ARCH_HAILO15H == dev_arch) || (HAILO_ARCH_HAILO15M == dev_arch)) { + auto bitmap_exp = PartialClusterReader::get_partial_clusters_layout_bitmap(dev_arch); + CHECK_EXPECTED(bitmap_exp); + const auto bitmap = bitmap_exp.release(); + if (PARTIAL_CLUSTERS_LAYOUT_BITMAP__HAILO15_DEFAULT == bitmap) { + return Expected(PARTIAL_CLUSTERS_LAYOUT_IGNORE); + } else { + return Expected(bitmap); + } + } else if (HAILO_ARCH_HAILO8L != dev_arch) { // Partial clusters layout is only relevant in HAILO_ARCH_HAILO8L and HAILO_ARCH_HAILO15M arch return Expected(PARTIAL_CLUSTERS_LAYOUT_IGNORE); - } - - if (HAILO_ARCH_HAILO15M == device_arch_exp.value()) { - return PartialClusterReader::get_partial_clusters_layout_bitmap(device_arch_exp.value()); } else { auto extended_device_info_response = get_extended_device_info_response(device); CHECK_EXPECTED(extended_device_info_response); diff --git a/hailort/libhailort/src/utils/soc_utils/partial_cluster_reader.cpp b/hailort/libhailort/src/utils/soc_utils/partial_cluster_reader.cpp index a417936..e5953f3 100644 --- a/hailort/libhailort/src/utils/soc_utils/partial_cluster_reader.cpp +++ b/hailort/libhailort/src/utils/soc_utils/partial_cluster_reader.cpp @@ -8,7 +8,7 @@ **/ #include "hailo/hailort_common.hpp" - +#include "common/filesystem.hpp" #include "partial_cluster_reader.hpp" #include @@ -17,12 +17,24 @@ namespace hailort { -Expected PartialClusterReader::get_arch_default_bitmap(const hailo_device_architecture_t dev_arch) +// SKU is three bit value in fuse file in order to differentiate the different kind of boards +#define SKU_VALUE_BITMAP (0x7) +#define HAILO15H_SKU_VALUE (0x0) +#define HAILO15M_SKU_VALUE (0x3) + +// SKU and partial cluster layout bitmap are located at specific locations in the fuse file according to the spec +// Located in issue HRT-12971 +#define SKU_BYTE_INDEX_IN_FUSE_FILE (32) +#define SKU_BIT_INDEX_IN_WORD (18) +#define ACTIVE_CLUSTER_LAYOUT_BITMAP_INDEX_IN_FUSE_FILE (80) + +Expected PartialClusterReader::get_arch_default_bitmap(hailo_device_architecture_t dev_arch) { switch(dev_arch) { - // Currently only supported architecture for this function is HAILO15M - but in future can add more + // Currently only supported architectures for this function are HAILO15H and HAILO15M - but in future can add + case HAILO_ARCH_HAILO15H: case HAILO_ARCH_HAILO15M: - return static_cast(PARTIAL_CLUSTERS_LAYOUT_BITMAP__HAILO15M_DEFAULT); + return static_cast(PARTIAL_CLUSTERS_LAYOUT_BITMAP__HAILO15_DEFAULT); default: LOGGER__ERROR("Error, Given architecture {} doesnt support partial cluster layout", HailoRTCommon::get_device_arch_str(dev_arch)); @@ -30,49 +42,133 @@ Expected PartialClusterReader::get_arch_default_bitmap(const hailo_dev } } -bool PartialClusterReader::validate_arch_partial_clusters_bitmap(const hailo_device_architecture_t dev_arch, - const uint32_t bitmap) +bool PartialClusterReader::validate_arch_partial_clusters_bitmap(uint32_t bitmap, uint8_t sku_value) { - switch(dev_arch) { - // Currently only supported architecture for this function is HAILO15M - but in future can add more - case HAILO_ARCH_HAILO15M: + // Currently only supported architectures for this function are HAILO15H and HAILO15M - but in future can add + switch (sku_value) { + case HAILO15H_SKU_VALUE: + return (PARTIAL_CLUSTERS_LAYOUT_BITMAP__HAILO15_DEFAULT == bitmap); + case HAILO15M_SKU_VALUE: return (std::find(HAILO15M__PARTIAL_CLUSTERS_LAYOUT_BITMAP_ARRAY.begin(), HAILO15M__PARTIAL_CLUSTERS_LAYOUT_BITMAP_ARRAY.end(), bitmap) != HAILO15M__PARTIAL_CLUSTERS_LAYOUT_BITMAP_ARRAY.end()); default: - LOGGER__ERROR("Error, Given architecture {} doesnt support partial cluster layout", - HailoRTCommon::get_device_arch_str(dev_arch)); return false; } } -Expected PartialClusterReader::get_partial_clusters_layout_bitmap(const hailo_device_architecture_t dev_arch) +// NOTE: This Function assumes fuse file exists - and file not being able to be opened is considered error +Expected> PartialClusterReader::read_fuse_file() { std::ifstream layout_bitmap_file; layout_bitmap_file.open(PARTIAL_CLUSTER_READER_CLUSTER_LAYOUT_FILE_PATH, std::ios::binary); - if (!layout_bitmap_file.is_open()) { - LOGGER__WARNING("partial cluster layout bitmap file not found, Enabling all clusters by default"); - return get_arch_default_bitmap(dev_arch); - } + + CHECK_AS_EXPECTED(layout_bitmap_file.is_open(), HAILO_OPEN_FILE_FAILURE, "Failed Opening layout bitmap file {}", + PARTIAL_CLUSTER_READER_CLUSTER_LAYOUT_FILE_PATH); + + // SKU is located at SKU_BYTE_INDEX_IN_FUSE_FILE + layout_bitmap_file.seekg(SKU_BYTE_INDEX_IN_FUSE_FILE, std::ios::beg); + CHECK_AS_EXPECTED(layout_bitmap_file.good(), HAILO_FILE_OPERATION_FAILURE, "Failed seek in fuse file"); + + // Read SKU value from file as well to validate arch type + uint32_t misc_word = 0; + layout_bitmap_file.read(reinterpret_cast(&misc_word), sizeof(misc_word)); + CHECK_AS_EXPECTED(layout_bitmap_file.good(), HAILO_FILE_OPERATION_FAILURE, "Failed reading fuse file"); + uint8_t sku_value = ((misc_word >> SKU_BIT_INDEX_IN_WORD) & SKU_VALUE_BITMAP); + + // active clusters bitmap is located at ACTIVE_CLUSTER_LAYOUT_BITMAP_INDEX_IN_FUSE_FILE + layout_bitmap_file.seekg(ACTIVE_CLUSTER_LAYOUT_BITMAP_INDEX_IN_FUSE_FILE, std::ios::beg); + CHECK_AS_EXPECTED(layout_bitmap_file.good(), HAILO_FILE_OPERATION_FAILURE, "Failed seek in fuse file"); uint32_t partial_clusters_layout_bitmap = 0; layout_bitmap_file.read(reinterpret_cast(&partial_clusters_layout_bitmap), sizeof(partial_clusters_layout_bitmap)); + CHECK_AS_EXPECTED(layout_bitmap_file.good(), HAILO_FILE_OPERATION_FAILURE, "Failed reading fuse file"); - // Fuse file represents clusters that are enabled with 0 in bit value and clusters that are disabled with 1 - // We also ignore all the MSB's that dont represent clusters. - // Therefore, after reading the uint32 layout - we mask with the default bitmap and bitwise flip the - // relevant bits so that 1 will represent enabled clusters - const auto arch_bitmap_mask_exp = get_arch_default_bitmap(dev_arch); - CHECK_EXPECTED(arch_bitmap_mask_exp); - partial_clusters_layout_bitmap = (~partial_clusters_layout_bitmap & arch_bitmap_mask_exp.value()); layout_bitmap_file.close(); - CHECK_AS_EXPECTED(validate_arch_partial_clusters_bitmap(dev_arch, partial_clusters_layout_bitmap), - HAILO_INTERNAL_FAILURE, "Error, Invalid partial clusters bitmap value given {}", + CHECK_AS_EXPECTED(validate_arch_partial_clusters_bitmap(partial_clusters_layout_bitmap, sku_value), + HAILO_INTERNAL_FAILURE, "Error, Given SKU value {} doesnt support partial cluster layout {}", sku_value, partial_clusters_layout_bitmap); - return partial_clusters_layout_bitmap; + return std::make_pair(partial_clusters_layout_bitmap, static_cast(sku_value)); +} + +Expected PartialClusterReader::get_sku_value_from_arch(hailo_device_architecture_t dev_arch) +{ + switch(dev_arch) { + // Currently only supported architectures for this function are HAILO15H and HAILO15M - but in future can add + case HAILO_ARCH_HAILO15H: + return HAILO15H_SKU_VALUE; + case HAILO_ARCH_HAILO15M: + return HAILO15M_SKU_VALUE; + default: + LOGGER__ERROR("Error, Unknown sku value for Given architecture {}", + HailoRTCommon::get_device_arch_str(dev_arch)); + return make_unexpected(HAILO_INTERNAL_FAILURE); + } +} + +Expected PartialClusterReader::get_partial_clusters_layout_bitmap(hailo_device_architecture_t dev_arch) +{ + std::pair fuse_file_data; + + // If file does not exist - get default values for dev_arch + if (!Filesystem::does_file_exists(std::string(PARTIAL_CLUSTER_READER_CLUSTER_LAYOUT_FILE_PATH))) { + LOGGER__INFO("partial cluster layout bitmap file not found, Enabling all clusters by default"); + auto default_bitmap_exp = get_arch_default_bitmap(dev_arch); + CHECK_EXPECTED(default_bitmap_exp); + fuse_file_data.first = default_bitmap_exp.release(); + + auto sku_value_exp = get_sku_value_from_arch(dev_arch); + CHECK_EXPECTED(sku_value_exp); + fuse_file_data.second = sku_value_exp.release(); + } else { + // This will read bitmap and verify with SKU value + auto fuse_file_exp = read_fuse_file(); + CHECK_EXPECTED(fuse_file_exp); + fuse_file_data = fuse_file_exp.release(); + } + + const auto sku_value = fuse_file_data.second; + switch (dev_arch) { + case HAILO_ARCH_HAILO15H: + CHECK_AS_EXPECTED((HAILO15H_SKU_VALUE == sku_value), HAILO_INTERNAL_FAILURE, + "Device arch is of type {} but sku is {}", dev_arch, sku_value); + break; + case HAILO_ARCH_HAILO15M: + CHECK_AS_EXPECTED((HAILO15M_SKU_VALUE == sku_value), HAILO_INTERNAL_FAILURE, + "Device arch is of type {} but sku is {}", dev_arch, sku_value); + break; + default: + LOGGER__ERROR("Error, Device architecture {} doesnt support partial cluster layout", dev_arch); + return make_unexpected(HAILO_INTERNAL_FAILURE); + } + + return Expected(fuse_file_data.first); +} + +Expected PartialClusterReader::get_actual_dev_arch_from_fuse(hailo_device_architecture_t fw_dev_arch) +{ + // If fuse file does not exist - and fw_dev_arch is HAILO_ARCH_HAILO15H - then it is HAILO_ARCH_HAILO15H + if (!Filesystem::does_file_exists(std::string(PARTIAL_CLUSTER_READER_CLUSTER_LAYOUT_FILE_PATH)) + && (HAILO_ARCH_HAILO15H == fw_dev_arch)) { + return HAILO_ARCH_HAILO15H; + } else { + auto fuse_file_exp = read_fuse_file(); + CHECK_EXPECTED(fuse_file_exp); + const auto fuse_file_data = fuse_file_exp.release(); + + const auto sku_value = fuse_file_data.second; + if (HAILO15M_SKU_VALUE == sku_value) { + return HAILO_ARCH_HAILO15M; + } else if (HAILO15H_SKU_VALUE == sku_value) { + return HAILO_ARCH_HAILO15H; + } else { + LOGGER__ERROR("Error, Invalid sku received {}", sku_value); + return make_unexpected(HAILO_INVALID_ARGUMENT); + } + } } } /* namespace hailort */ diff --git a/hailort/libhailort/src/utils/soc_utils/partial_cluster_reader.hpp b/hailort/libhailort/src/utils/soc_utils/partial_cluster_reader.hpp index 4926272..d656867 100644 --- a/hailort/libhailort/src/utils/soc_utils/partial_cluster_reader.hpp +++ b/hailort/libhailort/src/utils/soc_utils/partial_cluster_reader.hpp @@ -25,23 +25,34 @@ namespace hailort #define PARTIAL_CLUSTERS_LAYOUT_BITMAP__HAILO15M_0 ((0x1 << 1) | (0x1 << 2) | (0x1 << 3)) #define PARTIAL_CLUSTERS_LAYOUT_BITMAP__HAILO15M_1 ((0x1 << 0) | (0x1 << 2) | (0x1 << 3)) #define PARTIAL_CLUSTERS_LAYOUT_BITMAP__HAILO15M_2 ((0x1 << 0) | (0x1 << 1) | (0x1 << 4)) + +#define HAILO15M_PARTIAL_CLUSTER_LAYOUTS_LIST PARTIAL_CLUSTERS_LAYOUT_BITMAP__HAILO15M_0,\ + PARTIAL_CLUSTERS_LAYOUT_BITMAP__HAILO15M_1, PARTIAL_CLUSTERS_LAYOUT_BITMAP__HAILO15M_2 + // Default is all clusters are enabled -#define PARTIAL_CLUSTERS_LAYOUT_BITMAP__HAILO15M_DEFAULT ((0x1 << 0) | (0x1 << 1) | (0x1 << 2) | (0x1 << 3) | (0x1 << 4)) +#define PARTIAL_CLUSTERS_LAYOUT_BITMAP__HAILO15_DEFAULT ((0x1 << 0) | (0x1 << 1) | (0x1 << 2) | (0x1 << 3) | (0x1 << 4)) -constexpr const char* PARTIAL_CLUSTER_READER_CLUSTER_LAYOUT_FILE_PATH = "/sys/devices/platform/fuse"; +constexpr const char* PARTIAL_CLUSTER_READER_CLUSTER_LAYOUT_FILE_PATH = "/sys/devices/soc0/fuse"; // Array that has all the valid layouts for Hailo15M -static constexpr std::array HAILO15M__PARTIAL_CLUSTERS_LAYOUT_BITMAP_ARRAY = { - PARTIAL_CLUSTERS_LAYOUT_BITMAP__HAILO15M_0, PARTIAL_CLUSTERS_LAYOUT_BITMAP__HAILO15M_1, - PARTIAL_CLUSTERS_LAYOUT_BITMAP__HAILO15M_2, PARTIAL_CLUSTERS_LAYOUT_BITMAP__HAILO15M_DEFAULT +static constexpr std::array HAILO15M__PARTIAL_CLUSTERS_LAYOUT_BITMAP_ARRAY = { + HAILO15M_PARTIAL_CLUSTER_LAYOUTS_LIST +}; + +// Array that has all the valid layouts for Hailo15 (Either Hailo15M or Hailo15H) +static constexpr std::array HAILO15__PARTIAL_CLUSTERS_LAYOUT_BITMAP_ARRAY = { + HAILO15M_PARTIAL_CLUSTER_LAYOUTS_LIST, PARTIAL_CLUSTERS_LAYOUT_BITMAP__HAILO15_DEFAULT }; class PartialClusterReader { public: - static Expected get_partial_clusters_layout_bitmap(const hailo_device_architecture_t dev_arch); + static Expected get_partial_clusters_layout_bitmap(hailo_device_architecture_t dev_arch); + static Expected get_actual_dev_arch_from_fuse(hailo_device_architecture_t fw_dev_arch); private: - static Expected get_arch_default_bitmap(const hailo_device_architecture_t dev_arch); - static bool validate_arch_partial_clusters_bitmap(const hailo_device_architecture_t dev_arch, const uint32_t bitmap); + static Expected get_arch_default_bitmap(hailo_device_architecture_t dev_arch); + static Expected get_sku_value_from_arch(hailo_device_architecture_t dev_arch); + static bool validate_arch_partial_clusters_bitmap(uint32_t bitmap, uint8_t sku_value); + static Expected> read_fuse_file(); }; diff --git a/hailort/scripts/download_firmware_eth.cmd b/hailort/scripts/download_firmware_eth.cmd index be29d84..593b252 100644 --- a/hailort/scripts/download_firmware_eth.cmd +++ b/hailort/scripts/download_firmware_eth.cmd @@ -2,7 +2,7 @@ @ECHO OFF set BASE_URI=https://hailo-hailort.s3.eu-west-2.amazonaws.com -set HRT_VERSION=4.16.1 +set HRT_VERSION=4.16.2 set FW_DIR=Hailo8/%HRT_VERSION%/FW set FW=hailo8_fw.%HRT_VERSION%_eth.bin diff --git a/hailort/scripts/download_firmware_eth.sh b/hailort/scripts/download_firmware_eth.sh index 4c07f61..c2104ea 100755 --- a/hailort/scripts/download_firmware_eth.sh +++ b/hailort/scripts/download_firmware_eth.sh @@ -2,7 +2,7 @@ set -e readonly BASE_URI="https://hailo-hailort.s3.eu-west-2.amazonaws.com" -readonly HRT_VERSION=4.16.1 +readonly HRT_VERSION=4.16.2 readonly FW_AWS_DIR="Hailo8/${HRT_VERSION}/FW" readonly FW="hailo8_fw.${HRT_VERSION}_eth.bin" diff --git a/hailort/scripts/download_hefs.cmd b/hailort/scripts/download_hefs.cmd index ac90510..663ffcc 100644 --- a/hailort/scripts/download_hefs.cmd +++ b/hailort/scripts/download_hefs.cmd @@ -1,7 +1,7 @@ :: cmd @ECHO OFF set BASE_URI=https://hailo-hailort.s3.eu-west-2.amazonaws.com -set HRT_VERSION=4.16.1 +set HRT_VERSION=4.16.2 set REMOTE_HEF_DIR=Hailo8/%HRT_VERSION%/HEFS set LOCAL_EXAMPLES_HEF_DIR=..\libhailort\examples\hefs set LOCAL_TUTORIALS_HEF_DIR=..\libhailort\bindings\python\platform\hailo_tutorials\hefs diff --git a/hailort/scripts/download_hefs.sh b/hailort/scripts/download_hefs.sh index 8dd4a80..fe7af3b 100755 --- a/hailort/scripts/download_hefs.sh +++ b/hailort/scripts/download_hefs.sh @@ -2,7 +2,7 @@ set -e readonly BASE_URI="https://hailo-hailort.s3.eu-west-2.amazonaws.com" -readonly HRT_VERSION=4.16.1 +readonly HRT_VERSION=4.16.2 readonly REMOTE_HEF_DIR="Hailo8/${HRT_VERSION}/HEFS" readonly LOCAL_EXAMPLES_HEF_DIR="../libhailort/examples/hefs" readonly LOCAL_TUTORIALS_HEF_DIR="../libhailort/bindings/python/platform/hailo_tutorials/hefs" -- 2.34.1