LattePanda 安装ubuntu 20.04 和 openvino 2020.4

硬件:

  • LattePanda Delta
  • M.2 SSD
  • Intel Neural Computer Stick 2
  • USB stick 8G

软件:

  • ubuntu 20.04
  • openvino

第一部分,ubuntu 20.04 系统安装

首先,下载 ubuntu 20.04 iso 文件,然后制作USB 启动盘;Mac 下可以用Disk Utility 工具,将 U盘分区抹去,选择 MS FAT 格式,GUID分区方案

然后用 etcher刻录

刻录完成后,插入 LattePanda,再接入鼠标和键盘,显示器。
启动LattePanda Delta 后,多按几次 Del 键,会进入 bios 设置界面。
将U盘设置为第一启动盘,保存退出。
出现ubuntu grub安装界面,选择安装即可,我这里选择了 oem 方式玩玩。

系统会显示 LattePanda 的 logo

选择分区方案时,我采用了自定义,以免破坏原来的windows 10 系统;ubuntu 17 开始,不再使用 swap 分区,将所有空闲空间都划分为 ext4 格式,挂载为 root 。

然后就是耐心等待了。

如果你的网络不是特别好,最好跳过所有的在线更新,等后面更改了apt源镜像后,再安装不迟。
安装完成后,拔出U盘,重启,这里无需额外bios设置,启动盘会是ubuntu,进入桌面后,因为我是OEM安装,再运行一下 oem-config ,来创建最终用户。

重启进入桌面后,主要硬件看起来都工作正常。
显卡 ok, 可以驱动4K 显示器。
蓝牙 ok
wifi ok , 可以连上热点。
声卡 ok,可以听到启动音乐。

更改apt源镜像,更新系统

通过 Visual Studio Code Insider,安装 PlatformIO 后,刷写 Arduino 也正常,简单跑了个 Python 程序刷新 oled 屏幕也正常。
看起来一切正常,无需我额外关注硬件驱动。

第二部分,openvino 及 intel neural computer stick2 驱动

因为在linux 下安装 openvino 许多次了,习惯性下载了最新的 2020.4 安装包,开始执行依赖安装脚本。
出错了,许多包文件找不到。

E: Unable to locate package gudev-1.0
E: Unable to locate package libusb-1.0.0-dev
E: Package 'libfluidsynth1' has no installation candidate
E: Unable to locate package libnettle6
E: Unable to locate package libopenexr22
E: Unable to locate package python3.6
E: Unable to locate package libpython3.6

于是手动修改依赖安装脚本,将出错的包名更换为 逗号后面的新包名,再删除 python3.6 的依赖。

$ vi ./install_openvino_dependencies.shE: Unable to locate package gudev-1.0 ,libgudev-1.0-dev
E: Unable to locate package libusb-1.0.0-dev, libusb-1.0-0-dev
E: Package 'libfluidsynth1' has no installation candidate, libfluidsynth2
E: Unable to locate package libnettle6, libnettle7
E: Unable to locate package libopenexr22, libopenexr24

这次安装成功了。

panda@Panda:~/git/l_openvino_toolkit_p_2020.4.287$ sudo -E ./install_openvino_dependencies.shThis script installs the following OpenVINO 3rd-party dependencies:1. GTK+, FFmpeg and GStreamer libraries used by OpenCV2. libusb library required for Myriad plugin for Inference Engine3. build dependencies for OpenVINO samples4. build dependencies for GStreamer PluginsHit:1 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal InRelease
Get:2 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates InRelease [111 kB]
Get:3 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-backports InRelease [98.3 kB]

然后是 openvino 库安装,自检时依然抱怨不满足先决条件,查看详细信息,发现OS最高支持到 ubuntu 18.04。

Prerequisites > Missing Prerequisite
--------------------------------------------------------------------------------
Detected operating system is not supported. Supported operating systems for this
release are: - CentOS* 7 (Intel(R) 64);- Ubuntu* 16.04 (Intel(R) 64), 18.04 (Intel(R) 64);- Yocto  (Intel(R) 64);--------------------------------------------------------------------------------1. See next issue [ default ]2. Back to Prerequisite summary dialogh. Helpb. Backq. Quit installation

忽视警告强行安装后,很多关键库文件都没有安装。

--------------------------------------------------------------------------------
Install location:/opt/intelThe following components will be installed:Model Optimizer                                                          4MBModel Optimizer Tool                                                 4MBDeep Learning Workbench                                                 10MBDeep Learning Workbench                                             10MBOpen Model Zoo                                                          58MBOpen Model Zoo                                                      58MBIntel(R) Media SDK                                                     128MBIntel(R) Media SDK                                                 128MBInstall space required:  292MBInstallation
--------------------------------------------------------------------------------
Each component will be installed individually. If you cancel the installation,
some components might remain on your system. This installation may take several
minutes, depending on your system and the options you selected.
--------------------------------------------------------------------------------
Installing Model Optimizer Tool component... done
--------------------------------------------------------------------------------
Installing Deep Learning Workbench component... done
--------------------------------------------------------------------------------
Installing Open Model Zoo component... done
--------------------------------------------------------------------------------
Installing Intel(R) Media SDK component... done
--------------------------------------------------------------------------------
Finalizing product configuration...
--------------------------------------------------------------------------------First Part of Installation is Complete
--------------------------------------------------------------------------------
The first part of Intel® Distribution of OpenVINO™ toolkit 2020.4 for Linux*
has been successfully installed in
/opt/intel/openvino_2020.4.287.

