请选择 进入手机版 | 继续访问电脑版
查看: 1093|回复: 0

[分享] 如何在i.MX8MQ中启用Intel Neural Compute Stick 2

[复制链接]
  • TA的每日心情
    开心
    3 天前
  • 签到天数: 266 天

    [LV.8]以坛为家I

    3296

    主题

    6541

    帖子

    0

    管理员

    Rank: 9Rank: 9Rank: 9

    积分
    31904
    最后登录
    2024-3-28
    发表于 2020-4-29 17:03:44 | 显示全部楼层 |阅读模式
    如何在i.MX8MQ中启用Intel Neural Compute Stick 2

    介绍
    The Intel® Neural Compute Stick 2 (Intel® NCS 2) 是英特尔最新的深度学习推理开发工具包。Intel® NCS 2 采用价格合理的 U 盘外形,由最新的 VPU(视觉处理单元)驱动,即 the Intel® Movidius™ Myriad X,其包括一个叫做神经计算引擎的片上神经网络加速器。NCS 2 有 16 个 SHAVE 核和专用的硬件神经网络加速器,性能比上一代提高了8 倍以上。
    参考:点击


    NCS 2 官方支持的硬件平台是 x86 PC 和 Raspberry Pi。在本指南中,我们将介绍如何在i.MX8MQ 中实现。详情请参阅随附指南。
    1.png

    用户指南:
    如何在 i.MX8MQ 1 中启用 Intel Neural Compute Stick2。


    1. 介绍
    The Intel® Neural Compute Stick 2 (Intel® NCS 2) 是英特尔最新的深度学习推理开发套件。英特尔®NCS 2 采用经济实惠的 USB-stick 形式,由最新的 VPU(视觉处理单元)提供动力– the Intel® Movidius™ Myriad X,其中包括称为神经计算引擎的片上神经网络加速器。 NCS 2 具有 16 个 SHAVE 内核和专用的硬件神经网络加速器,与上一代产品相比,性能提高了 8 倍以上。参考:点击
    NCS 2 官方支持的硬件平台是 x86 PC 和 Raspberry Pi。在本指南中,我们将介绍如何在i.MX8MQ 中实现。
    2. 下载并刷新 i.MX8MQ Linux 镜像。
    请准备一张 SD 卡,建议使用 16GB。在链接中下载 i.MX8MQ Linux 映像:点击

    在 i.MX BSP Updates and Release -> Linux 中i.MX 8MQuad GA 的 Linux L4.14.78 已通过测试。其他版本也可以使用。解压缩下载的图像并烧录到 SD 卡中。您可以在 Linux 中使用 dd 命令或在 Windows 中使用 win32diskimager 应用
    http://sourceforge.net/projects/win32diskimager/ )来刷新图像。


    3. 安装 Debian 9 rootfs 和桌面
    在链接中下载 linaro-stretch-developer-20170626-41.tar.gz 链接:
    http://releases.linaro.org/debian/images/developer-armhf/17.06/
    在 Linux 机器中,在 Linux 机器上插入 SD 卡之前和之后检查/ dev,
    $ ls /dev/sd*
    /dev/sda /dev/sda1 /dev/sda1 /dev/sdb /dev/sdb1
    /dev/sdb2
    $ ls /dev/sd*
    /dev/sda /dev/sda1 /dev/sda1 /dev/sdb /dev/sdb1
    /dev/sdb2 /dev/sdc /dev/sdc1 /dev/sdc2
    $ sudo umount /dev/sdc2
    $ sudo mkfs.ext4 /dev/sdc2
    y
    $ tar -zxvf linaro-stretch-developer-20170626-41.tar.gz
    $ mkdir rootfs
    $ sudo mount /dev/sdc2 rootfs
    $ sudo cp -a -r binary/* rootfs
    $ sudo umount /dev/sdc2
    然后 Debian rootfs 成功安装。
    从 SD 卡启动 i.MX8MQ 评估板。
    安装 Xfce 桌面:
    $ sudo apt-get install task-xfce-desktop
    其他桌面应用也可以正常工作,但未经测试。
    可能需要一些时间。成功安装后,重新引导系统。
    使用以下方法更改系统时间:
    $ sudo date -s “yyyy-mm-dd hour:minute:second”


    4. 下载并编译 NCSDK。
    现在有两个版本的 NCSDK,分别对应于两个版本的 NCS。可以在以下网址找到源代码:
    http://github.com/movidius/ncsdk。
    这里我们只介绍 NCSDK2,NCSDK1 的安装是类似的。
    如果还没有安装 git:
    $ sudo apt-get install git
    使用以下命令克隆 NCSDK2:
    $ mkdir workspace
    $ cd wordspace
    $ git clone -b ncsdk2 http://github.com/movidius/ncsdk
    如果您有 git 验证错误:
    Server certificate verficatiob failed. Cafile:/ etc/ssl/certs/cacertificates.crt CRLfile:none
    使用此命令:
    $ git config --global http.sslverify false
    修改 install.sh
    $ vim ncsdk/install.sh
    在'wget'之后添加'--no-check-certificate'
    由于我们的系统是 Debian Stretch,Intel 尚未正式支持,我们需要对该脚本进行硬编码:
    取消注释 os check 在'function check_supported_os()'
    1. # check_supported_os - require install to be running on a supported OS
    2. function check_supported_os()
    3. {
    4. ### Checking OS and version...
    5. # install package lsb-release if application lsb_release isn't installed
    6. RC=0
    7. command -v lsb_release > /dev/null || RC=$?
    8. [ $RC -ne 0 ] && exec_and_search_errors "$SUDO_PREFIX apt-get install -y lsbrelease"
    9. # HARDWARE_PLATFORM=$(uname -i)
    10. # if [ "${HARDWARE_PLATFORM}" != "x86_64" ] ; then
    11. # echo -e "${RED} You are not running on a 64-bit OS version which is required.
    12. Will exit${NC}"
    13. # exit 1
    14. # fi
    15. # require AVX support under Ubuntu OS
    16. # RC=0
    17. # grep -q avx /proc/cpuinfo || RC=$?
    18. # if [ ${RC} -ne 0 ] ; then
    19. # echo -e "${RED}Intel(R) Advanced Vector Extensions, Intel(R) AVX, support
    20. required but not detected. Will exit${NC}"
    21. # exit 1
    22. # fi
    23. # [ "${VERBOSE}" = "yes" ] && echo "Installing on Ubuntu 16.04"
    24. # elif [ "${OS_DISTRO,,}" = "raspbian" ] && [ ${OS_VERSION} -ge 91 ]; then
    25. # [ "${VERBOSE}" = "yes" ] && echo "Installing on Raspbian Stretch"
    26. # elif [ "${OS_DISTRO,,}" = "raspbian" ] && [ ${OS_VERSION} -ge 80 ] && [ ${OS_VERSION}
    27. -lt 90 ]; then
    28. # echo -e "${RED} You are running Raspbian Jessie, which is not supported by
    29. NCSDK."
    30. # echo -e "Please upgrade to Raspbian Stretch and then install NCSDK."
    31. # echo -e "Error on line $LINENO${NC}"
    32. # exit 1
    33. # else
    34. # echo "Your current combination of Linux distribution and distribution version is not
    35. officially supported! Error on line $LINENO. Will exit"
    36. # exit 1
    37. # fi
    38. return 0
    39. }
    复制代码
    未完>>>
    点击查看完整版

    签到签到
    回复

    使用道具 举报

    您需要登录后才可以回帖 注册/登录

    本版积分规则

    关闭

    站长推荐上一条 /4 下一条

    Archiver|手机版|小黑屋|恩智浦技术社区

    GMT+8, 2024-3-29 04:34 , Processed in 0.102757 second(s), 19 queries , MemCache On.

    Powered by Discuz! X3.4

    Copyright © 2001-2021, Tencent Cloud.

    快速回复 返回顶部 返回列表