x-linux-ai: stai-mpu: don't pull in dependencies for unused packages

stai-mpu provides a common ML API for stm32mpu platforms, allowing applications
to use different inference frameworks without changing any code. Its packages
consist of pre-built libraries that are in charge of interfacing with the
three supported frameworks (tflite, onnx and openvx).

While it's possible to install only a subset of these libraries to limit the
supported frameworks on the target device, all libraries are packaged
unconditionally at build-time, pulling in the dependencies of all three
frameworks. In our case, this pulls in onnxruntime dependencies even though we
only install the tflite and openvx packages in our ccmp25 images. This tends to
cause out-of-memory errors when onnxruntime is built at the same time as other
large packages, such as opencv and wpewebkit.

Since most of these dependencies are already present at a higher level in the
x-linux-ai packagegroup recipes, remove them from the stai-mpu recipe and skip
the runtime dependency QA checks to be able to build the packages without their
respective frameworks. In the case of the ccmp25-dvk, this has no effect on the
final image contents, but it prevents onnxruntime from being built for no
reason.

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
This commit is contained in:
Gabriel Valcazar 2025-01-31 11:53:47 +01:00
parent 216cfd53e3
commit 637bb9dbbe
1 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,22 @@
# Copyright (C) 2025, Digi International Inc.
# Even if you choose not to install some of these packages, having them present
# in the recipe causes bitbake to always generate them, which pulls in a lot of
# spurious build-time dependencies. Since these dependencies are already in the
# higher level packagegroup recipes, remove them.
RDEPENDS:${PN}-tflite:remove = " \
${PYTHON_PN}-tensorflow-lite \
tensorflow-lite \
tflite-vx-delegate \
"
RDEPENDS:${PN}-ort:remove = " \
onnxruntime \
${PYTHON_PN}-onnxruntime \
"
# Removing ort/tflite runtime dependencies causes package QA errors because
# they contain prebuilt libraries that link to onnxruntime/tensorflow-lite.
# Skip the specific QA check causing the errors to be able to generate all
# packages regardless of whether you end up installing them or not.
INSANE_SKIP:${PN}-tflite:append = " file-rdeps"
INSANE_SKIP:${PN}-ort:append = " file-rdeps"