Skip to content

[POC] use compiled mesa host tools #10049

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

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

heitbaum
Copy link
Contributor

@heitbaum heitbaum commented May 11, 2025

With the builds increasing by ~1hr due to mesa:host tools needing to be compiled with panfrost, this proof of concept is the start of a toolchain to speed up the build process.

Initial version takes the 3 binaries from a GH repo and unpacks them into toolchain when mesa:host would need to be called.

things to work though:

  • flag if tools are to be built or downloaded
  • What if tools arent available - self build?
  • Use xzexe for the tools to allow distribution (this is currently the case)
  • GHA job to build the tools
  • What constitutes change and tools to be rebuilt

A little bit of experimentation has lead to the following files (for the mesa:host build.) The shared libraries are required only by mesa_clc when built normally, but if mesa:host is built with -Dshared-llvm=disabled then mesa_clc increases in size to 150M (36M xz compressed.) a saving of 60M (11M compressed). These are presently the only files generated by mesa:host. I have put the *.xzexe in https://github.com/heitbaum/mesa-host to this the POC further.

-rw-r--r-- 1 docker ubuntu  95711104 May  9 20:18 libclang-cpp.so.19.1
-rw-r--r-- 1 docker ubuntu  19603184 May  9 20:18 libclang-cpp.so.19.1.xz
-rw-r--r-- 1 docker ubuntu 103438152 May  9 20:00 libLLVM.so.19.1
-rw-r--r-- 1 docker ubuntu  26374492 May  9 20:00 libLLVM.so.19.1.xz
-rwxr-xr-x 1 docker ubuntu 155375080 May 10 06:19 mesa_clc
-rwxr-xr-x 1 docker ubuntu  54426713 May 10 06:31 mesa_clc.gzexe
-rwxr-xr-x 1 docker ubuntu  10805424 May 10 06:41 mesa_clc.shared-llvm
-rwxr-xr-x 1 docker ubuntu   2171836 May 10 06:41 mesa_clc.shared-llvm.xz
-rwxr-xr-x 1 docker ubuntu  36518736 May 10 06:19 mesa_clc.xz
-rwxr-xr-x 1 docker ubuntu  36519479 May 10 06:39 mesa_clc.xzexe
-rwxr-xr-x 1 docker ubuntu   9778192 May  9 20:22 panfrost_compile
-rwxr-xr-x 1 docker ubuntu   1725816 May 10 06:31 panfrost_compile.gzexe
-rwxr-xr-x 1 docker ubuntu   1306436 May  9 20:22 panfrost_compile.xz
-rwxr-xr-x 1 docker ubuntu   1307179 May 10 06:39 panfrost_compile.xzexe
-rwxr-xr-x 1 docker ubuntu   8225504 May  9 20:21 vtn_bindgen2
-rwxr-xr-x 1 docker ubuntu   1210581 May 10 06:31 vtn_bindgen2.gzexe
-rwxr-xr-x 1 docker ubuntu    911472 May  9 20:21 vtn_bindgen2.xz
-rwxr-xr-x 1 docker ubuntu    912215 May 10 06:39 vtn_bindgen2.xzexe
-rwxr-xr-x 1 docker ubuntu      5848 May 10 06:33 xzexe

@antonlacon
Copy link
Contributor

What if tools arent available - self build?

My thought is yes, with an optional flag that can go into .libreelec/options that can force an error on download failure instead. Maybe same flag to select whether it's built or downloaded to begin with.

I'm guessing $MACHINE_HARDWARE_NAME won't be specific enough and the mesa package.mk needs to override HOST_CFLAGS at some point as builds default to march=native.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants