summaryrefslogtreecommitdiffstats
path: root/dynamic-layers
diff options
context:
space:
mode:
authorMartin Jansa <martin.jansa@gmail.com>2019-10-24 19:00:57 (GMT)
committerAnuj Mittal <anuj.mittal@intel.com>2019-10-25 02:05:14 (GMT)
commit1a669124ecfa4bcd9182cde2ea0465b8f62305e9 (patch)
treedf4ef565f85cdc55912627c15a32dc6e9ea88df4 /dynamic-layers
parentc66d4837720eaa27e59eaad784b0f1eebbc8ba30 (diff)
downloadmeta-intel-1a669124ecfa4bcd9182cde2ea0465b8f62305e9.tar.gz
dldt-inference-engine: use firmware files from SRC_URI
* use the files from SRC_URI instead of fetching them during configure * use the firmware files CMake would download during configure when not provided already, I haven't found any changelog to find out what's the difference between firmware_ma2x8x_784.zip firmware_ma2x8x_mdk_R9.8.zip firmware_ma2450_759W.zip firmware_ma2450_784.zip firmware_mv0262_784.zip firmware_mv0262_mdk_R9.8.zip so to be safe use whatever CMake does and what I was testing on raspberrypi4 before (because of missing this fix). -- Downloading from https://download.01.org/opencv/2019/openvinotoolkit/R3/inference_engine/firmware_ma2450_759W.zip to dldt-inference-engine/2019r3-r0/git/inference-engine/temp/download/firmware_ma2450_759W.zip ... -- Downloading from https://download.01.org/opencv/2019/openvinotoolkit/R3/inference_engine/firmware_ma2x8x_mdk_R9.8.zip to dldt-inference-engine/2019r3-r0/git/inference-engine/temp/download/firmware_ma2x8x_mdk_R9.8.zip ... -- Downloading from https://download.01.org/opencv/2019/openvinotoolkit/R3/inference_engine/firmware_mv0262_mdk_R9.8.zip to dldt-inference-engine/2019r3-r0/git/inference-engine/temp/download/firmware_mv0262_mdk_R9.8.zip ... * add PACKAGECONFIG verbose for VERBOSE_BUILD so it's easier to debug which firmware files are being used, in this case: log.do_configure will show: -- ma2450=../mvnc/MvNCAPI-ma2450.mvcmd -- ma2x8x=../mvnc/MvNCAPI-ma2x8x.mvcmd -- mv0262=../mvnc/MvNCAPI-mv0262.mvcmd * the patch is very loosely based on the patch removed here: http://git.yoctoproject.org/cgit/cgit.cgi/meta-intel/diff/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0003-Supply-firmware-at-build-time.patch?id=649456856dc38086e7d43d740d68198e3395b067 but I've reworked it competely to simplify this mess :) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Diffstat (limited to 'dynamic-layers')
-rw-r--r--dynamic-layers/openembedded-layer/recipes-support/opencv/dldt-inference-engine_2019r3.bb22
-rw-r--r--dynamic-layers/openembedded-layer/recipes-support/opencv/files/0008-Simplify-searching-for-firmware-files.patch104
2 files changed, 116 insertions, 10 deletions
diff --git a/dynamic-layers/openembedded-layer/recipes-support/opencv/dldt-inference-engine_2019r3.bb b/dynamic-layers/openembedded-layer/recipes-support/opencv/dldt-inference-engine_2019r3.bb
index a655003..3105562 100644
--- a/dynamic-layers/openembedded-layer/recipes-support/opencv/dldt-inference-engine_2019r3.bb
+++ b/dynamic-layers/openembedded-layer/recipes-support/opencv/dldt-inference-engine_2019r3.bb
@@ -5,9 +5,9 @@ deep learning models through a high-level C++ Inference Engine API \
5integrated with application logic." 5integrated with application logic."
6 6
7SRC_URI = "git://github.com/opencv/dldt.git;protocol=git;branch=2019 \ 7SRC_URI = "git://github.com/opencv/dldt.git;protocol=git;branch=2019 \
8 https://download.01.org/opencv/2019/openvinotoolkit/R3/inference_engine/firmware_ma2450_784.zip;name=ma2450 \ 8 https://download.01.org/opencv/2019/openvinotoolkit/R3/inference_engine/firmware_ma2450_759W.zip;name=ma2450 \
9 https://download.01.org/opencv/2019/openvinotoolkit/R3/inference_engine/firmware_ma2x8x_784.zip;name=ma2x8x \ 9 https://download.01.org/opencv/2019/openvinotoolkit/R3/inference_engine/firmware_ma2x8x_mdk_R9.8.zip;name=ma2x8x \
10 https://download.01.org/opencv/2019/openvinotoolkit/R3/inference_engine/firmware_mv0262_784.zip;name=mv0262 \ 10 https://download.01.org/opencv/2019/openvinotoolkit/R3/inference_engine/firmware_mv0262_mdk_R9.8.zip;name=mv0262 \
11 file://0001-R2-Build-fixes.patch;patchdir=../ \ 11 file://0001-R2-Build-fixes.patch;patchdir=../ \
12 file://0002-R2-Install-DLDT-headers-libs-sample-Apps.patch;patchdir=../ \ 12 file://0002-R2-Install-DLDT-headers-libs-sample-Apps.patch;patchdir=../ \
13 file://0003-use-GNUInstallDirs-on-nix.patch;patchdir=../ \ 13 file://0003-use-GNUInstallDirs-on-nix.patch;patchdir=../ \
@@ -15,18 +15,19 @@ SRC_URI = "git://github.com/opencv/dldt.git;protocol=git;branch=2019 \
15 file://0005-point-to-correct-location-of-ngraph-headers.patch;patchdir=../ \ 15 file://0005-point-to-correct-location-of-ngraph-headers.patch;patchdir=../ \
16 file://0006-Install-clDNN-plugin-to-CMAKE_INSTALL_LIBDIR.patch;patchdir=../ \ 16 file://0006-Install-clDNN-plugin-to-CMAKE_INSTALL_LIBDIR.patch;patchdir=../ \
17 file://0007-Install-mock_engine-to-CMAKE_INSTALL_LIBDIR.patch;patchdir=../ \ 17 file://0007-Install-mock_engine-to-CMAKE_INSTALL_LIBDIR.patch;patchdir=../ \
18 file://0008-Simplify-searching-for-firmware-files.patch;patchdir=../ \
18 file://run-ptest \ 19 file://run-ptest \
19 " 20 "
20SRCREV = "1c794d971cdd3c94de5ea4a6c9588eac63f4cc57" 21SRCREV = "1c794d971cdd3c94de5ea4a6c9588eac63f4cc57"
21 22
22SRC_URI[ma2450.md5sum] = "29198491965f2d3da489aea3b2d5fbca" 23SRC_URI[ma2450.md5sum] = "852f80c3248c451a6c8bfd96d871318f"
23SRC_URI[ma2450.sha256sum] = "b74c314bf88121536d07cd0e288cdac0e72b42d5aa81b23b7b5c1858ef03539b" 24SRC_URI[ma2450.sha256sum] = "ba1b23b45cd8e548ead77af49b0e378100cf4f8dcda41a491868d3d4e7bf8cba"
24 25
25SRC_URI[ma2x8x.md5sum] = "bf1b85caa637566e61922c59afcb7c40" 26SRC_URI[ma2x8x.md5sum] = "2d9ca6894cdd25e9b10f7908c415dbc9"
26SRC_URI[ma2x8x.sha256sum] = "2993ecfb638b311dca0f208bec8bf66ba896274c513d949781b9f98383dac652" 27SRC_URI[ma2x8x.sha256sum] = "961ce4c7b14823a528185f5e75b3b6898a7e8f866b4b5b8af5f4f05f72226909"
27 28
28SRC_URI[mv0262.md5sum] = "026f30b5b60ccadf7aedc3ebe0fbf7f1" 29SRC_URI[mv0262.md5sum] = "c495f0ee0313e9d8d993e846a7868c4f"
29SRC_URI[mv0262.sha256sum] = "3f55645ac3a0d35467d0ebb8689852664d65b73735ad5d782d423468d6e12781" 30SRC_URI[mv0262.sha256sum] = "0c0c8d7782f49dd4928837b52b4b6f25c1b088bfee23e464729057a28323ab77"
30 31
31LICENSE = "Apache-2.0 & ISSL" 32LICENSE = "Apache-2.0 & ISSL"
32LIC_FILES_CHKSUM = "file://../LICENSE;md5=86d3f3a95c324c9479bd8986968f4327 \ 33LIC_FILES_CHKSUM = "file://../LICENSE;md5=86d3f3a95c324c9479bd8986968f4327 \
@@ -69,7 +70,8 @@ COMPATIBLE_HOST_libc-musl = "null"
69PACKAGECONFIG ?= "" 70PACKAGECONFIG ?= ""
70PACKAGECONFIG[opencl] = "-DENABLE_CLDNN=1 -DCLDNN__IOCL_ICD_INCDIRS=${STAGING_INCDIR} -DCLDNN__IOCL_ICD_STLDIRS=${STAGING_LIBDIR} -DCLDNN__IOCL_ICD_SHLDIRS=${STAGING_LIBDIR}, -DENABLE_CLDNN=0, opencl-icd-loader, opencl-icd-loader intel-compute-runtime" 71PACKAGECONFIG[opencl] = "-DENABLE_CLDNN=1 -DCLDNN__IOCL_ICD_INCDIRS=${STAGING_INCDIR} -DCLDNN__IOCL_ICD_STLDIRS=${STAGING_LIBDIR} -DCLDNN__IOCL_ICD_SHLDIRS=${STAGING_LIBDIR}, -DENABLE_CLDNN=0, opencl-icd-loader, opencl-icd-loader intel-compute-runtime"
71PACKAGECONFIG[python3] = "-DENABLE_PYTHON=ON -DPYTHON_LIBRARY=${PYTHON_LIBRARY} -DPYTHON_INCLUDE_DIR=${PYTHON_INCLUDE_DIR}, -DENABLE_PYTHON=OFF, python3-cython-native, python3" 72PACKAGECONFIG[python3] = "-DENABLE_PYTHON=ON -DPYTHON_LIBRARY=${PYTHON_LIBRARY} -DPYTHON_INCLUDE_DIR=${PYTHON_INCLUDE_DIR}, -DENABLE_PYTHON=OFF, python3-cython-native, python3"
72PACKAGECONFIG[vpu] = "-DVPU_FIRMWARE_MA2450_FILE=../mvnc/MvNCAPI-ma2450.mvcmd -DVPU_FIRMWARE_MA2X8X_FILE=../mvnc/MvNCAPI-ma2x8x.mvcmd -DVPU_FIRMWARE_MV0262_FILE=../mvnc/MvNCAPI-mv0262.mvcmd,-DENABLE_VPU=OFF,,${PN}-vpu-firmware" 73PACKAGECONFIG[vpu] = "-DENABLE_VPU=ON -DVPU_FIRMWARE_MA2450_FILE=../mvnc/MvNCAPI-ma2450.mvcmd -DVPU_FIRMWARE_MA2X8X_FILE=../mvnc/MvNCAPI-ma2x8x.mvcmd -DVPU_FIRMWARE_MV0262_FILE=../mvnc/MvNCAPI-mv0262.mvcmd,-DENABLE_VPU=OFF,,${PN}-vpu-firmware"
74PACKAGECONFIG[verbose] = "-DVERBOSE_BUILD=1,-DVERBOSE_BUILD=0"
73 75
74do_install_append() { 76do_install_append() {
75 install -m0644 ${WORKDIR}/mvnc/MvNCAPI-ma2450.mvcmd ${D}${libdir} 77 install -m0644 ${WORKDIR}/mvnc/MvNCAPI-ma2450.mvcmd ${D}${libdir}
diff --git a/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0008-Simplify-searching-for-firmware-files.patch b/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0008-Simplify-searching-for-firmware-files.patch
new file mode 100644
index 0000000..a4c75ff
--- /dev/null
+++ b/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0008-Simplify-searching-for-firmware-files.patch
@@ -0,0 +1,104 @@
1From 1f6f05ae4d3fba95ccc34a4622d06b9d2bf88e80 Mon Sep 17 00:00:00 2001
2From: Martin Jansa <Martin.Jansa@gmail.com>
3Date: Fri, 27 Sep 2019 11:34:36 +0800
4Subject: [PATCH] Simplify searching for firmware files
5
6Disable runtime fetching when VPU_FIRMWARE_*_FILE variables are defined
7and point to already fetched firmware instead.
8
9Do it all in one foreach loop.
10
11Upstream-Status: Submitted [https://github.com/opencv/dldt/pull/302]
12
13Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
14---
15 inference-engine/cmake/vpu_dependencies.cmake | 63 ++++++-------------
16 1 file changed, 20 insertions(+), 43 deletions(-)
17
18diff --git a/inference-engine/cmake/vpu_dependencies.cmake b/inference-engine/cmake/vpu_dependencies.cmake
19index 1550163d..e0bc844e 100644
20--- a/inference-engine/cmake/vpu_dependencies.cmake
21+++ b/inference-engine/cmake/vpu_dependencies.cmake
22@@ -4,52 +4,29 @@
23
24 set(VPU_SUPPORTED_SOC ma2450 ma2x8x mv0262)
25
26-#
27-# Default firmware packages
28-#
29-
30-RESOLVE_DEPENDENCY(VPU_FIRMWARE_MA2450
31- ARCHIVE_UNIFIED firmware_ma2450_759W.zip
32- TARGET_PATH "${TEMP}/vpu/firmware/ma2450"
33- ENVIRONMENT "VPU_FIRMWARE_MA2450"
34- FOLDER)
35-debug_message(STATUS "ma2450=" ${VPU_FIRMWARE_MA2450})
36-
37-RESOLVE_DEPENDENCY(VPU_FIRMWARE_MV0262
38- ARCHIVE_UNIFIED firmware_mv0262_mdk_R9.8.zip
39- TARGET_PATH "${TEMP}/vpu/firmware/mv0262"
40- ENVIRONMENT "VPU_FIRMWARE_MV0262"
41- FOLDER)
42-debug_message(STATUS "mv0262=" ${VPU_FIRMWARE_MV0262})
43-
44-RESOLVE_DEPENDENCY(VPU_FIRMWARE_MA2X8X
45- ARCHIVE_UNIFIED firmware_ma2x8x_mdk_R9.8.zip
46- TARGET_PATH "${TEMP}/vpu/firmware/ma2x8x"
47- ENVIRONMENT "VPU_FIRMWARE_MA2X8X"
48- FOLDER)
49-debug_message(STATUS "ma2x8x=" ${VPU_FIRMWARE_MA2X8X})
50-
51-#
52-# CMake variables to override default firmware files
53-#
54-
55 foreach(soc IN LISTS VPU_SUPPORTED_SOC)
56 string(TOUPPER "${soc}" soc_upper)
57- set(var_name VPU_FIRMWARE_${soc_upper}_FILE)
58+ set(var_name_file VPU_FIRMWARE_${soc_upper}_FILE)
59+ set(var_name VPU_FIRMWARE_${soc_upper})
60+ set(var_name_zip firmware_${soc}_mdk_R9.8.zip)
61+ if(${soc} STREQUAL "ma2450")
62+ set(var_name_zip firmware_${soc}_759W.zip)
63+ endif()
64
65- find_file(${var_name} MvNCAPI-${soc}.mvcmd "${VPU_FIRMWARE_${soc_upper}}/mvnc")
66- if(NOT ${var_name})
67- message(FATAL_ERROR "[VPU] Missing ${soc} firmware")
68+ if(NOT DEFINED ${var_name_file})
69+ RESOLVE_DEPENDENCY(${var_name}
70+ ARCHIVE_UNIFIED ${var_name_zip}
71+ TARGET_PATH "${TEMP}/vpu/firmware/${soc}"
72+ ENVIRONMENT "${var_name}"
73+ FOLDER)
74+ find_file(${var_name_file} NAMES "MvNCAPI-${soc}.mvcmd" PATHS "${VPU_FIRMWARE_${soc_upper}}/mvnc" NO_CMAKE_FIND_ROOT_PATH)
75 endif()
76-endforeach()
77
78-#
79-# `vpu_copy_firmware` CMake target
80-#
81+ if(NOT ${var_name_file})
82+ message(FATAL_ERROR "[VPU] Missing ${soc} firmware, MvNCAPI-${soc}.mvcmd not found in ${VPU_FIRMWARE_${soc_upper}}/mvnc env $ENV{${var_name}} ")
83+ endif()
84
85-foreach(soc IN LISTS VPU_SUPPORTED_SOC)
86- string(TOUPPER "${soc}" soc_upper)
87- set(var_name VPU_FIRMWARE_${soc_upper}_FILE)
88+ debug_message(STATUS "${soc}=" ${${var_name_file}})
89
90 set(firmware_out_file "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/MvNCAPI-${soc}.mvcmd")
91 list(APPEND all_firmware_files ${firmware_out_file})
92@@ -57,9 +34,9 @@ foreach(soc IN LISTS VPU_SUPPORTED_SOC)
93 add_custom_command(
94 OUTPUT ${firmware_out_file}
95 COMMAND
96- ${CMAKE_COMMAND} -E copy ${${var_name}} ${firmware_out_file}
97- MAIN_DEPENDENCY ${${var_name}}
98- COMMENT "[VPU] Copy ${${var_name}} to ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}"
99+ ${CMAKE_COMMAND} -E copy ${${var_name_file}} ${firmware_out_file}
100+ MAIN_DEPENDENCY ${${var_name_file}}
101+ COMMENT "[VPU] Copy ${${var_name_file}} to ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}"
102 VERBATIM)
103 endforeach()
104