何在 Raspberry Pi 5 上设置 Raspberry Pi AI Kit
<p> 本指南将帮助您在 Raspberry Pi 5 上安装 Raspberry Pi AI Kit。这将使您能够使用 Hailo AI 神经网络加速器运行 rpicam-apps 摄像头演示。</p><div></div>
<p>如果您在开始安装人工智能套件之前需要帮助,本指南提供了安装过程的分步图片。</p>
<p><a class="link-info has-card" contenteditable="true" data-link-icon="https://csdnimg.cn/release/blog_editor_html/release2.3.6/ckeditor/plugins/CsdnLink/icons/icon-default.png?t=N7T8" data-link-title="安装人工智能套件:" data-widget="csdnlink" href="https://www.raspberrypi.com/documentation/accessories/ai-kit.html#install" target="_blank" title="安装人工智能套件:">安装人工智能套件:</a></p>
<div></div>
<p><span style="font-size:20px;"><strong>前提条件</strong></span></p>
<p>本指南需要以下设备:</p>
<ul>
<li>
<p>一台 Raspberry Pi 5</p>
</li>
<li>
<p>一个 Raspberry Pi AI 套件,其中包括</p>
</li>
</ul>
<p> 一个 M.2 HAT+</p>
<p> 一个预装的 Hailo-8L AI 模块</p>
<ul>
<li>
<p>一个 64 位 Raspberry Pi OS Bookworm 安装包</p>
</li>
<li>
<p>任何 Raspberry Pi 官方摄像头(如摄像头模块 3 或高质量摄像头)</p>
</li>
</ul>
<div></div>
<div></div>
<p><span style="font-size:20px;"><strong>硬件设置</strong></span></p>
<p>1. 按照安装 Raspberry Pi 摄像头的说明,将摄像头安装到 Raspberry Pi 5 板上。您可以跳过将 Raspberry Pi 重新连接到电源的步骤,因为您需要断开 Raspberry Pi 的电源才能进行下一步。</p>
<p><a class="link-info has-card" contenteditable="true" data-link-icon="https://csdnimg.cn/release/blog_editor_html/release2.3.6/ckeditor/plugins/CsdnLink/icons/icon-default.png?t=N7T8" data-link-title="安装 Raspberry Pi 摄像头:" data-widget="csdnlink" href="https://www.raspberrypi.com/documentation/accessories/camera.html#install-a-raspberry-pi-camera" title="安装 Raspberry Pi 摄像头:">安装 Raspberry Pi 摄像头:</a></p>
<p>2. 按照安装说明将 AI 套件硬件连接到 Raspberry Pi 5。</p>
<p><a class="link-info has-card" contenteditable="true" data-link-icon="https://csdnimg.cn/release/blog_editor_html/release2.3.6/ckeditor/plugins/CsdnLink/icons/icon-default.png?t=N7T8" data-link-title="安装说明:" data-widget="csdnlink" href="https://www.raspberrypi.com/documentation/accessories/ai-kit.html#ai-kit-installation" title="安装说明:">安装说明:</a></p>
<p>3. 按照说明启用 PCIe Gen 3.0。这一步是可选的,但强烈建议您这样做,以使您的 AI Kit 获得最佳性能。</p>
<p> <a class="link-info has-card" contenteditable="true" data-link-icon="https://csdnimg.cn/release/blog_editor_html/release2.3.6/ckeditor/plugins/CsdnLink/icons/icon-default.png?t=N7T8" data-link-title="PCIe Gen 3.0 启用说明:" data-widget="csdnlink" href="https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#pcie-gen-3-0" title="PCIe Gen 3.0 启用说明:">PCIe Gen 3.0 启用说明:</a></p>
<p>4. 安装使用 AI 套件所需的依赖项。在终端窗口运行以下命令</p>
<pre data-widget="codeSnippet">
<code class="hljs"><code>$ sudo apt install hailo-all</code>nbsp;sudo apt install hailo-all</code></pre>
<p>这将安装以下依赖项:</p>
<ul>
<li>
<p>Hailo 内核设备驱动程序和固件</p>
</li>
<li>
<p>HailoRT 中间件软件</p>
</li>
<li>
<p>Hailo Tappas 核心后处理库</p>
</li>
<li>
<p>rpicam-apps Hailo 后处理软件演示阶段</p>
</li>
</ul>
<p>5. 最后,使用 sudo reboot 重启树莓派,使这些设置生效。</p>
<p>6. 为确保一切运行正常,请运行以下命令:</p>
<pre data-widget="codeSnippet">
<code class="hljs"><code>$ hailortcli fw-control identify</code>nbsp;hailortcli fw-control identify</code></pre>
<p>如果您看到类似下面的输出,说明您已经成功安装了 AI 工具包及其软件依赖项:</p>
<pre data-widget="codeSnippet">
<code class="hljs">Executing on device: 0000:01:00.0
Identifying board
Control Protocol Version: 2
Firmware Version: 4.17.0 (release,app,extended context switch buffer)
Logger Version: 0
Board Name: Hailo-8
Device Architecture: HAILO8L
Serial Number: HLDDLBB234500054
Part Number: HM21LB1C2LAE
Product Name: HAILO-8L AI ACC M.2 B+M KEY MODULE EXT TMP</code></pre>
<p>此外,还可以运行 dmesg | grep -i hailo 检查内核日志,其输出结果应与下面类似:</p>
<pre data-widget="codeSnippet">
<code class="hljs">[ 3.049657] hailo: Init module. driver version 4.17.0
[ 3.051983] hailo 0000:01:00.0: Probing on: 1e60:2864...
[ 3.051989] hailo 0000:01:00.0: Probing: Allocate memory for device extension, 11600
[ 3.052006] hailo 0000:01:00.0: enabling device (0000 -> 0002)
[ 3.052011] hailo 0000:01:00.0: Probing: Device enabled
[ 3.052028] hailo 0000:01:00.0: Probing: mapped bar 0 - 000000000d8baaf1 16384
[ 3.052034] hailo 0000:01:00.0: Probing: mapped bar 2 - 000000009eeaa33c 4096
[ 3.052039] hailo 0000:01:00.0: Probing: mapped bar 4 - 00000000b9b3d17d 16384
[ 3.052044] hailo 0000:01:00.0: Probing: Force setting max_desc_page_size to 4096 (recommended value is 16384)
[ 3.052052] hailo 0000:01:00.0: Probing: Enabled 64 bit dma
[ 3.052055] hailo 0000:01:00.0: Probing: Using userspace allocated vdma buffers
[ 3.052059] hailo 0000:01:00.0: Disabling ASPM L0s
[ 3.052070] hailo 0000:01:00.0: Successfully disabled ASPM L0s
[ 3.221043] hailo 0000:01:00.0: Firmware was loaded successfully
[ 3.231845] hailo 0000:01:00.0: Probing: Added board 1e60-2864, /dev/hailo0</code></pre>
<p>7. 为确保摄像机正常运行,请运行以下命令:</p>
<pre data-widget="codeSnippet">
<code class="hljs"><code>$ rpicam-hello -t 10s</code>nbsp;rpicam-hello -t 10s</code></pre>
<p>这将启动摄像机并显示十秒钟的预览窗口。确认一切安装正确后,就可以运行一些演示了。</p>
<p><a class="link-info has-card" contenteditable="true" data-link-icon="https://csdnimg.cn/release/blog_editor_html/release2.3.6/ckeditor/plugins/CsdnLink/icons/icon-default.png?t=N7T8" data-link-title="演示 Demo:" data-widget="csdnlink" href="https://www.raspberrypi.com/documentation/accessories/ai-kit.html#demos" title="演示 Demo:">演示 Demo:</a></p>
<p>把这一套搞下来要1k多呢。<img height="48" src="https://bbs.eeworld.com.cn/static/editor/plugins/hkemoji/sticker/facebook/wanwan88.gif" width="59" /></p>
damiaa 发表于 2024-9-2 22:35
把这一套搞下来要1k多呢。
<p>新的确实要</p>
页:
[1]