于是决定自行编译安装。

首先从 这里 https://github.com/openvinotoolkit/openvino 下载源代码。
再更新子模块

git submodule update --init --recursive

这里就不编译 opencv 了,太耗时间,用现成的 4.2 ,

sudo apt install  libopencv-dev python3-opencv
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:autoconf automake autotools-dev cpp-8 gcc-8 gcc-8-base gdal-data gfortran gfortran-8 gfortran-9 ibverbs-providers javascript-common libaec0libarmadillo9 libarpack2 libavcodec-dev libavformat-dev libavresample-dev libavutil-dev libblas3 libcaf-openmpi-3 libcfitsio8 libcharls2 libcoarrays-devlibcoarrays-openmpi-dev libdap25 libdapclient6v5 libdc1394-22-dev libepsilon1 libevent-core-2.1-7 libevent-dev libevent-extra-2.1-7libevent-openssl-2.1-7 libevent-pthreads-2.1-7 libexif-dev libexif-doc libfabric1 libfreexl1 libfyba0 libgcc-8-dev libgdal26 libgdcm-dev libgdcm3.0libgeos-3.8.0 libgeos-c1v5 libgeotiff5 libgfortran-8-dev libgfortran-9-dev libgfortran5 libgl2ps1.4 libgphoto2-dev libhdf4-0-alt libhdf5-103libhdf5-openmpi-103 libhwloc-dev libhwloc-plugins libhwloc15 libibverbs-dev libibverbs1 libilmbase-dev libjbig-dev libjpeg-dev libjpeg-turbo8-devlibjpeg8-dev libjs-jquery libkmlbase1 libkmldom1 libkmlengine1 liblapack3 liblept5 libltdl-dev liblzma-dev libminizip1 libmpx2 libnetcdf-c++4libnetcdf15 libnl-3-dev libnl-route-3-dev libnuma-dev libodbc1 libogdi4.1 libopencv-calib3d-dev libopencv-calib3d4.2 libopencv-contrib-devlibopencv-contrib4.2 libopencv-core-dev libopencv-core4.2 libopencv-dnn-dev libopencv-dnn4.2 libopencv-features2d-dev libopencv-features2d4.2libopencv-flann-dev libopencv-flann4.2 libopencv-highgui-dev libopencv-highgui4.2 libopencv-imgcodecs-dev libopencv-imgcodecs4.2 libopencv-imgproc-devlibopencv-imgproc4.2 libopencv-ml-dev libopencv-ml4.2 libopencv-objdetect-dev libopencv-objdetect4.2 libopencv-photo-dev libopencv-photo4.2libopencv-shape-dev libopencv-shape4.2 libopencv-stitching-dev libopencv-stitching4.2 libopencv-superres-dev libopencv-superres4.2 libopencv-ts-devlibopencv-video-dev libopencv-video4.2 libopencv-videoio-dev libopencv-videoio4.2 libopencv-videostab-dev libopencv-videostab4.2 libopencv-viz-devlibopencv-viz4.2 libopencv4.2-java libopencv4.2-jni libopenexr-dev libopenmpi-dev libopenmpi3 libpmix2 libpng-dev libpng-tools libpq5 libproj15libpsm-infinipath1 libpsm2-2 libqhull7 libraw1394-dev libraw1394-tools librdmacm1 libsocket++1 libspatialite7 libsuperlu5 libswresample-devlibswscale-dev libsz2 libtbb-dev libtbb2 libtesseract4 libtiff-dev libtiffxx5 libtool liburiparser1 libvtk6.3 libxerces-c3.2 libxnvctrl0 odbcinstodbcinst1debian2 opencv-data openmpi-bin openmpi-common proj-bin proj-data python3-numpy
Suggested packages:autoconf-archive gnu-standards autoconf-doc gcc-8-locales gcc-8-multilib gcc-8-doc gfortran-multilib gfortran-doc gfortran-8-multilib gfortran-8-docgfortran-9-multilib gfortran-9-doc apache2 | lighttpd | httpd geotiff-bin gdal-bin libgeotiff-epsg libhdf4-doc libhdf4-alt-dev hdf4-toolslibhwloc-contrib-plugins libtool-doc liblzma-doc libmyodbc odbc-postgresql tdsodbc unixodbc-bin ogdi-bin opencv-doc openmpi-doc libraw1394-doclibtbb-doc gcj-jdk mpi-default-bin python-numpy-doc python3-pytest python3-numpy-dbg
The following NEW packages will be installed:autoconf automake autotools-dev cpp-8 gcc-8 gcc-8-base gdal-data gfortran gfortran-8 gfortran-9 ibverbs-providers javascript-common libaec0libarmadillo9 libarpack2 libavcodec-dev libavformat-dev libavresample-dev libavutil-dev libblas3 libcaf-openmpi-3 libcfitsio8 libcharls2 libcoarrays-devlibcoarrays-openmpi-dev libdap25 libdapclient6v5 libdc1394-22-dev libepsilon1 libevent-core-2.1-7 libevent-dev libevent-extra-2.1-7libevent-openssl-2.1-7 libevent-pthreads-2.1-7 libexif-dev libexif-doc libfabric1 libfreexl1 libfyba0 libgcc-8-dev libgdal26 libgdcm-dev libgdcm3.0libgeos-3.8.0 libgeos-c1v5 libgeotiff5 libgfortran-8-dev libgfortran-9-dev libgfortran5 libgl2ps1.4 libgphoto2-dev libhdf4-0-alt libhdf5-103libhdf5-openmpi-103 libhwloc-dev libhwloc-plugins libhwloc15 libibverbs-dev libibverbs1 libilmbase-dev libjbig-dev libjpeg-dev libjpeg-turbo8-devlibjpeg8-dev libjs-jquery libkmlbase1 libkmldom1 libkmlengine1 liblapack3 liblept5 libltdl-dev liblzma-dev libminizip1 libmpx2 libnetcdf-c++4libnetcdf15 libnl-3-dev libnl-route-3-dev libnuma-dev libodbc1 libogdi4.1 libopencv-calib3d-dev libopencv-calib3d4.2 libopencv-contrib-devlibopencv-contrib4.2 libopencv-core-dev libopencv-core4.2 libopencv-dev libopencv-dnn-dev libopencv-dnn4.2 libopencv-features2d-devlibopencv-features2d4.2 libopencv-flann-dev libopencv-flann4.2 libopencv-highgui-dev libopencv-highgui4.2 libopencv-imgcodecs-dev libopencv-imgcodecs4.2libopencv-imgproc-dev libopencv-imgproc4.2 libopencv-ml-dev libopencv-ml4.2 libopencv-objdetect-dev libopencv-objdetect4.2 libopencv-photo-devlibopencv-photo4.2 libopencv-shape-dev libopencv-shape4.2 libopencv-stitching-dev libopencv-stitching4.2 libopencv-superres-dev libopencv-superres4.2libopencv-ts-dev libopencv-video-dev libopencv-video4.2 libopencv-videoio-dev libopencv-videoio4.2 libopencv-videostab-dev libopencv-videostab4.2libopencv-viz-dev libopencv-viz4.2 libopencv4.2-java libopencv4.2-jni libopenexr-dev libopenmpi-dev libopenmpi3 libpmix2 libpng-dev libpng-tools libpq5libproj15 libpsm-infinipath1 libpsm2-2 libqhull7 libraw1394-dev libraw1394-tools librdmacm1 libsocket++1 libspatialite7 libsuperlu5 libswresample-devlibswscale-dev libsz2 libtbb-dev libtbb2 libtesseract4 libtiff-dev libtiffxx5 libtool liburiparser1 libvtk6.3 libxerces-c3.2 libxnvctrl0 odbcinstodbcinst1debian2 opencv-data openmpi-bin openmpi-common proj-bin proj-data python3-numpy python3-opencv
0 upgraded, 162 newly installed, 0 to remove and 0 not upgraded.
Need to get 134 MB of archives.
After this operation, 563 MB of additional disk space will be used.
Do you want to continue? [Y/n] 

