-
Notifications
You must be signed in to change notification settings - Fork 178
recipes-ml: Add recipe for QAIRT SDK #1412
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
koenkooi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: there's no such thing as 'Yocto recipes', it's either 'bitbake recipes' or 'OE recipes'.
| def platform_dir(d): | ||
| sdk_lib_dir = d.getVar("S", True) + "/lib/" | ||
| if os.path.exists(sdk_lib_dir) and os.path.isdir(sdk_lib_dir): | ||
| dir_prefix = "aarch64-oe-linux-gcc" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't hardcode TARGET_VENDOR to '-oe' here, it will break on any distro that sets it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The folder names such as aarch64-oe-linux-gcc* come directly from the upstream SDK ZIP.
These directories are not generated by us and are not derived from TARGET_VENDOR.
They are fixed names in the binary SDK delivered externally.
The SDK ships multiple target‑specific folders, for example:
aarch64-android
aarch64-oe-linux-gcc8.2
aarch64-oe-linux-gcc9.3
aarch64-oe-linux-gcc11.2
aarch64-ubuntu-gcc9.4
aarch64-windows-msvc
android
arm64x-windows-msvc
x86_64-linux-clang
x86_64-windows-msvc
Since these names are SDK‑defined, the recipe must select and install the correct library folder based on the target we are building for.
What approach would you recommend for selecting the appropriate SDK directory based on the target?
| cp -r ${S}/bin/${PLATFORM_DIR}/* ${D}/${bindir} | ||
| } | ||
|
|
||
| INHIBIT_PACKAGE_STRIP = "1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a comment why these are needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated with the comments.
|
|
||
| INSANE_SKIP_${PN} += "arch" | ||
|
|
||
| SOLIBS = ".so" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This and all the lines below need extensive comments in the recipe itself explaining why the defaults don't work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated with the comments.
lumag
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commit message doesn't exist. It must.
| @@ -0,0 +1,66 @@ | |||
| LICENSE = "Proprietary" | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. Please define and/or provide more exact licence.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The SDK can be downloaded from:
https://softwarecenter.qualcomm.com/api/download/software/sdks/Qualcomm_AI_Runtime_Community/All/2.41.0.251128/v2.41.0.251128.zip
The corresponding license file is located at:
${UNPACKDIR}/qairt/${PV}/LICENSE.pdf
Given that the license is explicitly provided within the SDK, what would you recommend using as the LICENSE value instead of Proprietary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Define new non-generic licence type, see NO_GENERIC_LICENSE. Also please add licence in the text format.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current SDK does not include the license in a plain text format. I’ve raised this issue with the QAIRT team, but even if they decide to add a .txt version, it will only come in their next release, which may take 1–2 months.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This license seems to be AI specific, so won't be LICENSE.qcom and LICENSE.qcom-2, needs to be yet another license for qualcomm, specific to AI.
|
|
||
| HEXAGON_VERSION = "v68" | ||
| HEXAGON_VERSION:qcs9100 = "v73" | ||
| HEXAGON_VERSION:qcs8300 = "v75" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. Please see how it's done for FastRPC. No target-specific packages are allowed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In our case, the SDK we are integrating ships multiple prebuilt, mutually exclusive, target‑specific library directories, such as:
hexagon-v66
hexagon-v68
hexagon-v69
hexagon-v73
hexagon-v75
hexagon-v79
hexagon-v81
Since only one of these is valid for the target we are building for, the recipe does need some logic to select the correct directory otherwise we install the wrong binaries.
Given this, could you please suggest what the recommended approach should be for selecting the correct SDK directory?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I wrote, please see how it's handled by the FastCV
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ugh, In my first message I wrote FastRPC instead of FastCV. Sorry for the confusion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| PACKAGES += "\ |
In the FastCV recipe, they create several target‑specific packages and assign the corresponding files to each one. Can you confirm whether this same approach is expected for the qairt hexagon libraries as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. We are working with FastRPC to implement loading of system-specific Hexagon libraries in a generic way, but until that's implemented the set of small packages is a correct way to handle QAIRT.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Each target has its corresponding hexagon architecture and the libs should be installed based on that.
So, i was planning to package these libs based on the Hexagon architecture and have the install directories and package names based on the hexagon architecture.
But i’ve noticed that in fastcv and the hexagon-dsp-binaries the package names and installation paths include the target device names.
Should I follow the exact same convention of using the target‑based install paths and package naming, or is it preferable to adopt the Hexagon‑architecture‑based packaging approach instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, what happens with your approach next time the customer asks to have a single rootfs which works on a variety of devices (they do)?
So, it's not possible to have just a single set of Hexagon libs in a rootfs. We are trying to solidify a good solution for the co-installing device-independent libs. However for now the best course of action is to install those libs into a device-specific location (as it will be looked into by the FastRPC anyway).
|
|
||
| do_install() { | ||
| install -d ${D}/${includedir} | ||
| install -d ${D}/${libdir}/rfsa/adsp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This dir is going to be ignored by FastRPC daemon
| INSANE_SKIP:${PN}-dev += "already-stripped" | ||
| INSANE_SKIP:${PN}-dbg += "already-stripped" | ||
|
|
||
| INSANE_SKIP_${PN} += "arch" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Split Hexagon to separate packages. Moreover this line won't work, if I'm not mistaken.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will update this based on the packaging of the hexagon libs.
07bce4a to
f803949
Compare
|
Still no commit message, please expand explaining why this recipe is getting included and the scope of QAIRT SDK. |
| LICENSE = "Proprietary" | ||
| LIC_FILES_CHKSUM = "file://LICENSE.pdf;md5=878b885995f453e328edbcd5a1302306" | ||
|
|
||
| SUMMARY = "QAIRT-SDK" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not really a summary, please extend.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the description needs to move to summary and that part needs to be more descriptive ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have updated the summary and description.
|
I'm not familiar with this SDK, but it is quite huge, containing multiple pre-built libraries for multiple targets, can you extend why we need to include this SDK? Who are the users, why we need it integrated in meta-qcom and so on. Integrating entire proprietary-base SDKs in yocto is not that common. |
| FILES_SOLIBSDEV = "" | ||
|
|
||
| # Include non standard library paths. | ||
| FILES:${PN} += "${libdir}/*" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't non-standard library path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This ensures that the Hexagon libraries installed under ${libdir}/rfsa/adsp are packaged.
The final install path for these libraries is still under discussion. If we later move to
device‑specific packages with their own Hexagon library sets, the corresponding FILES
entries will be added there and this entry can be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sorry, it's not. ${libdir}/rfsa/adsp is unsupported and must be dropped.
| INHIBIT_PACKAGE_STRIP = "1" | ||
| INHIBIT_PACKAGE_DEBUG_SPLIT = "1" | ||
| INSANE_SKIP:${PN} += "already-stripped" | ||
| INSANE_SKIP:${PN}-dev += "already-stripped" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is in -dev that is already stripped?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dev package only contains the header files and the dbg is empty. Removed the suppression for dev and dbg packages.
|
@ricardosalveti , I have enhanced the commit message and the description. We contribute to Qualcomm’s IMSDK, which is also planned to be added to meta‑qcom. Several applications within the IMSDK rely on the QAIRT SDK, enabling users to run end‑to‑end Machine Learning use‑cases alongside multimedia workflows on Qualcomm devices. |
Add recipe for QAIRT SDK, which provides the tools, runtimes, and model‑execution components required to enable Machine Learning use‑cases on Qualcomm devices. This integration supports efficient inference across CPU, GPU, and NPU/HTP accelerators, while also enabling the development of ML applications, including those incorporated within Qualcomm’s IMSDK. Signed-off-by: Tushar Patra Jamula <tjamula@qti.qualcomm.com>
This PR adds a new bitbake recipe for integrating the QAIRT SDK (v2.41.0.251128) into the build system.
These are pre built binaries and more information about the SDK can be found at : QAIRT overview