如何在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 中实现。详情请参阅随附指南。
用户指南:
如何在 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()'
- # check_supported_os - require install to be running on a supported OS
- function check_supported_os()
- {
- ### Checking OS and version...
- # install package lsb-release if application lsb_release isn't installed
- RC=0
- command -v lsb_release > /dev/null || RC=$?
- [ $RC -ne 0 ] && exec_and_search_errors "$SUDO_PREFIX apt-get install -y lsbrelease"
- # HARDWARE_PLATFORM=$(uname -i)
- # if [ "${HARDWARE_PLATFORM}" != "x86_64" ] ; then
- # echo -e "${RED} You are not running on a 64-bit OS version which is required.
- Will exit${NC}"
- # exit 1
- # fi
- # require AVX support under Ubuntu OS
- # RC=0
- # grep -q avx /proc/cpuinfo || RC=$?
- # if [ ${RC} -ne 0 ] ; then
- # echo -e "${RED}Intel(R) Advanced Vector Extensions, Intel(R) AVX, support
- required but not detected. Will exit${NC}"
- # exit 1
- # fi
- # [ "${VERBOSE}" = "yes" ] && echo "Installing on Ubuntu 16.04"
- # elif [ "${OS_DISTRO,,}" = "raspbian" ] && [ ${OS_VERSION} -ge 91 ]; then
- # [ "${VERBOSE}" = "yes" ] && echo "Installing on Raspbian Stretch"
- # elif [ "${OS_DISTRO,,}" = "raspbian" ] && [ ${OS_VERSION} -ge 80 ] && [ ${OS_VERSION}
- -lt 90 ]; then
- # echo -e "${RED} You are running Raspbian Jessie, which is not supported by
- NCSDK."
- # echo -e "Please upgrade to Raspbian Stretch and then install NCSDK."
- # echo -e "Error on line $LINENO${NC}"
- # exit 1
- # else
- # echo "Your current combination of Linux distribution and distribution version is not
- officially supported! Error on line $LINENO. Will exit"
- # exit 1
- # fi
- return 0
- }
复制代码 未完>>>
点击查看完整版
|