{"id":787,"date":"2025-03-19T08:00:19","date_gmt":"2025-03-19T00:00:19","guid":{"rendered":"https:\/\/www.zhoubin.asia\/?p=787"},"modified":"2025-03-18T23:41:37","modified_gmt":"2025-03-18T15:41:37","slug":"integration-tool","status":"publish","type":"post","link":"https:\/\/www.zhoubin.asia\/index.php\/2025\/03\/19\/integration-tool\/","title":{"rendered":"\u5982\u4f55\u5229\u7528 Integration Tool \u6e90\u7801\u4ee5\u53ca\u539f\u59cb\u4e0b\u8f7d\u7684 DEB \u5305\u8fdb\u884c\u7f16\u8bd1\u5e76\u751f\u6210\u5408\u9002\u7684 DEB \u5b89\u88c5\u5305"},"content":{"rendered":"<h2>1. \u89e3\u538b\u539f\u59cb DEB \u5305<\/h2>\n<p>\u9996\u5148\uff0c\u627e\u5230\u4e00\u4e2a <code>test<\/code> \u76ee\u5f55\uff0c\u5c06\u4ece<a href=\"https:\/\/hailo.ai\/?dl_dev=1&amp;file=fc0d46cbb7435c10c131a9ace516ecd2\">\u5b98\u7f51\u4e0b\u8f7d<\/a>\u7684DEB \u5b89\u88c5\u5305\u7684\u6240\u6709\u5185\u5bb9\u89e3\u538b\u5230\u8fd9\u4e2a\u4e34\u65f6\u76ee\u5f55\u3002\u53ef\u4ee5\u770b\u5230\u7c7b\u4f3c\u5982\u4e0b\u7684\u6587\u4ef6\u7ed3\u6784\uff1a<\/p>\n<pre>\u251c\u2500\u2500 DEBIAN\r\n\u2502   \u2514\u2500\u2500 control\r\n\u251c\u2500\u2500 etc\r\n\u2502   \u2514\u2500\u2500 hailo_accelerator_integration_tool\r\n\u251c\u2500\u2500 usr\r\n\u2502   \u2514\u2500\u2500 bin\r\n\u2514\u2500\u2500 var\r\n    \u2514\u2500\u2500 hailo_accelerator_integration_tool\r\n<\/pre>\n<p>\u5176\u4e2d <code>usr\/bin\/<\/code> \u76ee\u5f55\u91cc\u7684 <code>hailo-accelerator-integration-tool<\/code> \u4e3a\u5de5\u5177\u7684\u53ef\u6267\u884c\u6587\u4ef6\uff0c\u9ed8\u8ba4\u4f9d\u8d56 <code>hailort 4.19.0<\/code>\u3002<\/p>\n<h2>2. \u66f4\u65b0 Hailort \u7248\u672c<\/h2>\n<p>\u82e5\u8981\u652f\u6301\u66f4\u9ad8\u7248\u672c\u7684 <code>hailort<\/code>\uff0c\u907f\u514d\u964d\u7ea7\u6d4b\u8bd5\uff0c\u53ef\u624b\u52a8\u7f16\u8bd1\u5e76\u66ff\u6362\u00a0<code>hailo-accelerator-integration-tool<\/code>\uff1a<\/p>\n<h3>2.1 \u7f16\u8bd1 X86 \u7248\u672c<\/h3>\n<pre>\u4f9d\u7136\u4ece<a href=\"https:\/\/hailo.ai\/?dl_dev=1&amp;file=8eba3c9665179311fd076c7e245f76ef\">\u5b98\u7f51\u4e0b\u8f7d<\/a>\u5bf9\u5e94\u7684\u6e90\u7801\u5e76\u89e3\u538b\r\n\u6211\u8fd9\u8fb9\u4ee5x86 ubuntu 20.04\u73af\u5883\u7f16\u8bd1\u4e3a\u57fa\u51c6\u6765\u8fdb\u884c\u8bf4\u660e\r\n\u8bf7\u5c3d\u91cf\u4ee5\u4f60\u9700\u8981\u7684\u6700\u4f4eubuntu\u7248\u672c\u6765\u7f16\u8bd1\uff0c\u5426\u5219\u53ef\u80fd\u4f1a\u9047\u5230GLIBC\u4e0d\u517c\u5bb9\u7684\u95ee\u9898\uff0c\u5b9e\u5728\u4e0d\u884c\u8bf7\u4f7f\u7528docker\u8fdb\u884c\u7f16\u8bd1\r\n<\/pre>\n<pre>unzip hailo_accelerator_integration_tool_1.19.0_sources.zip\r\n# \u4fee\u6539 CMakeLists.txt\r\nset(HAILORT_VERSION <strong>4.20.0<\/strong>)\r\n\u7f16\u8bd1\u53ef\u6267\u884c\u6587\u4ef6\uff1a\r\ncmake -S . -Bbuild\r\ncmake --build build<\/pre>\n<p>\u82e5\u6709\u5934\u6587\u4ef6\u62a5\u9519\uff0c\u9700\u624b\u52a8\u6dfb\u52a0\u5bf9\u5e94\u5934\u6587\u4ef6\u76ee\u5f55\uff1a<\/p>\n<pre>target_include_directories(hailo-accelerator-integration-tool PRIVATE\r\n    ${CMAKE_CURRENT_BINARY_DIR}\r\n    <strong>${CMAKE_SOURCE_DIR}<\/strong>\r\n)\r\n<\/pre>\n<p>\u7f16\u8bd1\u5b8c\u6210\u540e\uff0c\u5c06\u751f\u6210\u7684 <code>build\/hailo-accelerator-integration-tool<\/code> \u66ff\u6362\u89e3\u538b\u76ee\u5f55\u4e2d\u7684 <code>usr\/bin\/<\/code>\u00a0\u7684\u53ef\u6267\u884c\u6587\u4ef6\u3002<\/p>\n<h3>2.2 \u6253\u5305\u65b0\u7684 DEB \u5305<\/h3>\n<pre>dpkg-deb -b .\/ hailo_accelerator_integration_tool_1.19.0_amd64_4.20.0.deb\r\n<\/pre>\n<h2>3. \u7f16\u8bd1 ARM \u7248\u672c<\/h2>\n<h3>3.1 \u5b89\u88c5 ARM64 \u4ea4\u53c9\u7f16\u8bd1\u73af\u5883<\/h3>\n<pre>sudo apt update\r\nsudo apt install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu\r\n<\/pre>\n<h3>3.2 \u7f16\u8bd1 ARM \u7248\u672c\u7684 Hailort<\/h3>\n<pre># \u5728 Hailort \u6e90\u7801\u76ee\u5f55\u7684 CMakeLists.txt \u6dfb\u52a0\uff1a\r\nset(CMAKE_SYSTEM_NAME Linux)\r\nset(CMAKE_SYSTEM_PROCESSOR aarch64)\r\n\r\nset(CMAKE_C_COMPILER aarch64-linux-gnu-gcc)\r\nset(CMAKE_CXX_COMPILER aarch64-linux-gnu-g++)\r\nset(CMAKE_FIND_ROOT_PATH \/usr\/aarch64-linux-gnu)\r\n\r\nset(CMAKE_C_FLAGS \"-march=armv8-a\")\r\nset(CMAKE_CXX_FLAGS \"${CMAKE_C_FLAGS}\")\r\n\r\n# \u7f16\u8bd1\u547d\u4ee4\uff1a\r\ncmake -S . -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=build\/deploy\r\ncmake --build build --parallel --target install\r\n\u4f7f\u7528-DCMAKE_INSTALL_PREFIX\u7684\u76ee\u7684\u4e3a\u5c06\u7f16\u8bd1\u7684\u5e93\u4e0e\u5934\u6587\u4ef6\u7b49\u5b89\u88c5\u5230\u7279\u5b9a\u7684\u76ee\u5f55build\/deploy\r\n<\/pre>\n<h3>3.3 \u7f16\u8bd1 ARM \u7248\u672c\u7684 Integration Tool<\/h3>\n<pre>cmake -S . -Bbuild -DCMAKE_PREFIX_PATH=..\/hailort_4.20.0\/build\/deploy\/\r\ncmake --build build\r\n\u7c7b\u4f3c\u7684, \u4f7f\u7528-DCMAKE_PREFIX_PATH\u7684\u76ee\u7684\uff0c\u4f1a\u6307\u5b9a\u7f16\u8bd1\u5668\u5bfb\u627ehailort library\u7684\u76ee\u5f55\u3002\r\n<\/pre>\n<h2>4. \u6d4b\u8bd5\u9879\u8c03\u6574\uff08\u9488\u5bf9\u65e0 INA231 \u82af\u7247\u7684\u677f\u5b50\uff09<\/h2>\n<p>\u5982\u679cH8\u7684\u5f00\u53d1\u677f\u6ca1\u6709 INA231 \u82af\u7247\uff0c\u9700\u8bbe\u7f6e <code>thermal_theta_estimation_test<\/code> \u548c <code>overcurrent_test<\/code> \u4e3a <code>false<\/code>\u3002\u6b64\u5916\uff0c<code>thermal_stress_test<\/code> \u4e2d\u529f\u8017\u6d4b\u91cf\u90e8\u5206\u4e5f\u9700\u5c4f\u853d\u529f\u8017\u83b7\u53d6\u90e8\u5206\u4ee3\u7801\uff1a<\/p>\n<h3>4.1 \u4fee\u6539\u4ee3\u7801\u5c4f\u853d\u529f\u8017\u6d4b\u91cf\u90e8\u5206<\/h3>\n<p>\u5728 <code>src\/hailort\/device.cpp<\/code> \u6587\u4ef6\u4e2d\u627e\u5230 <code>DeviceTemp Device::get_temperature(uint8_t averaging_factor)<\/code> \u51fd\u6570\uff0c\u5c06\u539f\u4ee3\u7801\uff1a<\/p>\n<pre>try {\r\n    float power = get_power();\r\n    m_logger-&gt;trace(\"[{}] power and temperature: {} {}:{}\", id(), power, avg_t0, avg_t1);\r\n    return DeviceTemp(id(), avg_t0, avg_t1, power);\r\n} catch (PowerReadFailed &amp;ex) {\r\n    m_logger-&gt;trace(\"[{}] temperature: {}:{}\", id(), avg_t0, avg_t1);\r\n    return DeviceTemp(id(), avg_t0, avg_t1);\r\n}\r\n<\/pre>\n<p>\u4fee\u6539\u4e3a\uff1a<\/p>\n<pre>m_logger-&gt;trace(\"[{}] temperature: {}:{}\", id(), avg_t0, avg_t1);\r\nreturn DeviceTemp(id(), avg_t0, avg_t1);\r\n<\/pre>\n<h2>\u603b\u7ed3<\/h2>\n<p>\u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4\uff0c\u5373\u53ef\u751f\u6210\u9002\u5408\u4e0d\u540c Hailort \u7248\u672c\u7684 <code>hailo-accelerator-integration-tool<\/code> \u5b89\u88c5\u5305\uff0c\u5e76\u4f18\u5316\u5176\u5bf9\u7279\u5b9a\u786c\u4ef6\u7684\u517c\u5bb9\u6027\u3002<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. \u89e3\u538b\u539f\u59cb DEB \u5305 \u9996\u5148\uff0c\u627e\u5230\u4e00\u4e2a test \u76ee\u5f55\uff0c\u5c06\u4ece\u5b98\u7f51\u4e0b\u8f7d\u7684DEB \u5b89\u88c5\u5305\u7684\u6240\u6709\u5185\u5bb9\u89e3\u538b\u5230\u8fd9\u4e2a\u4e34 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-787","post","type-post","status-publish","format-standard","hentry","category-tech"],"_links":{"self":[{"href":"https:\/\/www.zhoubin.asia\/index.php\/wp-json\/wp\/v2\/posts\/787","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.zhoubin.asia\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zhoubin.asia\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zhoubin.asia\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zhoubin.asia\/index.php\/wp-json\/wp\/v2\/comments?post=787"}],"version-history":[{"count":1,"href":"https:\/\/www.zhoubin.asia\/index.php\/wp-json\/wp\/v2\/posts\/787\/revisions"}],"predecessor-version":[{"id":788,"href":"https:\/\/www.zhoubin.asia\/index.php\/wp-json\/wp\/v2\/posts\/787\/revisions\/788"}],"wp:attachment":[{"href":"https:\/\/www.zhoubin.asia\/index.php\/wp-json\/wp\/v2\/media?parent=787"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhoubin.asia\/index.php\/wp-json\/wp\/v2\/categories?post=787"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhoubin.asia\/index.php\/wp-json\/wp\/v2\/tags?post=787"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}