From 08f088d3b443c7846af067269ce998c6d5d91449 Mon Sep 17 00:00:00 2001 From: HailoRT-Automation <98901220+HailoRT-Automation@users.noreply.github.com> Date: Tue, 30 Sep 2025 20:13:45 +0800 Subject: [PATCH] v4.23.0 (#32) --- hailort/CMakeLists.txt | 2 +- hailort/drivers/common/hailo_ioctl_common.h | 54 +------- hailort/libhailort/CMakeLists.txt | 2 +- .../bindings/gstreamer/CMakeLists.txt | 2 +- .../platform/hailo_platform/__init__.py | 2 +- .../hailo_platform/pyhailort/pyhailort.py | 2 +- .../bindings/python/platform/setup.py | 2 +- .../bindings/python/src/CMakeLists.txt | 4 +- .../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 +- .../CMakeLists.txt | 2 +- .../async_infer_basic_example/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 +- .../src/vdma/driver/hailort_driver.cpp | 131 ++---------------- .../src/vdma/driver/hailort_driver.hpp | 3 +- .../src/vdma/driver/os/driver_os_specific.hpp | 4 +- .../os/posix/linux/driver_os_specific.cpp | 13 +- .../driver/os/windows/driver_os_specific.cpp | 1 - hailort/scripts/download_hefs.cmd | 2 +- hailort/scripts/download_hefs.sh | 2 +- 40 files changed, 57 insertions(+), 219 deletions(-) diff --git a/hailort/CMakeLists.txt b/hailort/CMakeLists.txt index dfcc82b..a74aaa1 100644 --- a/hailort/CMakeLists.txt +++ b/hailort/CMakeLists.txt @@ -29,7 +29,7 @@ endif() # Set firmware version add_definitions( -DFIRMWARE_VERSION_MAJOR=4 ) -add_definitions( -DFIRMWARE_VERSION_MINOR=22 ) +add_definitions( -DFIRMWARE_VERSION_MINOR=23 ) add_definitions( -DFIRMWARE_VERSION_REVISION=0 ) if(HAILO_BUILD_SERVICE) add_definitions( -DHAILO_SUPPORT_MULTI_PROCESS ) diff --git a/hailort/drivers/common/hailo_ioctl_common.h b/hailort/drivers/common/hailo_ioctl_common.h index 4a56535..b92711d 100644 --- a/hailort/drivers/common/hailo_ioctl_common.h +++ b/hailort/drivers/common/hailo_ioctl_common.h @@ -7,7 +7,7 @@ #define _HAILO_IOCTL_COMMON_H_ #define HAILO_DRV_VER_MAJOR 4 -#define HAILO_DRV_VER_MINOR 22 +#define HAILO_DRV_VER_MINOR 23 #define HAILO_DRV_VER_REVISION 0 #define _STRINGIFY_EXPANDED( x ) #x @@ -354,51 +354,7 @@ struct hailo_fw_control { enum hailo_cpu_id cpu_id; }; -/* structure used in ioctl HAILO_MEMORY_TRANSFER */ -// Max bar transfer size gotten from ATR0_TABLE_SIZE -#define MAX_MEMORY_TRANSFER_LENGTH (4096) -enum hailo_transfer_direction { - TRANSFER_READ = 0, - TRANSFER_WRITE, - - /** Max enum value to maintain ABI Integrity */ - TRANSFER_MAX_ENUM = INT_MAX, -}; - -enum hailo_transfer_memory_type { - HAILO_TRANSFER_DEVICE_DIRECT_MEMORY, - - // vDMA memories - HAILO_TRANSFER_MEMORY_VDMA0 = 0x100, - HAILO_TRANSFER_MEMORY_VDMA1, - HAILO_TRANSFER_MEMORY_VDMA2, - - // PCIe driver memories - HAILO_TRANSFER_MEMORY_PCIE_BAR0 = 0x200, - HAILO_TRANSFER_MEMORY_PCIE_BAR2 = 0x202, - HAILO_TRANSFER_MEMORY_PCIE_BAR4 = 0x204, - - // DRAM DMA driver memories - HAILO_TRANSFER_MEMORY_DMA_ENGINE0 = 0x300, - HAILO_TRANSFER_MEMORY_DMA_ENGINE1, - HAILO_TRANSFER_MEMORY_DMA_ENGINE2, - - // PCIe EP driver memories - HAILO_TRANSFER_MEMORY_PCIE_EP_CONFIG = 0x400, - HAILO_TRANSFER_MEMORY_PCIE_EP_BRIDGE, - - /** Max enum value to maintain ABI Integrity */ - HAILO_TRANSFER_MEMORY_MAX_ENUM = INT_MAX, -}; - -struct hailo_memory_transfer_params { - enum hailo_transfer_direction transfer_direction; // in - enum hailo_transfer_memory_type memory_type; // in - uint64_t address; // in - size_t count; // in - uint8_t buffer[MAX_MEMORY_TRANSFER_LENGTH]; // in/out -}; /* structure used in ioctl HAILO_VDMA_BUFFER_SYNC */ enum hailo_vdma_buffer_sync_type { @@ -576,7 +532,7 @@ struct tCompatibleHailoIoctlData tCompatibleHailoIoctlParam Parameters; ULONG_PTR Value; union { - struct hailo_memory_transfer_params MemoryTransfer; + struct hailo_vdma_enable_channels_params VdmaEnableChannels; struct hailo_vdma_disable_channels_params VdmaDisableChannels; struct hailo_vdma_interrupts_read_timestamp_params VdmaInterruptsReadTimestamps; @@ -606,15 +562,13 @@ struct tCompatibleHailoIoctlData #pragma pack(pop) enum hailo_general_ioctl_code { - HAILO_MEMORY_TRANSFER_CODE, - HAILO_QUERY_DEVICE_PROPERTIES_CODE, - HAILO_QUERY_DRIVER_INFO_CODE, + HAILO_QUERY_DEVICE_PROPERTIES_CODE = 1, + HAILO_QUERY_DRIVER_INFO_CODE = 2, // Must be last HAILO_GENERAL_IOCTL_MAX_NR, }; -#define HAILO_MEMORY_TRANSFER _IOWR_(HAILO_GENERAL_IOCTL_MAGIC, HAILO_MEMORY_TRANSFER_CODE, struct hailo_memory_transfer_params) #define HAILO_QUERY_DEVICE_PROPERTIES _IOW_(HAILO_GENERAL_IOCTL_MAGIC, HAILO_QUERY_DEVICE_PROPERTIES_CODE, struct hailo_device_properties) #define HAILO_QUERY_DRIVER_INFO _IOW_(HAILO_GENERAL_IOCTL_MAGIC, HAILO_QUERY_DRIVER_INFO_CODE, struct hailo_driver_info) diff --git a/hailort/libhailort/CMakeLists.txt b/hailort/libhailort/CMakeLists.txt index eb3acf8..355c39e 100644 --- a/hailort/libhailort/CMakeLists.txt +++ b/hailort/libhailort/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.5.0) # set(CMAKE_C_CLANG_TIDY "clang-tidy;-checks=*") set(HAILORT_MAJOR_VERSION 4) -set(HAILORT_MINOR_VERSION 22) +set(HAILORT_MINOR_VERSION 23) set(HAILORT_REVISION_VERSION 0) # Add the cmake folder so the modules there are found diff --git a/hailort/libhailort/bindings/gstreamer/CMakeLists.txt b/hailort/libhailort/bindings/gstreamer/CMakeLists.txt index 8b9542c..b301130 100644 --- a/hailort/libhailort/bindings/gstreamer/CMakeLists.txt +++ b/hailort/libhailort/bindings/gstreamer/CMakeLists.txt @@ -4,7 +4,7 @@ project(gsthailo) include(GNUInstallDirs) -find_package(HailoRT 4.22.0 EXACT REQUIRED) +find_package(HailoRT 4.23.0 EXACT REQUIRED) # GST_PLUGIN_DEFINE needs PACKAGE to be defined set(GST_HAILO_PACKAGE_NAME "hailo") diff --git a/hailort/libhailort/bindings/python/platform/hailo_platform/__init__.py b/hailort/libhailort/bindings/python/platform/hailo_platform/__init__.py index 35e870b..fccfa88 100644 --- a/hailort/libhailort/bindings/python/platform/hailo_platform/__init__.py +++ b/hailort/libhailort/bindings/python/platform/hailo_platform/__init__.py @@ -43,7 +43,7 @@ def _verify_pyhailort_lib_exists(): _verify_pyhailort_lib_exists() -__version__ = "4.22.0" +__version__ = "4.23.0" if _pyhailort.__version__ != __version__: raise ImportError( f"_pyhailort version ({_pyhailort.__version__}) does not match pyhailort version ({__version__})" 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 7c05491..21c42a1 100644 --- a/hailort/libhailort/bindings/python/platform/hailo_platform/pyhailort/pyhailort.py +++ b/hailort/libhailort/bindings/python/platform/hailo_platform/pyhailort/pyhailort.py @@ -1588,7 +1588,7 @@ class HailoFormatFlags(_pyhailort.FormatFlags): SUPPORTED_PROTOCOL_VERSION = 2 SUPPORTED_FW_MAJOR = 4 -SUPPORTED_FW_MINOR = 22 +SUPPORTED_FW_MINOR = 23 SUPPORTED_FW_REVISION = 0 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 cf6e2b8..9b6bfbb 100644 --- a/hailort/libhailort/bindings/python/platform/setup.py +++ b/hailort/libhailort/bindings/python/platform/setup.py @@ -146,6 +146,6 @@ if __name__ == "__main__": "linux_aarch64", ], url="https://hailo.ai/", - version="4.22.0", + version="4.23.0", zip_safe=False, ) diff --git a/hailort/libhailort/bindings/python/src/CMakeLists.txt b/hailort/libhailort/bindings/python/src/CMakeLists.txt index b697d2a..d4afe44 100644 --- a/hailort/libhailort/bindings/python/src/CMakeLists.txt +++ b/hailort/libhailort/bindings/python/src/CMakeLists.txt @@ -76,7 +76,7 @@ if(LIBHAILORT_PATH AND HAILORT_INCLUDE_DIR) _pyhailort PUBLIC HAILORT_MAJOR_VERSION=4 - HAILORT_MINOR_VERSION=22 + HAILORT_MINOR_VERSION=23 HAILORT_REVISION_VERSION=0 ) set_target_properties( @@ -88,7 +88,7 @@ if(LIBHAILORT_PATH AND HAILORT_INCLUDE_DIR) elseif(LIBHAILORT_PATH OR HAILORT_INCLUDE_DIR) message(FATAL_ERROR "Both LIBHAILORT_PATH and HAILORT_INCLUDE_DIR must be defined or none of them. LIBHAILORT_PATH: '${LIBHAILORT_PATH}', HAILORT_INCLUDE_DIR: '${HAILORT_INCLUDE_DIR}'") else() - find_package(HailoRT 4.22.0 EXACT REQUIRED) + find_package(HailoRT 4.23.0 EXACT REQUIRED) target_link_libraries(_pyhailort PRIVATE HailoRT::libhailort) endif() diff --git a/hailort/libhailort/examples/c/data_quantization_example/CMakeLists.txt b/hailort/libhailort/examples/c/data_quantization_example/CMakeLists.txt index 7c1eded..96ed0ee 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.5.0) set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) -find_package(HailoRT 4.22.0 EXACT REQUIRED) +find_package(HailoRT 4.23.0 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 043da1e..969bd05 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.5.0) set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) -find_package(HailoRT 4.22.0 EXACT REQUIRED) +find_package(HailoRT 4.23.0 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 261459e..6f90161 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.5.0) set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) -find_package(HailoRT 4.22.0 EXACT REQUIRED) +find_package(HailoRT 4.23.0 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 0254f8b..88eabec 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.5.0) find_package(Threads REQUIRED) set(THREADS_PREFER_PTHREAD_FLAG ON) -find_package(HailoRT 4.22.0 EXACT REQUIRED) +find_package(HailoRT 4.23.0 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 362c61a..69b5bef 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.5.0) set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) -find_package(HailoRT 4.22.0 EXACT REQUIRED) +find_package(HailoRT 4.23.0 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 140f81e..2fed524 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.5.0) -find_package(HailoRT 4.22.0 EXACT REQUIRED) +find_package(HailoRT 4.23.0 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 c6346f2..39336c3 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.5.0) -find_package(HailoRT 4.22.0 EXACT REQUIRED) +find_package(HailoRT 4.23.0 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 ebdd548..72d8465 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.5.0) set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) -find_package(HailoRT 4.22.0 EXACT REQUIRED) +find_package(HailoRT 4.23.0 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 89a8a9a..0bb19c2 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.5.0) set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) -find_package(HailoRT 4.22.0 EXACT REQUIRED) +find_package(HailoRT 4.23.0 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 fa151a2..4a60bfe 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.5.0) set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) -find_package(HailoRT 4.22.0 EXACT REQUIRED) +find_package(HailoRT 4.23.0 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 30c1438..dcf391a 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.5.0) set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) -find_package(HailoRT 4.22.0 EXACT REQUIRED) +find_package(HailoRT 4.23.0 EXACT REQUIRED) SET_SOURCE_FILES_PROPERTIES(vstreams_example.c PROPERTIES LANGUAGE C) diff --git a/hailort/libhailort/examples/cpp/async_infer_advanced_example/CMakeLists.txt b/hailort/libhailort/examples/cpp/async_infer_advanced_example/CMakeLists.txt index 6e22a87..c0e28ea 100644 --- a/hailort/libhailort/examples/cpp/async_infer_advanced_example/CMakeLists.txt +++ b/hailort/libhailort/examples/cpp/async_infer_advanced_example/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.5.0) -find_package(HailoRT 4.22.0 EXACT REQUIRED) +find_package(HailoRT 4.23.0 EXACT REQUIRED) add_executable(cpp_async_infer_advanced_example async_infer_advanced_example.cpp) target_link_libraries(cpp_async_infer_advanced_example PRIVATE HailoRT::libhailort) diff --git a/hailort/libhailort/examples/cpp/async_infer_basic_example/CMakeLists.txt b/hailort/libhailort/examples/cpp/async_infer_basic_example/CMakeLists.txt index 19550c7..dea57a2 100644 --- a/hailort/libhailort/examples/cpp/async_infer_basic_example/CMakeLists.txt +++ b/hailort/libhailort/examples/cpp/async_infer_basic_example/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.5.0) -find_package(HailoRT 4.22.0 EXACT REQUIRED) +find_package(HailoRT 4.23.0 EXACT REQUIRED) add_executable(cpp_async_infer_basic_example async_infer_basic_example.cpp) target_link_libraries(cpp_async_infer_basic_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 4f42997..b26b75f 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.5.0) -find_package(HailoRT 4.22.0 EXACT REQUIRED) +find_package(HailoRT 4.23.0 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 e7d98b3..26c5744 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.5.0) set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) -find_package(HailoRT 4.22.0 EXACT REQUIRED) +find_package(HailoRT 4.23.0 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 a7ee1b9..345a1c7 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.5.0) find_package(Threads REQUIRED) set(THREADS_PREFER_PTHREAD_FLAG ON) -find_package(HailoRT 4.22.0 EXACT REQUIRED) +find_package(HailoRT 4.23.0 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 1a76d1c..52ee845 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.5.0) set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) -find_package(HailoRT 4.22.0 EXACT REQUIRED) +find_package(HailoRT 4.23.0 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 cce93ed..c0c3f9b 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.5.0) -find_package(HailoRT 4.22.0 EXACT REQUIRED) +find_package(HailoRT 4.23.0 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 0702073..54bbf0b 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.5.0) -find_package(HailoRT 4.22.0 EXACT REQUIRED) +find_package(HailoRT 4.23.0 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 7c4f670..f2eba34 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.5.0) set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) -find_package(HailoRT 4.22.0 EXACT REQUIRED) +find_package(HailoRT 4.23.0 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 6189a96..b77b153 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.5.0) set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) -find_package(HailoRT 4.22.0 EXACT REQUIRED) +find_package(HailoRT 4.23.0 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 865be9c..7f61a0e 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.5.0) set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) -find_package(HailoRT 4.22.0 EXACT REQUIRED) +find_package(HailoRT 4.23.0 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 2cf59d4..9c18ddc 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.5.0) set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) -find_package(HailoRT 4.22.0 EXACT REQUIRED) +find_package(HailoRT 4.23.0 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 dc9d55b..9a26f68 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.5.0) find_package(Threads REQUIRED) set(THREADS_PREFER_PTHREAD_FLAG ON) -find_package(HailoRT 4.22.0 EXACT REQUIRED) +find_package(HailoRT 4.23.0 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 fa76295..d76e07b 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.5.0) set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) -find_package(HailoRT 4.22.0 EXACT REQUIRED) +find_package(HailoRT 4.23.0 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/vdma/driver/hailort_driver.cpp b/hailort/libhailort/src/vdma/driver/hailort_driver.cpp index c8b6d4a..292707a 100755 --- a/hailort/libhailort/src/vdma/driver/hailort_driver.cpp +++ b/hailort/libhailort/src/vdma/driver/hailort_driver.cpp @@ -89,39 +89,7 @@ static enum hailo_cpu_id translate_cpu_id(hailo_cpu_id_t cpu_id) return HAILO_CPU_ID_NONE; } -static hailo_transfer_memory_type translate_memory_type(HailoRTDriver::MemoryType memory_type) -{ - using MemoryType = HailoRTDriver::MemoryType; - switch (memory_type) { - case MemoryType::DIRECT_MEMORY: - return HAILO_TRANSFER_DEVICE_DIRECT_MEMORY; - case MemoryType::VDMA0: - return HAILO_TRANSFER_MEMORY_VDMA0; - case MemoryType::VDMA1: - return HAILO_TRANSFER_MEMORY_VDMA1; - case MemoryType::VDMA2: - return HAILO_TRANSFER_MEMORY_VDMA2; - case MemoryType::PCIE_BAR0: - return HAILO_TRANSFER_MEMORY_PCIE_BAR0; - case MemoryType::PCIE_BAR2: - return HAILO_TRANSFER_MEMORY_PCIE_BAR2; - case MemoryType::PCIE_BAR4: - return HAILO_TRANSFER_MEMORY_PCIE_BAR4; - case MemoryType::DMA_ENGINE0: - return HAILO_TRANSFER_MEMORY_DMA_ENGINE0; - case MemoryType::DMA_ENGINE1: - return HAILO_TRANSFER_MEMORY_DMA_ENGINE1; - case MemoryType::DMA_ENGINE2: - return HAILO_TRANSFER_MEMORY_DMA_ENGINE2; - case MemoryType::PCIE_EP_CONFIG: - return HAILO_TRANSFER_MEMORY_PCIE_EP_CONFIG; - case MemoryType::PCIE_EP_BRIDGE: - return HAILO_TRANSFER_MEMORY_PCIE_EP_BRIDGE; - } - assert(false); - return HAILO_TRANSFER_MEMORY_MAX_ENUM; -} static hailo_dma_data_direction direction_to_dma_data_direction(HailoRTDriver::DmaDirection direction) { switch (direction) { @@ -352,52 +320,20 @@ Expected> HailoRTDriver::scan_devices(Acc hailo_status HailoRTDriver::read_memory(MemoryType memory_type, uint64_t address, void *buf, size_t size) { - if (size == 0) { - LOGGER__ERROR("Invalid size to read"); - return HAILO_INVALID_ARGUMENT; - } - - if (buf == nullptr) { - LOGGER__ERROR("Read buffer pointer is NULL"); - return HAILO_INVALID_ARGUMENT; - } - - constexpr uint32_t CHUNK_SIZE = ARRAY_ENTRIES(hailo_memory_transfer_params::buffer); - uint32_t offset = 0; - - while (offset < size) { - const uint32_t actual_size = std::min(CHUNK_SIZE, static_cast(size) - offset); - auto status = read_memory_ioctl(memory_type, address + offset, - reinterpret_cast(buf) + offset, actual_size); - CHECK_SUCCESS(status); - offset += actual_size; - } - return HAILO_SUCCESS; + (void)memory_type; + (void)address; + (void)buf; + (void)size; + return HAILO_NOT_IMPLEMENTED; } hailo_status HailoRTDriver::write_memory(MemoryType memory_type, uint64_t address, const void *buf, size_t size) { - if (size == 0) { - LOGGER__ERROR("Invalid size to read"); - return HAILO_INVALID_ARGUMENT; - } - - if (buf == nullptr) { - LOGGER__ERROR("Read buffer pointer is NULL"); - return HAILO_INVALID_ARGUMENT; - } - - constexpr uint32_t CHUNK_SIZE = ARRAY_ENTRIES(hailo_memory_transfer_params::buffer); - uint32_t offset = 0; - - while (offset < size) { - const uint32_t actual_size = std::min(CHUNK_SIZE, static_cast(size) - offset); - auto status = write_memory_ioctl(memory_type, address + offset, - reinterpret_cast(buf) + offset, actual_size); - CHECK_SUCCESS(status); - offset += actual_size; - } - return HAILO_SUCCESS; + (void)memory_type; + (void)address; + (void)buf; + (void)size; + return HAILO_NOT_IMPLEMENTED; } hailo_status HailoRTDriver::vdma_enable_channels(const ChannelsBitmap &channels_bitmap, bool enable_timestamps_measure) @@ -916,56 +852,9 @@ int HailoRTDriver::run_ioctl(uint32_t ioctl_code, PointerType param) #error "Unsupported platform" #endif -hailo_status HailoRTDriver::read_memory_ioctl(MemoryType memory_type, uint64_t address, void *buf, size_t size) -{ - CHECK(size != 0, HAILO_INVALID_ARGUMENT, "Invalid size to read"); - CHECK(buf != nullptr, HAILO_INVALID_ARGUMENT, "Read buffer pointer is NULL"); - if (m_dma_type == DmaType::PCIE) { - CHECK(address < std::numeric_limits::max(), HAILO_INVALID_ARGUMENT, "Address out of range {}", address); - } - hailo_memory_transfer_params transfer{}; - transfer.transfer_direction = TRANSFER_READ; - transfer.memory_type = translate_memory_type(memory_type); - transfer.address = address; - transfer.count = size; - memset(transfer.buffer, 0, sizeof(transfer.buffer)); - CHECK(size <= sizeof(transfer.buffer), HAILO_INVALID_ARGUMENT, - "Invalid size to read, size given {} is larger than max size {}", size, sizeof(transfer.buffer)); - - RUN_AND_CHECK_IOCTL_RESULT(HAILO_MEMORY_TRANSFER, &transfer, "Failed read memory"); - - memcpy(buf, transfer.buffer, transfer.count); - - return HAILO_SUCCESS; -} - -hailo_status HailoRTDriver::write_memory_ioctl(MemoryType memory_type, uint64_t address, const void *buf, size_t size) -{ - CHECK(size != 0, HAILO_INVALID_ARGUMENT, "Invalid size to read"); - CHECK(buf != nullptr, HAILO_INVALID_ARGUMENT, "Read buffer pointer is NULL"); - - if (m_dma_type == DmaType::PCIE) { - CHECK(address < std::numeric_limits::max(), HAILO_INVALID_ARGUMENT, "Address out of range {}", address); - } - - hailo_memory_transfer_params transfer{}; - transfer.transfer_direction = TRANSFER_WRITE; - transfer.memory_type = translate_memory_type(memory_type); - transfer.address = address; - transfer.count = size; - memset(transfer.buffer, 0, sizeof(transfer.buffer)); - - CHECK(size <= sizeof(transfer.buffer), HAILO_INVALID_ARGUMENT, - "Invalid size to write, size given {} is larger than max size {}", size, sizeof(transfer.buffer)); - - memcpy(transfer.buffer, buf, transfer.count); - - RUN_AND_CHECK_IOCTL_RESULT(HAILO_MEMORY_TRANSFER, &transfer, "Failed write memory"); - return HAILO_SUCCESS; -} #if defined(__linux__) || defined(_WIN32) Expected HailoRTDriver::vdma_buffer_map_ioctl(uintptr_t user_address, size_t required_size, diff --git a/hailort/libhailort/src/vdma/driver/hailort_driver.hpp b/hailort/libhailort/src/vdma/driver/hailort_driver.hpp index 9c86181..4e1feb6 100755 --- a/hailort/libhailort/src/vdma/driver/hailort_driver.hpp +++ b/hailort/libhailort/src/vdma/driver/hailort_driver.hpp @@ -411,8 +411,7 @@ private: template int run_ioctl(uint32_t ioctl_code, PointerType param); - hailo_status read_memory_ioctl(MemoryType memory_type, uint64_t address, void *buf, size_t size); - hailo_status write_memory_ioctl(MemoryType memory_type, uint64_t address, const void *buf, size_t size); + Expected vdma_buffer_map_ioctl(uintptr_t user_address, size_t required_size, DmaDirection data_direction, const vdma_mapped_buffer_driver_identifier &driver_buff_handle, diff --git a/hailort/libhailort/src/vdma/driver/os/driver_os_specific.hpp b/hailort/libhailort/src/vdma/driver/os/driver_os_specific.hpp index d243884..b685f9e 100644 --- a/hailort/libhailort/src/vdma/driver/os/driver_os_specific.hpp +++ b/hailort/libhailort/src/vdma/driver/os/driver_os_specific.hpp @@ -37,9 +37,7 @@ int run_hailo_ioctl(underlying_handle_t file, uint32_t ioctl_code, void *param); /** * On windows, all IOCTLs shares the same structure for input and output (tCompatibleHailoIoctlData). - * To make windows and posix code the same, we need to convert the actual structure type (for example - * hailo_memory_transfer_params) to the compatible structure (tCompatibleHailoIoctlData::Buffer::MemoryTransfer). - * + * To make windows and posix code the same, we need to convert the actual structure type * This template static class is used to covert to compatible (for input parameters) and from compatible (for output * parameters). */ diff --git a/hailort/libhailort/src/vdma/driver/os/posix/linux/driver_os_specific.cpp b/hailort/libhailort/src/vdma/driver/os/posix/linux/driver_os_specific.cpp index 135b70e..9a8b038 100644 --- a/hailort/libhailort/src/vdma/driver/os/posix/linux/driver_os_specific.cpp +++ b/hailort/libhailort/src/vdma/driver/os/posix/linux/driver_os_specific.cpp @@ -22,8 +22,8 @@ namespace hailort { -#define HAILO_CLASS_PATH ("/sys/class/hailo_chardev") -#define HAILO_BOARD_LOCATION_FILENAME ("board_location") +#define HAILO_CLASS_PATH ("/sys/class/hailo_chardev") +#define HAILO_BOARD_LOCATION_FILENAME ("board_location") #define HAILO_BOARD_ACCELERATOR_TYPE_FILENAME ("accelerator_type") Expected open_device_file(const std::string &path) @@ -38,19 +38,18 @@ Expected open_device_file(const std::string &path) Expected> list_devices() { + std::vector devices; DIR *dir_iter = opendir(HAILO_CLASS_PATH); if (!dir_iter) { if (ENOENT == errno) { - LOGGER__ERROR("Can't find hailort driver class. Can happen if the driver is not installed, if the kernel was updated or on some driver failure (then read driver dmesg log)"); - return make_unexpected(HAILO_DRIVER_NOT_INSTALLED); - } - else { + // Hailo chrdev-class does not exist; meaning no devices have been detected by driver. + return devices; + } else { LOGGER__ERROR("Failed to open hailo pcie class ({}), errno {}", HAILO_CLASS_PATH, errno); return make_unexpected(HAILO_DRIVER_INVALID_RESPONSE); } } - std::vector devices; struct dirent *dir = nullptr; while ((dir = readdir(dir_iter)) != nullptr) { std::string device_name(dir->d_name); diff --git a/hailort/libhailort/src/vdma/driver/os/windows/driver_os_specific.cpp b/hailort/libhailort/src/vdma/driver/os/windows/driver_os_specific.cpp index 07d86b1..a962b8c 100644 --- a/hailort/libhailort/src/vdma/driver/os/windows/driver_os_specific.cpp +++ b/hailort/libhailort/src/vdma/driver/os/windows/driver_os_specific.cpp @@ -291,7 +291,6 @@ Expected query_device_info(const std::string &device_ *(param_ptr) = data.Buffer.NameInCompatible; \ } -COMPATIBLE_PARAM_CAST(hailo_memory_transfer_params, MemoryTransfer); COMPATIBLE_PARAM_CAST(hailo_vdma_enable_channels_params, VdmaEnableChannels) COMPATIBLE_PARAM_CAST(hailo_vdma_disable_channels_params, VdmaDisableChannels) COMPATIBLE_PARAM_CAST(hailo_vdma_interrupts_read_timestamp_params, VdmaInterruptsReadTimestamps) diff --git a/hailort/scripts/download_hefs.cmd b/hailort/scripts/download_hefs.cmd index 545368a..ea9aa45 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.22.0 +set HRT_VERSION=4.23.0 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 4310ca9..813ff22 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.22.0 +readonly HRT_VERSION=4.23.0 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"