完成后,进入 openvino 源目录,安装依赖项

panda@Panda:~/git/openvino$ chmod +x install_dependencies.sh
panda@Panda:~/git/openvino$ ./install_dependencies.sh
The following additional packages will be installed:autopoint debhelper dh-autoreconf dh-strip-nondeterminism dwz g++-9-multilib gcc-9-multilib gir1.2-gtk-2.0 gir1.2-harfbuzz-0.0 icu-devtoolsintltool-debian lib32asan5 lib32atomic1 lib32gcc-9-dev lib32gcc-s1 lib32gcc1 lib32gomp1 lib32itm1 lib32quadmath0 lib32stdc++-9-dev lib32stdc++6lib32ubsan1 libarchive-cpio-perl libarchive-zip-perl libatk1.0-dev libboost-regex1.71-dev libboost-regex1.71.0 libboost1.71-dev libc6-dev-i386libc6-dev-x32 libc6-i386 libc6-x32 libcairo-script-interpreter2 libdatrie-dev libdebhelper-perl libfile-stripnondeterminism-perl libfontconfig1-devlibfreetype-dev libfreetype6-dev libfribidi-dev libgdk-pixbuf2.0-dev libgraphite2-dev libharfbuzz-dev libharfbuzz-gobject0 libice-dev libicu-devlibmail-sendmail-perl libopenblas-pthread-dev libopenblas0 libopenblas0-pthread libpixman-1-dev libsm-dev libsub-override-perl libsys-hostname-long-perllibthai-dev libx32asan5 libx32atomic1 libx32gcc-9-dev libx32gcc-s1 libx32gcc1 libx32gomp1 libx32itm1 libx32quadmath0 libx32stdc++-9-dev libx32stdc++6libx32ubsan1 libxcb-render0-dev libxcb-shm0-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxext-dev libxfixes-dev libxft-dev libxi-devlibxinerama-dev libxml2-utils libxrandr-dev libxrender-dev pango1.0-tools po-debconf x11proto-input-dev x11proto-randr-dev x11proto-xext-devx11proto-xinerama-dev
Suggested packages:dh-make lib32stdc++6-9-dbg libx32stdc++6-9-dbg libboost1.71-doc libboost-atomic1.71-dev libboost-chrono1.71-dev libboost-container1.71-devlibboost-context1.71-dev libboost-contract1.71-dev libboost-coroutine1.71-dev libboost-date-time1.71-dev libboost-exception1.71-devlibboost-fiber1.71-dev libboost-filesystem1.71-dev libboost-graph1.71-dev libboost-graph-parallel1.71-dev libboost-iostreams1.71-devlibboost-locale1.71-dev libboost-log1.71-dev libboost-math1.71-dev libboost-mpi1.71-dev libboost-mpi-python1.71-dev libboost-numpy1.71-devlibboost-program-options1.71-dev libboost-python1.71-dev libboost-random1.71-dev libboost-serialization1.71-dev libboost-stacktrace1.71-devlibboost-system1.71-dev libboost-test1.71-dev libboost-thread1.71-dev libboost-timer1.71-dev libboost-type-erasure1.71-dev libboost-wave1.71-devlibboost1.71-tools-dev libmpfrc++-dev libntl-dev libcairo2-doc libdatrie-doc freetype2-doc libgraphite2-utils libgtk2.0-doc libice-doc icu-docimagemagick libpango1.0-doc libsm-doc libssl-doc libthai-doc libxext-doc libmail-box-perl
The following NEW packages will be installed:autopoint curl debhelper dh-autoreconf dh-strip-nondeterminism dwz g++-9-multilib g++-multilib gcc-9-multilib gcc-multilib gir1.2-gtk-2.0gir1.2-harfbuzz-0.0 icu-devtools intltool-debian lib32asan5 lib32atomic1 lib32gcc-9-dev lib32gcc-s1 lib32gcc1 lib32gomp1 lib32itm1 lib32quadmath0lib32stdc++-9-dev lib32stdc++6 lib32ubsan1 libarchive-cpio-perl libarchive-zip-perl libatk1.0-dev libboost-regex-dev libboost-regex1.71-devlibboost-regex1.71.0 libboost1.71-dev libc6-dev-i386 libc6-dev-x32 libc6-i386 libc6-x32 libcairo-script-interpreter2 libcairo2-dev libdatrie-devlibdebhelper-perl libfile-stripnondeterminism-perl libfontconfig1-dev libfreetype-dev libfreetype6-dev libfribidi-dev libgdk-pixbuf2.0-devlibgraphite2-dev libgtk2.0-dev libharfbuzz-dev libharfbuzz-gobject0 libice-dev libicu-dev libmail-sendmail-perl libopenblas-dev libopenblas-pthread-devlibopenblas0 libopenblas0-pthread libpango1.0-dev libpixman-1-dev libsm-dev libssl-dev libsub-override-perl libsys-hostname-long-perl libthai-devlibx32asan5 libx32atomic1 libx32gcc-9-dev libx32gcc-s1 libx32gcc1 libx32gomp1 libx32itm1 libx32quadmath0 libx32stdc++-9-dev libx32stdc++6 libx32ubsan1libxcb-render0-dev libxcb-shm0-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxext-dev libxfixes-dev libxft-dev libxi-dev libxinerama-devlibxml2-utils libxrandr-dev libxrender-dev pango1.0-tools po-debconf x11proto-input-dev x11proto-randr-dev x11proto-xext-dev x11proto-xinerama-dev
0 upgraded, 94 newly installed, 0 to remove and 0 not upgraded.
Need to get 59.7 MB of archives.
After this operation, 489 MB of additional disk space will be used.

