Message ID | 20250819-mesa-libclc-panfrost-v5-0-b8b89e6af908@cherry.de |
---|---|
Headers | show |
Series | mesa: lighten up target's libclc dependencies and fix panfrost support | expand |
Hi Quentin, Thanks for your patch. It looks like this is causing some issue: ERROR: libepoxy-native-1.5.10-r0 do_prepare_recipe_sysroot: The file /usr/share/drirc.d/00-mesa-defaults.conf is installed by both mesa-native and mesa-tools-native, aborting ERROR: libsdl2-native-2.32.8-r0 do_prepare_recipe_sysroot: The file /usr/share/drirc.d/00-mesa-defaults.conf is installed by both mesa-native and mesa-tools-native, aborting https://autobuilder.yoctoproject.org/valkyrie/#/builders/73/builds/2135 https://autobuilder.yoctoproject.org/valkyrie/#/builders/63/builds/2073 Can you have a loot at it please? Best regards, Mathieu
On Tue, Aug 19, 2025 at 10:16:00AM +0200, Quentin Schulz wrote: > @Otavio, can I add the new mesa-tools-native recipe under your > maintainership in meta/conf/distro/include/maintainers.inc, it is after > all still mesa? > > Panfrost support has been broken for a while already because it now > requires libclc which isn't enforced by default. This fixes this > oversight. > > While re-adding support for panfrost, the build time for libclc were a > bit too much to my taste and I tried to figure out if we could lighten > up the dependencies for the target recipe and it seems to be the case. > > libclc brings very expensive dependencies such as llvm and clang. > Building clang and llvm for each target architecture is very expensive, > but mesa allows to depend on prebuilt host binaries (mesa-clc and > precomp-compiler). Those are built by mesa as well, but can be compiled > in mesa-native instead of mesa, making the dependency expensive but only > once regardless of the number of target architectures to build for. > Ideally the mesa-clc and precomp-compiler would only be compiled in > mesa-native if target mesa requires libclc support, however this is not > possible as a target recipe cannot impact or depend on a native recipe's > configuration. We thus have two choices, always build libclc in > mesa-native with its heavy dependencies and impact every build or force > the user to modify the mesa-native recipe in a custom layer (as a native > recipe cannot use target's OVERRIDES). The latter is unacceptable so the > former seems to be the only option. Another big downside is that > mesa-native currently builds drivers (amd, nouveau, svga) which we may > have absolutely no interest in building, increasing the build time and > possibly dependencies list). > > A third choice is to spin-off the native mesa recipe with libclc support > into a new recipe without drivers and only what's necessary to build > mesa-clc and precomp-compiler binaries. > This allows to keep a "clean" mesa-native recipe for whoever needs those > drivers built-in (e.g. for testing, for qemu-native, or whatever else) > and only bring the libclc dependency when required by the target recipe. > > Because libclc is now only built for the host, opencl support now needs > to explicitly bring libclc and others to build as libclc won't bring it > in the build environment anymore. > > Note that this was essentially only build tested (run tested on RK3588 > with panfrost though). > > I tried to enable OpenCL support but it triggers a buildpaths QA error, > which can be worked around with the following patch: A much easier fix would be the following. Please consider incorporating it. diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc index d38f96429ceb..ab1290dfbb84 100644 --- a/meta/recipes-graphics/mesa/mesa.inc +++ b/meta/recipes-graphics/mesa/mesa.inc @@ -127,7 +127,7 @@ PACKAGECONFIG[egl] = "-Degl=enabled, -Degl=disabled" # "opencl" also requires gallium-llvm to be present in PACKAGECONFIG! # Be sure to enable it for the target and for the native build. -PACKAGECONFIG[opencl] = "-Dgallium-rusticl=true, -Dgallium-rusticl=false, bindgen-cli-native libclc spirv-tools spirv-llvm-translator" +PACKAGECONFIG[opencl] = "-Dgallium-rusticl=true -Dmesa-clc-bundle-headers=enabled, -Dgallium-rusticl=false, bindgen-cli-native libclc spirv-tools spirv-llvm-translator" PACKAGECONFIG[broadcom] = "" PACKAGECONFIG[etnaviv] = ",,python3-pycparser-native"