ort-qnn: Build onnxruntime QNN Execution Provider plugin v2.4.0 - #2837
ort-qnn: Build onnxruntime QNN Execution Provider plugin v2.4.0#2837pratikpachange97 wants to merge 1 commit into
Conversation
Test Results 79 files + 11 409 suites +90 7h 23m 21s ⏱️ + 2h 2m 43s For more details on these failures, see this check. Results for commit 076f089. ± Comparison against base commit 9597e0b. ♻️ This comment has been updated with latest results. |
| # Fix buildpaths QA issue: remap TMPDIR references in both debug info and | ||
| # string literals embedded in the compiled libraries. | ||
| CFLAGS:append = " -ffile-prefix-map=${WORKDIR}=. -ffile-prefix-map=${S}=. -ffile-prefix-map=${B}=." | ||
| CXXFLAGS:append = " -ffile-prefix-map=${WORKDIR}=. -ffile-prefix-map=${S}=. -ffile-prefix-map=${B}=." |
There was a problem hiding this comment.
I think these are already set via DEBUG_PREFIX_MAP. Are OECMAKE flags being overridden by the project?
There was a problem hiding this comment.
DEBUG_PREFIX_MAP is set as follows
DEBUG_PREFIX_MAP="-fcanon-prefix-map -ffile-prefix-map=/local/mnt/workspace/mainline/build/tmp/work/cortexa53-qcom-linux/onnxruntime-qnn/2.4.0/sources/onnxruntime-qnn-2.4.0=/usr/src/debug/onnxruntime-qnn/2.4.0 -ffile-prefix-map=/local/mnt/workspace/mainline/build/tmp/work/cortexa53-qcom-linux/onnxruntime-qnn/2.4.0/build=/usr/src/debug/onnxruntime-qnn/2.4.0 -ffile-prefix-map=/local/mnt/workspace/mainline/build/tmp/work/cortexa53-qcom-linux/onnxruntime-qnn/2.4.0/recipe-sysroot= -ffile-prefix-map=/local/mnt/workspace/mainline/build/tmp/work/cortexa53-qcom-linux/onnxruntime-qnn/2.4.0/recipe-sysroot-native= "
Here -ffile-prefix-map=${WORKDIR}=. is missing in the DEBUG_PREFIX_MAP
If I remove these flags I am getting following error
ERROR: onnxruntime-qnn-2.4.0-r0 do_package_qa: QA Issue: File /usr/lib/.debug/libonnxruntime_providers_qnn.so in package onnxruntime-qnn-dbg contains referenc
e to TMPDIR [buildpaths]
Following flags are required to resolve this error
CFLAGS:append = " -ffile-prefix-map=${WORKDIR}=."
CXXFLAGS:append = " -ffile-prefix-map=${WORKDIR}=."
Should I update these flags as above ?
There was a problem hiding this comment.
What is not being handled? Which paths are left uncovered by OE classes?
There was a problem hiding this comment.
-ffile-prefix-map=/local/mnt/workspace/mainline/build/tmp/work/cortexa53-qcom-linux/onnxruntime-qnn/2.4.0=.
There was a problem hiding this comment.
What is the path embedded in binary? WORKDIR in this case is /local/mnt/workspace/mainline/build/tmp/work/cortexa53-qcom-linux/onnxruntime-qnn/2.4.0 so unless the path embedded is specifically only WORKDIR, which is unlikely, it should already be covered.
Usually, it's a problem when the project is overriding these flags passed by OE. In this case, it might be overriding CMAKE_C*_FLAGS.
There was a problem hiding this comment.
The project is not overriding the flags
It seems the issue is due the git://github.com/dcleblanc/SafeInt.git source fetched to ${WORKDIR}/sources/safeint
The libonnxruntime_providers_qnn.so extracted from onnxruntime-qnn-dbg-2.4.0-r0.cortexa53.rpm has DWARF directory-table entry ./sources/safeint
OE's built-in DEBUG_PREFIX_MAP only remaps ${S} and ${B}
DEBUG_PREFIX_MAP="-fcanon-prefix-map -ffile-prefix-map=/local/mnt/workspace/mainline/build/tmp/work/cortexa53-qcom-linux/onnxruntime-qnn/2.4.0/sources/onnxruntime-qnn-2.4.0=/usr/src/debug/onnxruntime-qnn/2.4.0 -ffile-prefix-map=/local/mnt/workspace/mainline/build/tmp/work/cortexa53-qcom-linux/onnxruntime-qnn/2.4.0/build=/usr/src/debug/onnxruntime-qnn/2.4.0
It has no entry for ${WORKDIR}/sources/safeint.
So I guess adding
CFLAGS:append = " -ffile-prefix-map=${WORKDIR}=."
CXXFLAGS:append = " -ffile-prefix-map=${WORKDIR}=."
is helping to fix this QA failure
There was a problem hiding this comment.
Thank you for checking. In that case, I think adding this would resolve this:
--- a/dynamic-layers/ai/recipes-ml/onnxruntime-qnn/onnxruntime-qnn_2.4.0.bb
+++ b/dynamic-layers/ai/recipes-ml/onnxruntime-qnn/onnxruntime-qnn_2.4.0.bb
@@ -16,7 +16,7 @@ DEPENDS = " \
"
SRC_URI = "git://github.com/onnxruntime/onnxruntime-qnn.git;protocol=https;nobranch=1;tag=v${PV};name=ort-qnn \
- git://github.com/dcleblanc/SafeInt.git;protocol=https;nobranch=1;name=safeint;tag=3.0.28;destsuffix=safeint \
+ git://github.com/dcleblanc/SafeInt.git;protocol=https;nobranch=1;name=safeint;tag=3.0.28;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/safeint \
file://0001-cmake-Rename-pkg-config-output-to-libonnxruntime_pr.patch \
"
@@ -49,7 +49,7 @@ EXTRA_OECMAKE = " \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_FIND_ROOT_PATH=${STAGING_DIR_TARGET} \
-DFETCHCONTENT_FULLY_DISCONNECTED=ON \
- -DFETCHCONTENT_SOURCE_DIR_SAFEINT=${UNPACKDIR}/safeint \
+ -DFETCHCONTENT_SOURCE_DIR_SAFEINT=${S}/safeint \
-DONNX_CUSTOM_PROTOC_EXECUTABLE=${STAGING_BINDIR_NATIVE}/protoc \
-Donnxruntime_BUILD_SHARED_LIB=ON \
-Donnxruntime_BUILD_UNIT_TESTS=OFF \
There was a problem hiding this comment.
I checked this in my local build as well and it works for me.
d734912 to
cd679a5
Compare
Koen Kooi (koenkooi)
left a comment
There was a problem hiding this comment.
This is very close to the onnxruntime recipe in meta-ai and it seems to need the same fixes. Looks good enough to me.
QNN EP is a standalone ABI-stable plugin execution provider that brings Qualcomm hardware acceleration to ONNX Runtime. Starting with v2.0.0, the QNN EP ships as a standalone shared library built on the Execution Provider ABI. The plugin is registered at runtime and only links against the standard ONNX Runtime shared library. Signed-off-by: Pratik Pachange <ppachang@qti.qualcomm.com>
cd679a5 to
076f089
Compare
Anuj Mittal (anujm1)
left a comment
There was a problem hiding this comment.
Even without the change, looks good to me.
QNN EP is a standalone ABI-stable plugin execution provider that brings Qualcomm hardware acceleration to ONNX Runtime. Starting with v2.0.0, the QNN EP ships as a standalone shared library built on the Execution Provider ABI. The plugin is registered at runtime and only links against the standard ONNX Runtime shared library.
Added collection name "ai" and corresponding filename pattern and layer.conf for this recipe file as it depends on meta-ai layer.