还需要安装 cython3

Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:cython-doc
The following NEW packages will be installed:cython3
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 1,474 kB of archives.
After this operation, 7,038 kB of additional disk space will be used.

完成后,就可以准备编译了,首先修改几个文件,来对应我们的 python 3.8

  1. scripts/setupvars/setupvars.sh, 97 行开始,添加 python 3.8的判断
    if command -v python3.8 >/dev/null 2>&1; thenpython_version=3.8python_bitness=$(python3.8 -c 'import sys; print(64 if sys.maxsize > 2**32 else 32)')elif command -v python3.7 >/dev/null 2>&1; then

129行,注释对 python 2.7 的判断

#    if [ "$python_version" != "2.7" ]; then
#        # add path to OpenCV API for Python 3.x
#        export PYTHONPATH="$INTEL_OPENVINO_DIR/python/python3:$PYTHONPATH"
#    fi
  1. model-optimizer/install_prerequisites/install_prerequisites.sh 的 75 行,
    sudo -E apt -y install python3-pip python3-virtualenv libgfortran5

因为LattePanda 的cpu 不被支持,GPU又很弱,所以我关闭了 CPU 和 GPU 的编译,执行

mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_CLDNN=OFF -D OpenCV_DIR=/usr/lib/x86_64-linux-gnu/cmake/opencv4  -DENABLE_PYTHON=ON -DPYTHON_EXECUTABLE=/usr/bin/python3 -DPYTHON_LIBRARY=/usr/lib/x86_64-linux-gnu/libpython3.8.so -DPYTHON_INCLUDE_DIR=/usr/include/python3.8 -DENABLE_MKL_DNN=OFF -DENABLE_SSE42=OFF -DENABLE_PYTHON=ON -DPYTHON_EXECUTABLE=`which python3.8` -DPYTHON_LIBRARY=/usr/lib/x86_64-linux-gnu/libpython3.8.so -DPYTHON_INCLUDE_DIR=/usr/include/python3.8 -DNGRAPH_ONNX_IMPORT_ENABLE=ON  ..
-- CMAKE_BUILD_TYPE: Release
-- Detected 64 bit architecture
-- Inference Engine enabled features:
--
--     CI_BUILD_NUMBER: custom_master_b162f9d5ac8168d64f47a304358c37442d433e86
--     ENABLE_TESTS = OFF
--     ENABLE_MKL_DNN = OFF
--     ENABLE_CLDNN = OFF
--     ENABLE_LTO = OFF
--     OS_FOLDER = OFF
--     TREAT_WARNING_AS_ERROR = ON
--     ENABLE_INTEGRITYCHECK = OFF
--     ENABLE_SANITIZER = OFF
--     ENABLE_THREAD_SANITIZER = OFF
--     COVERAGE = OFF
--     ENABLE_SSE42 = OFF
--     ENABLE_AVX2 = ON
--     ENABLE_AVX512F = ON
--     ENABLE_PROFILING_ITT = ON
--
-- PROJECT ............................... OpenVINO
-- CMAKE_BINARY_DIR ...................... /home/panda/git/openvino/build
-- OpenVINO_MAIN_SOURCE_DIR .............. /home/panda/git/openvino
-- IE_MAIN_SOURCE_DIR .................... /home/panda/git/openvino/inference-engine
-- CMAKE_GENERATOR ....................... Unix Makefiles
-- CMAKE_C_COMPILER_ID ................... GNU
-- CMAKE_BUILD_TYPE ...................... Release
-- INTEL_VTUNE_DIR is not defined
-- Could NOT find ITT (missing: Located_ITT_INCLUDE_DIRS Located_ITT_LIBS)
CMake Warning at openvino/itt/CMakeLists.txt:26 (message):Profiling option enabled, but no ITT library was found-- The name openvino::itt is an ALIAS for itt. It will be exported to the InferenceEngineDeveloperPackage with the original name.
-- Current hash b162f9d5ac8168d64f47a304358c37442d433e86
-- NGRAPH_VERSION 0.0.0+b162f9d
-- NGRAPH_VERSION_SHORT 0.0.0
-- NGRAPH_WHEEL_VERSION 0.0.0
-- NGRAPH_API_VERSION 0.0
-- NGRAPH_ADDRESS_SANITIZER_ENABLE:      OFF
-- NGRAPH_CODE_COVERAGE_ENABLE:          OFF
-- NGRAPH_DEBUG_ENABLE:                  OFF
-- NGRAPH_DEPRECATED_ENABLE:             ON
-- NGRAPH_DYNAMIC_COMPONENTS_ENABLE:     ON
-- NGRAPH_EXPORT_TARGETS_ENABLE:         ON
-- NGRAPH_IE_ENABLE:                     OFF
-- NGRAPH_IE_STATIC_LIB_ENABLE:
-- NGRAPH_INTERPRETER_ENABLE:            ON
-- NGRAPH_LIB_VERSIONING_ENABLE:         OFF
-- NGRAPH_ONNX_IMPORT_ENABLE:            ON
-- NGRAPH_PYTHON_BUILD_ENABLE:           OFF
-- NGRAPH_TEST_UTIL_ENABLE:              ON
-- NGRAPH_THREAD_SANITIZER_ENABLE:       OFF
-- NGRAPH_TOOLS_ENABLE:
-- NGRAPH_UB_SANITIZER_ENABLE:           OFF
-- NGRAPH_USE_PROTOBUF_LITE:             OFF
-- NGRAPH_UNIT_TEST_ENABLE:              OFF
-- NGRAPH_WARNINGS_AS_ERRORS:            OFF
-- NGRAPH_CXX_STANDARD:                  11
-- NGRAPH_FORWARD_CMAKE_ARGS -DCMAKE_C_COMPILER=/usr/bin/cc;-DCMAKE_CXX_COMPILER=/usr/bin/c++;-DCMAKE_CXX_STANDARD:STRING=11;-DCMAKE_CXX_STANDARD_REQUIRED:BOOL=ON;-DCMAKE_CXX_EXTENSIONS:BOOL=OFF;-DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON;-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON;-DCMAKE_BUILD_TYPE=Release
-- Installation directory: /usr/local
-- NGRAPH_COMMON_CXX_FLAGS -Wformat;-Wformat-security;-D_FORTIFY_SOURCE=2;-fstack-protector-strong;-s;-fsigned-char;-Werror;-ffunction-sections;-fdata-sections;-fdiagnostics-show-option;-Wundef;-Wreturn-type;-Wuninitialized;-Winit-self;-Wmaybe-uninitialized;-Wno-error=maybe-uninitialized;-Wno-error=return-type;-fPIC;-Wno-error=return-type;-Wno-undef
-- NGRAPH_COMMON_C_FLAGS -Wformat;-Wformat-security;-D_FORTIFY_SOURCE=2;-fstack-protector-strong;-s;-ffunction-sections;-fdata-sections;-fdiagnostics-show-option;-Wundef;-Wreturn-type;-Wuninitialized;-Winit-self;-Wmaybe-uninitialized;-Wno-error=maybe-uninitialized;-Wno-error=return-type;-fPIC;-Wno-error=return-type;-Wno-undef
-- Compile Flags: -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -fstack-protector-strong -s -fsigned-char -Werror -ffunction-sections -fdata-sections -fdiagnostics-show-option -Wundef -Wreturn-type -Wuninitialized -Winit-self -Wmaybe-uninitialized -Wno-error=maybe-uninitialized -Wno-error=return-type -fPIC -Wno-error=return-type -Wno-undef -DEIGEN_MPL2_ONLY -DTBB_USE_THREADING_TOOLS -DNGRAPH_DYNAMIC_COMPONENTS_ENABLE
-- Shared Link Flags:  -Wl,--gc-sections -Wl,--exclude-libs,ALL
-- CMAKE_CXX_FLAGS_RELEASE -O3 -DNDEBUG
-- CMAKE_CXX_FLAGS_DEBUG -O0 -g
--
-- 3.7.1.0
Generated: /home/panda/git/openvino/build/_deps/ext_onnx-build/onnx/onnx_ngraph_onnx-ml.proto
Generated: /home/panda/git/openvino/build/_deps/ext_onnx-build/onnx/onnx-operators_ngraph_onnx-ml.proto
--
-- ******** Summary ********
--   CMake version         : 3.16.3
--   CMake command         : /usr/bin/cmake
--   System                : Linux
--   C++ compiler          : /usr/bin/c++
--   C++ compiler version  : 9.3.0
--   CXX flags             : -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -fstack-protector-strong -s -fsigned-char -Werror -ffunction-sections -fdata-sections -fdiagnostics-show-option -Wundef -Wreturn-type -Wuninitialized -Winit-self -Wmaybe-uninitialized -Wno-error=maybe-uninitialized -Wno-error=return-type -fPIC -Wno-error=return-type -Wno-undef -Wnon-virtual-dtor
--   Build type            : Release
--   Compile definitions   : IE_BUILD_POSTFIX="";NGRAPH_DEPRECATED_ENABLE;PROJECT_ROOT_DIR="/home/panda/git/openvino"
--   CMAKE_PREFIX_PATH     :
--   CMAKE_INSTALL_PREFIX  : /usr/local
--   CMAKE_MODULE_PATH     : /home/panda/git/openvino/cmake;/home/panda/git/openvino/cmake/download;/home/panda/git/openvino/cmake/cross_compile;/home/panda/git/openvino/ngraph/cmake/Modules/;/home/panda/git/openvino/cmake/Modules/
--
--   ONNX version          : 1.6.0
--   ONNX NAMESPACE        : ngraph_onnx
--   ONNX_BUILD_TESTS      : OFF
--   ONNX_BUILD_BENCHMARKS : OFF
--   ONNX_USE_LITE_PROTO   : OFF
--   ONNXIFI_DUMMY_BACKEND : OFF
--   ONNXIFI_ENABLE_EXT    : OFF
--
--   Protobuf compiler     :
--   Protobuf includes     :
--   Protobuf libraries    :
--   BUILD_ONNX_PYTHON     : OFF
-- The name ngraph::reference is an ALIAS for ngraph_reference. It will be exported to the InferenceEngineDeveloperPackage with the original name.
-- unit tests disabled
-- Inference Engine enabled features:
--
--     CI_BUILD_NUMBER: custom_master_b162f9d5ac8168d64f47a304358c37442d433e86
--     ENABLE_TESTS = OFF
--     ENABLE_MKL_DNN = OFF
--     ENABLE_CLDNN = OFF
--     ENABLE_LTO = OFF
--     OS_FOLDER = OFF
--     TREAT_WARNING_AS_ERROR = ON
--     ENABLE_INTEGRITYCHECK = OFF
--     ENABLE_SANITIZER = OFF
--     ENABLE_THREAD_SANITIZER = OFF
--     COVERAGE = OFF
--     ENABLE_SSE42 = OFF
--     ENABLE_AVX2 = ON
--     ENABLE_AVX512F = ON
--     ENABLE_PROFILING_ITT = ON
--     ENABLE_GNA = ON
--     ENABLE_CLDNN_TESTS = OFF
--     THREADING = TBB
--     GNA_LIBRARY_VERSION = GNA2
--     ENABLE_VPU = ON
--     ENABLE_MYRIAD = ON
--     ENABLE_MYRIAD_NO_BOOT = OFF
--     ENABLE_GAPI_TESTS = OFF
--     GAPI_TEST_PERF = OFF
--     ENABLE_MYRIAD_MVNC_TESTS = OFF
--     ENABLE_DATA = OFF
--     ENABLE_SAME_BRANCH_FOR_MODELS = OFF
--     ENABLE_BEH_TESTS = OFF
--     ENABLE_FUNCTIONAL_TESTS = OFF
--     ENABLE_SAMPLES = ON
--     ENABLE_SPEECH_DEMO = ON
--     ENABLE_FUZZING = OFF
--     VERBOSE_BUILD = OFF
--     ENABLE_UNSAFE_LOCATIONS = OFF
--     ENABLE_ALTERNATIVE_TEMP = ON
--     ENABLE_OPENCV = ON
--     ENABLE_PYTHON = ON
--     ENABLE_V7_SERIALIZE = OFF
--     ENABLE_JAVA = OFF
--     ENABLE_CPPLINT = ON
--     ENABLE_CPPLINT_REPORT = OFF
--     ENABLE_CLANG_FORMAT = ON
--     ENABLE_TBB_RELEASE_ONLY = ON
--
-- MODELS_PATH=
CMake Warning at inference-engine/cmake/vpu_dependencies.cmake:120 (message):VPU_OCL_COMPILER is not found.  Some tests will skipped
Call Stack (most recent call first):inference-engine/cmake/dependencies.cmake:43 (include)inference-engine/CMakeLists.txt:18 (include)CMake Warning at inference-engine/cmake/dependencies.cmake:304 (message):Unable to locate Speech Demo
Call Stack (most recent call first):inference-engine/CMakeLists.txt:18 (include)-- libGNA::API INTERFACE_LIBRARY : /home/panda/git/openvino/inference-engine/temp/gna_02.00.00.1047.1/include
-- libGNA::KERNEL SHARED_LIBRARY : /home/panda/git/openvino/inference-engine/temp/gna_02.00.00.1047.1/linux/x64/libgna.so
-- Found Cython version 0.29.17
-- Register template_plugin to be built in build-plugins/template_plugin
-- Configuring done
-- Generating done
-- Build files have been written to: /home/panda/git/openvino/buildmake --jobs=$(nproc --all)

