{"id":2687,"date":"2024-10-02T14:10:54","date_gmt":"2024-10-02T05:10:54","guid":{"rendered":"https:\/\/rageworx.info\/?p=2687"},"modified":"2024-10-02T14:10:54","modified_gmt":"2024-10-02T05:10:54","slug":"testing-hailo-8-with-rk3588","status":"publish","type":"post","link":"https:\/\/rageworx.info\/?p=2687","title":{"rendered":"Testing Hailo-8 with rk3588"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2688\" src=\"https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/Hailo_logo.png\" alt=\"\" width=\"354\" height=\"106\" \/><\/p>\n<p><span style=\"color: #3366ff;\"><a style=\"color: #3366ff;\" href=\"https:\/\/hailo.ai\/products\/ai-accelerators\/hailo-8-ai-accelerator\/\" target=\"_blank\" rel=\"noopener\">Hailo-8 is<\/a><\/span> an AI accelerator device based on PCIe BUS. And I have a chance to testing with Rockchip RK3588.<\/p>\n<h2>Installation<\/h2>\n<p>Installed M.2 (M-Key) Hailo-8 module on NVMe slot of NanoPi6 (RK3588). It supports PCIe 4x lanes.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2689\" src=\"https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/m2installed_1.jpg\" alt=\"\" width=\"800\" height=\"924\" srcset=\"https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/m2installed_1.jpg 800w, https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/m2installed_1-768x887.jpg 768w, https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/m2installed_1-624x721.jpg 624w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/p>\n<h2>Driver implementation<\/h2>\n<p><span style=\"color: #3366ff;\"><a style=\"color: #3366ff;\" href=\"https:\/\/github.com\/hailo-ai\/hailort-drivers\/tree\/v4.18.0\" target=\"_blank\" rel=\"noopener\">Hailo released version 4.18.0 driver<\/a><\/span> and APIs on <span style=\"color: #3366ff;\"><a style=\"color: #3366ff;\" href=\"https:\/\/github.com\/hailo-ai\" target=\"_blank\" rel=\"noopener\">their github<\/a><\/span>.<br \/>\nSo I implemented kernel driver 4.18.0 for RK3588 kernel 6.1. It needs to modify some part of kernel sources. If you want to do this, follow this way.<\/p>\n<ul>\n<li>Download modified kernel driver source below section.<br \/>\n&#x1f449; <a  data-e-Disable-Page-Transition=\"true\" class=\"download-link filetype-icon filetype-gz\" title=\"Version 4.18.0\" href=\"https:\/\/rageworx.info?tmstv=1776037247\" rel=\"nofollow\" id=\"download-link-2691\" data-redirect=\"false\" >\n\thailort_kdrv_v4.18.0_for_rk3588_kernel_6.1.tar.gz\t(407 downloads\t)\n<\/a>\n<\/li>\n<li>Extract downloaded file in <code>driver\/misc<\/code>, you can see a new driver directory <code>driver\/misc\/hailort<\/code>.<br \/>\n&#x1f449; <code>tar -xf ${downloaded.tar.gz} -C driver\/misc<\/code><\/li>\n<li>Modify <code>driver\/misc\/Kconfig<\/code>. to include <code>hailort\/Kconfig<\/code> .\n<ul>\n<li>Add a line <code>source drivers\/misc\/hailort\/Kconfig<\/code> before <code>endmenu<\/code> line.<\/li>\n<\/ul>\n<\/li>\n<li>Modify your kernel build configuration for these conditions.\n<ul>\n<li>Enable &#8220;<code>CONFIG_PCIE_BUS_DEFAULT<\/code>&#8221; as &#8220;<code>y<\/code>&#8220;<\/li>\n<li>Add &#8220;<code>CONFIG_HAILORT_PCIE<\/code>&#8221; to &#8220;<code>m<\/code>&#8221; or &#8220;<code>y<\/code>&#8221; (recommend as &#8220;<code>m<\/code>&#8220;)<\/li>\n<\/ul>\n<\/li>\n<li>re-configure kernel.<\/li>\n<li>Check &#8220;<code>.config<\/code>&#8221; file that enabled &#8220;<code>CONFIG_HAILORT_PCIE=y|m<\/code>&#8220;.<\/li>\n<li>Build your kernel or module.<\/li>\n<li>Flash new kernel image or update kernel modules.<\/li>\n<\/ul>\n<h2>Place firmware to &#8220;\/lib\/firmware\/hailort&#8221;<\/h2>\n<ul>\n<li>Download hailo-8 firmware v4.18.0 : <a  data-e-Disable-Page-Transition=\"true\" class=\"download-link filetype-icon filetype-gz\" title=\"Version 4.18.0\" href=\"https:\/\/rageworx.info?tmstv=1776037247\" rel=\"nofollow\" id=\"download-link-2695\" data-redirect=\"false\" >\n\thailo8fw.tar.gz\t(433 downloads\t)\n<\/a>\n<\/li>\n<li>Make a directory <code>\/lib\/firmware\/hailort<\/code> and extract downloaded firmware in there.<\/li>\n<\/ul>\n<h2>Create an udev rule file<\/h2>\n<ul>\n<li>Change device permission for user, create a file <code>\/etc\/udev\/rules.d\/51-hailo-udev.rules<\/code> as sudoer.<\/li>\n<li>And edit this with these lines.<br \/>\n<code>#Change mode rules for Hailo's PCIe driver<\/code><br \/>\n<code>SUBSYSTEM==\"hailo_chardev\", MODE=\"0666\"<\/code><\/li>\n<\/ul>\n<h2>Check kernel driver load<\/h2>\n<p>And if you succeeded to load as like this: <img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2699\" src=\"https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/kernel_drv_loaded_dmesg.jpg\" alt=\"\" width=\"661\" height=\"408\" srcset=\"https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/kernel_drv_loaded_dmesg.jpg 661w, https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/kernel_drv_loaded_dmesg-624x385.jpg 624w\" sizes=\"auto, (max-width: 661px) 100vw, 661px\" \/><\/p>\n<h2>Build Hailo CLI 11<\/h2>\n<p>Hailo supports their own CLI, and it must be installed on the system to control Hailo-8 device.<br \/>\nNow you need to build Hailo CLI-11 from <span style=\"color: #3366ff;\"><a style=\"color: #3366ff;\" href=\"https:\/\/github.com\/hailo-ai\/CLI11\" target=\"_blank\" rel=\"noopener\">Here<\/a><\/span>.<\/p>\n<p>Then check Hailo-8 device running well with this : <code>hailortcli fw-control identify --extended<\/code><br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2701\" src=\"https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/hailocli-fw-info.jpg\" alt=\"\" width=\"665\" height=\"329\" srcset=\"https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/hailocli-fw-info.jpg 665w, https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/hailocli-fw-info-624x309.jpg 624w\" sizes=\"auto, (max-width: 665px) 100vw, 665px\" \/><\/p>\n<h2>Performance test<\/h2>\n<p>Found some pre-compiled HEF model (from ONNX) for RaspberryPI5 series. And RPI5 module is not Hailo-8, but I tested with this model as Hailo-8L.<\/p>\n<ul>\n<li>Ref : <span style=\"color: #3366ff;\"><a style=\"color: #3366ff;\" href=\"https:\/\/github.com\/hailo-ai\/hailo-rpi5-examples\" target=\"_blank\" rel=\"noopener\">hailo-ai\/hailo-rpi5-examples (github.com)<\/a><\/span><\/li>\n<\/ul>\n<h3>YOLOv5-n-seg (for Hailo-8L)<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2702\" src=\"https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/hailo_running_test_for8L_YOLOv5nseg.jpg\" alt=\"\" width=\"663\" height=\"703\" srcset=\"https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/hailo_running_test_for8L_YOLOv5nseg.jpg 663w, https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/hailo_running_test_for8L_YOLOv5nseg-624x662.jpg 624w\" sizes=\"auto, (max-width: 663px) 100vw, 663px\" \/><\/p>\n<p>Performance marked as average 115 and 116 (for streaming) fps.<\/p>\n<h3>YOLOv6-n (for Hailo-8L)<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2703\" src=\"https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/hailo_running_test_for8L_YOLOv6n.jpg\" alt=\"\" width=\"659\" height=\"648\" srcset=\"https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/hailo_running_test_for8L_YOLOv6n.jpg 659w, https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/hailo_running_test_for8L_YOLOv6n-624x614.jpg 624w, https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/hailo_running_test_for8L_YOLOv6n-60x60.jpg 60w\" sizes=\"auto, (max-width: 659px) 100vw, 659px\" \/><\/p>\n<p>Performance marked as average 355 fps.<\/p>\n<h2>Conclusion<\/h2>\n<p>Hailo-8 is a small chipset for enables HW based powerful AI acceleration for low powered ARM architecture systems.<br \/>\nAnd I impressed in their performance to handle YOLO in real-time.<\/p>\n<p>But thermal may a small issue &#8230;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2704\" src=\"https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/RB00424X.jpg\" alt=\"\" width=\"276\" height=\"240\" \/><\/p>\n<p>And Hailo officially recommend to use heat sink.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-2705\" src=\"https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/capture_hailo_pdf_thermal-960x441.png\" alt=\"\" width=\"960\" height=\"441\" srcset=\"https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/capture_hailo_pdf_thermal-960x441.png 960w, https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/capture_hailo_pdf_thermal-768x353.png 768w, https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/capture_hailo_pdf_thermal-624x286.png 624w, https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/capture_hailo_pdf_thermal.png 1403w\" sizes=\"auto, (max-width: 960px) 100vw, 960px\" \/><\/p>\n<p>And maximum thermal is argued as :<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2708\" src=\"https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/capture_hailo_pdf_themal_limit.png\" alt=\"\" width=\"800\" height=\"459\" srcset=\"https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/capture_hailo_pdf_themal_limit.png 800w, https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/capture_hailo_pdf_themal_limit-768x441.png 768w, https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/capture_hailo_pdf_themal_limit-624x358.png 624w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>It maybe a good choice to acquire 26 TOPs AI power for small embedded system if has good thermal solution to prevent over heating up to 100\u2103.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hailo-8 is an AI accelerator device based on PCIe BUS. And I have a chance to testing with Rockchip RK3588. Installation Installed M.2 (M-Key) Hailo-8 module on NVMe slot of NanoPi6 (RK3588). It supports PCIe 4x lanes. Driver implementation Hailo released version 4.18.0 driver and APIs on their github. So&#8230; <a href=\"https:\/\/rageworx.info\/?p=2687\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":2689,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[800,5,735,3],"tags":[802,26,804,25,805],"class_list":["post-2687","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ai","category-development","category-linux-development","category-raphs","tag-ai","tag-driver","tag-hailo","tag-kernel","tag-rk3588"],"_links":{"self":[{"href":"https:\/\/rageworx.info\/index.php?rest_route=\/wp\/v2\/posts\/2687","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rageworx.info\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rageworx.info\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rageworx.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rageworx.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2687"}],"version-history":[{"count":0,"href":"https:\/\/rageworx.info\/index.php?rest_route=\/wp\/v2\/posts\/2687\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/rageworx.info\/index.php?rest_route=\/wp\/v2\/media\/2689"}],"wp:attachment":[{"href":"https:\/\/rageworx.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2687"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rageworx.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2687"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rageworx.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2687"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}