{"id":2663,"date":"2024-10-02T11:47:13","date_gmt":"2024-10-02T02:47:13","guid":{"rendered":"https:\/\/rageworx.info\/?p=2663"},"modified":"2024-10-02T12:54:49","modified_gmt":"2024-10-02T03:54:49","slug":"rockchip-rk3588-and-npu-performance","status":"publish","type":"post","link":"https:\/\/rageworx.info\/?p=2663","title":{"rendered":"Rockchip RK3588 and NPU performance."},"content":{"rendered":"<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2664\" src=\"https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/rk3588_01.png\" alt=\"\" width=\"800\" height=\"481\" srcset=\"https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/rk3588_01.png 800w, https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/rk3588_01-768x462.png 768w, https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/rk3588_01-624x375.png 624w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/p>\n<h2>About RK3588<\/h2>\n<p><span style=\"color: #3366ff;\"><a style=\"color: #3366ff;\" href=\"https:\/\/en.wikipedia.org\/wiki\/Rockchip\" target=\"_blank\" rel=\"noopener\">Rockchip was published their new performance ARM(r) Cortex-A76 and A55 clustered SoC in 2020<\/a><\/span>. It has 6 TOPs performance NPU &#8211; known as RKNN in SoC that shares system memory with exclusive SRAM.<\/p>\n<h2>RKNN<\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2665\" src=\"https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/rk3588_02_npu.png\" alt=\"\" width=\"800\" height=\"510\" srcset=\"https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/rk3588_02_npu.png 800w, https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/rk3588_02_npu-768x490.png 768w, https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/rk3588_02_npu-624x398.png 624w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/p>\n<p>RKNN is a name of Rockchip&#8217;s Neural processor unit and it is officially posted supporting 6 tera operations per seconds.<br \/>\nSo I need to test it is really useful feature on Embedded Linux kernel 5.10 or 6.1.<\/p>\n<h3>Driver upgrading<\/h3>\n<p>Most public github based kernels are only supports rknn driver version 0.9.2, not 0.9.6. I was modified kernel based sources to support latest version.<\/p>\n\n<a  data-e-Disable-Page-Transition=\"true\" class=\"download-link download-button aligncenter\" title=\"Version v0.9\" href=\"https:\/\/rageworx.info?tmstv=1776037247\" rel=\"nofollow\" id=\"download-link-2670\" data-redirect=\"false\" >\n\tDownload &ldquo;rknpu version 0.9.6 for Linux kernel version 5.10.198&rdquo;\t<small>rknpu-v0.9.6-for-kernel.5.10.198.tar-1.gz\t\t&ndash; Downloaded 388 times\t\t&ndash; 40.64 KB<\/small>\n<\/a>\n\n<p>Driver is should be replaced on your Kernel version 5.10.198 as this way.<\/p>\n<ul>\n<li>Download above source codes to anywhere you wanted &#8211; may it will be to <code>~\/Downloads<\/code>.<\/li>\n<li>Move to your Linux kernel source directory placed <code>Makefile<\/code>.<\/li>\n<li>Remove or change name previous rknpu directory in <code>${kernel_source}\/drivers\/rknpu<\/code>.<\/li>\n<li>Extract downloaded source code in kernel source root : <code>tar -xf ${your_download_path}\/rknpu-v0.9.6-for-kernel.5.10.198.tar.gz -C .<\/code><\/li>\n<li>And build kernel again.<\/li>\n<li>And flash your kernel to RK3588 system.<\/li>\n<\/ul>\n<p>When successfully upgraded your rknpu driver, you can see this in <code>dmesg<\/code> .<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2673\" src=\"https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/rknpu_v096_dmesg.png\" alt=\"\" width=\"657\" height=\"147\" srcset=\"https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/rknpu_v096_dmesg.png 657w, https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/rknpu_v096_dmesg-624x140.png 624w\" sizes=\"auto, (max-width: 657px) 100vw, 657px\" \/><\/p>\n<h3>Basic tests<\/h3>\n<p>I followed rknn toolkit v2.1.0 in 100% C++ with FLTK. RKNN model is YOLOv5 (pre-trained).<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2678\" src=\"https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/rknn_testing_w_fltk_yolov5.png\" alt=\"\" width=\"663\" height=\"828\" srcset=\"https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/rknn_testing_w_fltk_yolov5.png 663w, https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/rknn_testing_w_fltk_yolov5-624x779.png 624w\" sizes=\"auto, (max-width: 663px) 100vw, 663px\" \/><\/p>\n<p>Detecting objects in <code>rknn_run();<\/code> took around 18 ms per 640&#215;640 dimension and it is fixed issue for pre-trained YOLOv5 model.<\/p>\n<h3>Testing with V4L2<\/h3>\n<p>Made a graphical test with V4L2 and FLTK. Video source was a traffic video from Youtube on my iPhone.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2685\" src=\"https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/IMG_20241002_125201.jpg\" alt=\"\" width=\"800\" height=\"600\" srcset=\"https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/IMG_20241002_125201.jpg 800w, https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/IMG_20241002_125201-768x576.jpg 768w, https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/IMG_20241002_125201-624x468.jpg 624w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/p>\n<p>And results are &#8211;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-2681\" src=\"https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/Screenshot-2024-10-02-12-02-28-960x540.png\" alt=\"\" width=\"960\" height=\"540\" srcset=\"https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/Screenshot-2024-10-02-12-02-28-960x540.png 960w, https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/Screenshot-2024-10-02-12-02-28-1600x900.png 1600w, https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/Screenshot-2024-10-02-12-02-28-768x432.png 768w, https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/Screenshot-2024-10-02-12-02-28-1536x864.png 1536w, https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/Screenshot-2024-10-02-12-02-28-624x351.png 624w, https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/Screenshot-2024-10-02-12-02-28.png 1920w\" sizes=\"auto, (max-width: 960px) 100vw, 960px\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-2682\" src=\"https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/Screenshot-2024-10-02-12-03-33-960x540.png\" alt=\"\" width=\"960\" height=\"540\" srcset=\"https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/Screenshot-2024-10-02-12-03-33-960x540.png 960w, https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/Screenshot-2024-10-02-12-03-33-1600x900.png 1600w, https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/Screenshot-2024-10-02-12-03-33-768x432.png 768w, https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/Screenshot-2024-10-02-12-03-33-1536x864.png 1536w, https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/Screenshot-2024-10-02-12-03-33-624x351.png 624w, https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/Screenshot-2024-10-02-12-03-33.png 1920w\" sizes=\"auto, (max-width: 960px) 100vw, 960px\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-2683\" src=\"https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/Screenshot-2024-10-02-12-03-50-960x540.png\" alt=\"\" width=\"960\" height=\"540\" srcset=\"https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/Screenshot-2024-10-02-12-03-50-960x540.png 960w, https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/Screenshot-2024-10-02-12-03-50-1600x900.png 1600w, https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/Screenshot-2024-10-02-12-03-50-768x432.png 768w, https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/Screenshot-2024-10-02-12-03-50-1536x864.png 1536w, https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/Screenshot-2024-10-02-12-03-50-624x351.png 624w, https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/Screenshot-2024-10-02-12-03-50.png 1920w\" sizes=\"auto, (max-width: 960px) 100vw, 960px\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-2684\" src=\"https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/Screenshot-2024-10-02-12-02-37-960x540.png\" alt=\"\" width=\"960\" height=\"540\" srcset=\"https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/Screenshot-2024-10-02-12-02-37-960x540.png 960w, https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/Screenshot-2024-10-02-12-02-37-1600x900.png 1600w, https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/Screenshot-2024-10-02-12-02-37-768x432.png 768w, https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/Screenshot-2024-10-02-12-02-37-1536x864.png 1536w, https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/Screenshot-2024-10-02-12-02-37-624x351.png 624w, https:\/\/rageworx.info\/wp-content\/uploads\/2024\/10\/Screenshot-2024-10-02-12-02-37.png 1920w\" sizes=\"auto, (max-width: 960px) 100vw, 960px\" \/><\/p>\n<h2>Conclusion<\/h2>\n<p>My UVC was 1080p@30Hz, and it detects many objects in real-time of 30 fps as well. It should be better with <span style=\"color: #3366ff;\"><a style=\"color: #3366ff;\" href=\"https:\/\/github.com\/airockchip\/librga\" target=\"_blank\" rel=\"noopener\">Rockchip librga<\/a><\/span> engine to scaling image.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; About RK3588 Rockchip was published their new performance ARM(r) Cortex-A76 and A55 clustered SoC in 2020. It has 6 TOPs performance NPU &#8211; known as RKNN in SoC that shares system memory with exclusive SRAM. RKNN RKNN is a name of Rockchip&#8217;s Neural processor unit and it is officially&#8230; <a href=\"https:\/\/rageworx.info\/?p=2663\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":2665,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[800,5,573,735,3],"tags":[802,801,803,636],"class_list":["post-2663","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ai","category-development","category-embedded","category-linux-development","category-raphs","tag-ai","tag-npu","tag-rknn","tag-rockchip"],"_links":{"self":[{"href":"https:\/\/rageworx.info\/index.php?rest_route=\/wp\/v2\/posts\/2663","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=2663"}],"version-history":[{"count":0,"href":"https:\/\/rageworx.info\/index.php?rest_route=\/wp\/v2\/posts\/2663\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/rageworx.info\/index.php?rest_route=\/wp\/v2\/media\/2665"}],"wp:attachment":[{"href":"https:\/\/rageworx.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2663"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rageworx.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2663"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rageworx.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2663"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}