稍等片刻就编译完成了。

[ 98%] Linking CXX shared library ../../../../bin/intel64/Release/lib/libHeteroPlugin.so
[ 98%] Linking CXX shared library ../../../../bin/intel64/Release/lib/libGNAPlugin.so
[ 98%] Linking CXX shared library ../../../../../bin/intel64/Release/lib/libmyriadPlugin.so
[ 98%] Linking CXX shared library ../../../../bin/intel64/Release/lib/libMultiDevicePlugin.so
[ 98%] Built target MultiDevicePlugin
[ 98%] Linking CXX shared library ../../../../../bin/intel64/Release/lib/libtemplatePlugin.so
[ 98%] Built target HeteroPlugin
[100%] Built target GNAPlugin
[100%] Built target templatePlugin
[100%] Built target myriadPlugin
[100%] Linking CXX executable ../../../../../bin/intel64/Release/myriad_compile
[100%] Linking CXX executable ../../../../../bin/intel64/Release/myriad_perfcheck
[100%] Built target myriad_perfcheck
[100%] Built target myriad_compile

然后是安装

sudo make install
...Install the project...
-- Install configuration: "Release"
-- Installing: /usr/local/bin/setupvars.sh
-- Installing: /usr/local/install_dependencies
...

文件默认被安装到 /usr/local 下, 为了与以往的脚本兼容,我手动将这些文件移动了 /opt/intel/openvino 目录下。
然后安装 神经棒驱动文件

panda@Panda:/opt/intel/openvino/install_dependencies$ source install_NCS_udev_rules.sh
Updating udev rules...
Udev rules have been successfully installed.

重启系统后,可以测试一下设备

panda@Panda:/opt/intel/openvino/inference_engine/samples/python/hello_query_device$ lsusb
Bus 001 Device 013: ID 03e7:2485 Intel Movidius MyriadXpanda@Panda:/opt/intel/openvino/inference_engine/samples/python/hello_query_device$ python3 hello_query_device.py
Available devices:Device: MYRIADMetrics:DEVICE_THERMAL: UNSUPPORTED TYPEOPTIMIZATION_CAPABILITIES: FP16RANGE_FOR_ASYNC_INFER_REQUESTS: 3, 6, 1SUPPORTED_METRICS: DEVICE_THERMAL, OPTIMIZATION_CAPABILITIES, RANGE_FOR_ASYNC_INFER_REQUESTS, SUPPORTED_METRICS, SUPPORTED_CONFIG_KEYS, FULL_DEVICE_NAME, AVAILABLE_DEVICESSUPPORTED_CONFIG_KEYS: DEVICE_ID, EXCLUSIVE_ASYNC_REQUESTS, LOG_LEVEL, VPU_MYRIAD_FORCE_RESET, VPU_MYRIAD_PLATFORM, VPU_CUSTOM_LAYERS, PERF_COUNT, VPU_PRINT_RECEIVE_TENSOR_TIME, CONFIG_FILE, VPU_HW_STAGES_OPTIMIZATION, MYRIAD_ENABLE_FORCE_RESET, MYRIAD_ENABLE_RECEIVING_TENSOR_TIME, MYRIAD_CUSTOM_LAYERS, MYRIAD_ENABLE_HW_ACCELERATIONFULL_DEVICE_NAME: Intel Movidius Myriad X VPUAVAILABLE_DEVICES: 1.1-ma2480Default values for device configuration keys:DEVICE_ID: EXCLUSIVE_ASYNC_REQUESTS: NOLOG_LEVEL: LOG_NONEVPU_MYRIAD_FORCE_RESET: NOVPU_MYRIAD_PLATFORM: VPU_CUSTOM_LAYERS: PERF_COUNT: NOVPU_PRINT_RECEIVE_TENSOR_TIME: NOCONFIG_FILE: VPU_HW_STAGES_OPTIMIZATION: YESMYRIAD_ENABLE_FORCE_RESET: NOMYRIAD_ENABLE_RECEIVING_TENSOR_TIME: NOMYRIAD_CUSTOM_LAYERS: MYRIAD_ENABLE_HW_ACCELERATION: YES

