topology: cmake: build topologies in parallel, add -s to force sequen… - #11119
Open
ujfalusi wants to merge 1 commit into
Open
topology: cmake: build topologies in parallel, add -s to force sequen…#11119ujfalusi wants to merge 1 commit into
ujfalusi wants to merge 1 commit into
Conversation
ujfalusi
requested review from
dbaluta,
kv2019i,
lbetlej,
lgirdwood,
mmaka1,
plbossart and
ranj063
as code owners
August 25, 2026 07:01
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enables parallel topology builds by default while adding an opt-in sequential debugging mode.
Changes:
- Makes topology command serialization conditional.
- Adds
TPLG_SEQUENTIAL_BUILDand thebuild-tools.sh -soption. - Supports updating existing build trees.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Summary | Final comments |
|---|---|---|
tools/topology/CMakeLists.txt |
Controls topology build parallelism. | None |
scripts/build-tools.sh |
Adds sequential-build configuration and CLI handling. | Document -s in scripts/README.md (nit, 2 votes). Reset the cached option when -s is omitted (moderate, 4 votes). |
Suppressed comments (1)
tools/topology/CMakeLists.txt:8
- The new public build control is missing from the repository's existing topology documentation:
scripts/README.md:45-55lists thebuild-tools.shoptions but omits-s, andtools/topology/README.md:14-22does not explain the sequential/parallel CMake option. Please update those READMEs so users can discover and understand this behavior.
option(TPLG_SEQUENTIAL_BUILD "Build topologies one at a time (for debugging)" OFF)
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+28
to
+29
| -s Force sequential (one at a time) topology builds, for debugging. | ||
| Normally topologies build in parallel with -j "$NO_PROCESSORS". |
Comment on lines
+169
to
+172
| # -s must apply even to an already configured, incremental build tree. | ||
| if [ "$TPLG_SEQUENTIAL_BUILD" = ON ]; then | ||
| update_sequential_build_option | ||
| fi |
ujfalusi
force-pushed
the
peter/pr/parallel-tplg-build
branch
from
August 25, 2026 07:14
bd98ca2 to
04a133f
Compare
…tial alsatplg custom commands were marked USES_TERMINAL. With the Ninja generator this places them in the single-job "console" pool, which serializes every topology build regardless of the -j value passed to ninja. Building all 579 topologies therefore never used more than one core, even on a many-core machine. Drop USES_TERMINAL by default so Ninja can run alsatplg invocations in parallel, controlled by a new TPLG_SEQUENTIAL_BUILD CMake option (default OFF). Add a -s flag to build-tools.sh that sets TPLG_SEQUENTIAL_BUILD=ON, to restore the old, easier to debug one-at-a-time behavior when needed. It updates the CMake cache in place, so it also works on an existing incremental build tree without deleting it. Results Sequential (before this patch or with -T -s with this patch): ./scripts/build-tools.sh -T -s 19.30s user 2.34s system 99% cpu 21.817 total Parallel: rm -rf tools/build_tools; time ./scripts/build-tools.sh -T ./scripts/build-tools.sh -T 33.79s user 3.52s system 986% cpu 3.783 total The build time changes from ~22s to ~4s Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
ujfalusi
force-pushed
the
peter/pr/parallel-tplg-build
branch
from
August 25, 2026 07:15
04a133f to
fa711da
Compare
Contributor
Author
|
Changes since v1:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…tial
alsatplg custom commands were marked USES_TERMINAL. With the Ninja generator this places them in the single-job "console" pool, which serializes every topology build regardless of the -j value passed to ninja. Building all 579 topologies therefore never used more than one core, even on a many-core machine.
Drop USES_TERMINAL by default so Ninja can run alsatplg invocations in parallel, controlled by a new TPLG_SEQUENTIAL_BUILD CMake option (default OFF).
Add a -s flag to build-tools.sh that sets TPLG_SEQUENTIAL_BUILD=ON, to restore the old, easier to debug one-at-a-time behavior when needed. It updates the CMake cache in place, so it also works on an existing incremental build tree without deleting it.
Results
Sequential (before this patch or with -T -s with this patch): ./scripts/build-tools.sh -T -s 19.30s user 2.34s system 99% cpu 21.817 total
Parallel:
rm -rf tools/build_tools; time ./scripts/build-tools.sh -T ./scripts/build-tools.sh -T 33.79s user 3.52s system 986% cpu 3.783 total
The build time changes from ~22s to ~4s