跑个分类模型测试一下

panda@Panda:/opt/intel/openvino/inference_engine/samples/python$ python3 classification_sample/classification_sample.py --input ~/test/beagle.jpeg --model ~/ml/models/public/squeezenet1.1/FP16/squeezenet1.1.xml -d MYRIAD --labels ~/ml/models/synset_words.txt
[ INFO ] Creating Inference Engine
[ INFO ] Loading network files:/home/panda/ml/models/public/squeezenet1.1/FP16/squeezenet1.1.xml/home/panda/ml/models/public/squeezenet1.1/FP16/squeezenet1.1.bin
[ INFO ] Preparing input blobs
[ WARNING ] Image /home/panda/test/beagle.jpeg is resized from (168, 300) to (227, 227)
[ INFO ] Batch size is 1
[ INFO ] Loading model to the plugin
[ INFO ] Starting inference in synchronous mode
[ INFO ] Processing output blob
[ INFO ] Top 10 results:
Image /home/panda/test/beagle.jpegclassid probability
------- -----------
beagle    0.6635742
English foxhound 0.2944336
Walker hound, Walker foxhound0.0374146boxer   0.0008821
Saint Bernard, St Bernard0.0008273
Greater Swiss Mountain dog0.0006657
Welsh springer spaniel0.0005026
basset, basset hound0.0003791
EntleBucher0.0002651
American Staffordshire terrier, Staffordshire terrier, American pit bull terrier, pit bull terrier0.0002090[ INFO ] This sample is an API example, for any performance measurements please use the dedicated benchmark_app tool

一切正常,又可以愉快的玩耍了!

谢谢阅读,如果您觉得有用,请收藏点赞投票。

LattePanda 安装ubuntu 20.04 和 openvino相关推荐

  1. ubuntu安装minisat_为LattePanda安装Lubuntu 20.04并优化内核(已更新)

    Latest Linux Distributions on LattePanda and Kernel Customization 前言 Preface 原创文章,转载引用请务必注明链接,水平有限,如 ...

  2. 安装Ubuntu 20.04.1 LTS (Focal Fossa)到U盘并安装ros2

    安装Ubuntu 20.04.1 LTS (Focal Fossa)到U盘并安装ros2 下载iso 将系统安装到U盘 Ubuntu ROS2 Foxy安装教程 PS:通过搜索各位大佬的博客,一套下来 ...

  3. 安装Ubuntu 20.04后要做的几件事(换源,精简,定制)

    文章目录 一. 给Ubuntu换国内源 二. 删除系统自带软件 三. 安装vim 四. 自动卸载不需要的依赖 五. 安装Chrome浏览器并加入apt更新 六. 装搜狗输入法 七. 安装WPS 八. ...

  4. 在Win10 PC上安装Ubuntu 20.04 系统

    在Win10 PC上安装Ubuntu 20.04 系统 本文仅适用于UEFI+GPT类型的PC,有关这方面的知识请自行了解. 引言 为什么需要使用 Linux 系统? 既已看到此文,我相信你一定有需求 ...

  5. 华为桌面云虚拟机如何安装Ubuntu 20.04.3-live-server

    环景: FusionAccess 8.0.1 FusionCompute8.0.1 问题描述: 华为桌面云虚拟机如何安装Ubuntu 20.04.3-live-server 解决方案: 一.官方下载U ...

  6. 如何安装Ubuntu 20.04 LTS服务器的图文教程

    今天,我们将通过图文向您展示如何安装Ubuntu 20.04 LTS服务器.如果您的系统上已经有Ubuntu 18.04 LTS服务器,则只需将其升级到Ubuntu 20.04 LTS服务器.如果您不 ...

  7. 1.windows11开启wsl2并安装Ubuntu 20.04

    1. 开启wsl2 打开控制面板,选择程序 -- 启用或关闭Windows功能,勾选 适用于Linux的Windows子系统还有虚拟机平台选项 设置wsl版本为wsl2 使用管理员身份,打开cmd(命 ...

  8. 如何在 Windows 10 的同时安装 Ubuntu 20.04实现双系统

    如何在 Windows 10 的同时安装 Ubuntu 20.04 和双启动 注:本文翻译自How to install Ubuntu 20.04 and dual boot alongside Wi ...

  9. 第一章 Dell 游匣 G15 5511 安装Ubuntu 20.04 系统

    由于工作环境需要,要将电脑的win 11系统刷成 Ubuntu 20.04 第一章 Dell 游匣 G15 5511 安装Ubuntu 20.04 系统 文章目录 一.下载Ubuntu 20.04 镜 ...

最新文章

  1. python在线工具-6 种 Python 数据可视化工具
  2. springboot整合websocket实现一对一消息推送和广播消息推送
  3. 对程序实施精准手术!阿里安全猎户座实验室首创“自动逆向机器人”
  4. 更改默认软件下载的路径
  5. poj1064 二分搜索 挑战程序设计竞赛
  6. ubuntu 安装搜狗输入法(解决部分ubuntu安装完没有键盘选择栏)
  7. 由电梯紧急按钮,谈用户体验
  8. STEP 7 V5.5 版本特性
  9. WorkNC编程软件配套英格索尔高速铣刀帮助奥迪加工
  10. 一些好看的渐变色(配色)网站推荐
  11. 实现手机蓝牙解锁电脑_手机版和电脑版微信多开的实现方法
  12. 微信小程序之文本换行居中
  13. Node.js 包管理器 ied
  14. 倍福PLC:win7专业版系统安装TwinCAT3后图标灰色,报错0x426 starting TwinCAT system
  15. 微信小程序微信原生小程序如何通过后端返回的二进制流导出excel文件并保存和转发
  16. win7安装网络打印机显示windows无法连接到打印机,出现错误0x00000bcb
  17. U3D DotH教程2
  18. shadertoy入门教程
  19. 零基础也能用ChatGPT写代码,简直不要太爽
  20. K8S太火了!花10分钟玩转它不香么?

热门文章

  1. 新年第一篇,androidHAL层知多少?
  2. 新时期下大型数据中心机房给排水及消防设计要点分析
  3. 2021高考汇文中学成绩查询,2021年北京高考英语阅读理解评析(北京汇文中学)...
  4. vs好用吗?vs2022下载。
  5. MySQL给查询结果添加序号列的书写格式
  6. 编写Java程序,使用Swing事件处理机制实现用户登录和英雄信息显示
  7. 一些常用技术文档网站
  8. MegaCli的简易使用(命令总结)
  9. 数据分析案例-旅游景点票价预测
  10. Docker容器处于Removal in process 无法删除解决方案