Skip to content
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

fix parallel mode: add missing pkg dep & missing path creations #12485

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

udance4ever
Copy link
Contributor

@udance4ever udance4ever commented Sep 13, 2024

Two main categories:

  1. missing package dependency declarations
  2. missing directory paths

Gaps became apparent while debugging buildroot’s experimental PARALLEL_BUILD mode which uses PER_PACKAGE directories: https://pastebin.com/cLynrDqZ

Also verified these commits work for small builds like bcm2836

I am able to get both x86_64 and bcm2836 builds to completion (serial, only bcm2836 works in parallel, x86_64 is super close!)

@udance4ever udance4ever force-pushed the udance4ever/fix/dependencies branch 2 times, most recently from 25814bb to a41dc06 Compare September 14, 2024 04:54
@nadenislamarre
Copy link
Collaborator

some are strange,
python-pyxel can't required evmapy.

@nadenislamarre
Copy link
Collaborator

libglvnd depends on nvidia, so on an other package or at least on x86_64

@udance4ever
Copy link
Contributor Author

udance4ever commented Sep 14, 2024

thank you for taking the time to review the changes.

some are strange, python-pyxel can't required evmapy.

you’re right - I fixed it so it doesn’t depend on evmapy - it was the evmapy path that needs to be created if it doesn’t exist (the 2nd major class of changes)

libglvnd depends on nvidia, so on an other package or at least on x86_64

is there a change that needs to happen here?

just completed a parallel build using these .mk/Config.in files for bcm2836 last night - all packages compiled (except for mangohud and fixed this just now).

Firing off a clean build (I clobbered my build during finalization by accident) and will do x86_64 after that.

@nadenislamarre
Copy link
Collaborator

@dmanlfc when back, can you read this pr too please, you'll be a better feedback than me

@nadenislamarre
Copy link
Collaborator

mainly on libglvnd, i've a doubt on the test to do, even if x86_64 should do the job

@udance4ever
Copy link
Contributor Author

udance4ever commented Sep 14, 2024

bcm2836 parallel clean build 67 min (w ccache). final images in 86 min. M1 MBP 16GB to external NVMe (not Thunderbolt)

firing off x86_64 parallel build in the background.

@nadenislamarre
Copy link
Collaborator

you manage to make buildroot parallel mode working with batocera ?

@udance4ever
Copy link
Contributor Author

udance4ever commented Sep 14, 2024

you manage to make buildroot parallel mode working with batocera ?

yes, i like torturing myself :)

what happened is when I starting learning how to build - I used parallel build mode not knowing it was broken. so i’ve been getting to bottom of what breaks it.

I’ll have to benchmark with a zeroed out ccache, it is probably ~4.5h (dl already downloaded, pre-finalize) to build all the code for bcm2836. all 8 cores stay nicely slammed.

@nadenislamarre
Copy link
Collaborator

it would be wonderfull if we could merge to parallel builds
i wait dman however, he masterize a lot builds and dependancies

@udance4ever udance4ever force-pushed the udance4ever/fix/dependencies branch 2 times, most recently from fd510b0 to 0edfab4 Compare September 14, 2024 20:10
@udance4ever udance4ever changed the title add missing package dependencies and missing directories fix parallel mode: add missing pkg dep & missing path creations Sep 14, 2024
@udance4ever
Copy link
Contributor Author

udance4ever commented Sep 15, 2024

ok - long story short, I can only get parallel builds to work for bcm2836.

when I try to build the same codebase and target x86_64, the build finishes and Batocera boots (I can ssh in just fine) but the ES interface doesn’t initialize correctly (photo I posted to Discord w the white squares)

For my own sanity, I’m building x86_64 in serial mode on the same exact codebase so I’m 100% sure it is the parallelization that is introducing some weird artifact.

Given the number of SBCs we support, it’ll still be nice if all the SBC builds were parallelizable.

I don’t have any other SBC hardware to test this theory on unfortunately so hope the rest of crew can help test this out.

@nadenislamarre
Copy link
Collaborator

where in discord, i don't see it ?

@nadenislamarre
Copy link
Collaborator

do you have a pr to enable parallel builds ? i don't remember exactly what to do

@udance4ever
Copy link
Contributor Author

udance4ever commented Sep 15, 2024

ok - the jury’s in. I finished a serial build with the exact same config and codebase and it boots properly and ES initializes correctly. this is good news but a bit of a bummer parallel builds are only restricted to boards like bcm2836 for now.

I have two complete build directories side-by-side if anyone has suggestions on what to compare.

where in discord, i don't see it ?

I don’t see a way to link to a message in Discord. here’s the photo:

IMG_2515

do you have a pr to enable parallel builds ? i don't remember exactly what to do

happy to file a PR if it makes a difference. I jumped into this not intending to get parallel builds to work - I was just trying to get my first build to work so getting the bcm2836 parallel build working was a side effect :)

udance4ever pushed a commit to udance4ever/batocera.linux that referenced this pull request Sep 15, 2024
- merges missing dependency declarations in *.mk & Config.in (batocera-linux#12485)
- use udance4ever/batocera.buildroot fork
- merges DIRECT_BUILD (batocera-linux#12470), Makefile cleanup (batocera-linux#12477) and %-upgrade fix (batocera-linux#12487)
- add *~ (emacs/mg) to .gitignore
- checks in localization files (.po)
@nadenislamarre
Copy link
Collaborator

i have an idea for this one.
one package is providing xinitrc,
one of bacera too.
/etc/X11/xinit/xinitrc or something like it

the original xinitrc open 3 terms like in your capture
the batocera one opens emulationstation.

this one
package/batocera/emulationstation/batocera-emulationstation/xorg/xinitrc
just replace the file and it should fix.
and in .mk we should do something to not copy the original one

@dmanlfc
Copy link
Collaborator

dmanlfc commented Sep 17, 2024

Please mark as draft until completion. ibglvnd is not x86 exclusive. Therefore change the logic to add the dependency if package BR2_PACKAGE_XORG7 is selected.

I also see dependencies being added to the .mk files but not the corresponding Config.in for packages. Please ensure they're in sync.

Finally squash the commits and force update accordingly as you work through the draft so it's one commit, thanks.

@udance4ever udance4ever deleted the udance4ever/fix/dependencies branch September 18, 2024 01:01
@udance4ever
Copy link
Contributor Author

udance4ever commented Sep 19, 2024

Please mark as draft until completion.

whoops - my bad - I didn’t realize renaming a branch ends up closing a PR. reopening as draft.

libglvnd is not x86 exclusive. Therefore change the logic to add the dependency if package BR2_PACKAGE_XORG7 is selected.

thanks for the direction - I just noticed bcm2836 didn’t need it so this explains why.

I also see dependencies being added to the .mk files but not the corresponding Config.in for packages. Please ensure they're in sync.

ok - I’ll clean this up. Any insight why buildroot complains about missing selects and other times doesn’t?

Finally squash the commits and force update accordingly as you work through the draft so it's one commit, thanks.

I debated whether or not to do this and intentionally left them atomic so you could follow new changes I discovered as I was debugging the x86_64 build further. (all the reason for this to be a draft branch). I will squash my commits before pulling my pull request out of draft if this is okay.

and just for the record, I’ve reached out to the developer of the br-pbuilder project as he has figured out how to do parallel builds without per-package directories. If it actually works, it might be the key to getting our x86_64 build parallelized as I don’t understand how to get to the root of why parallelism introduces the glitch in the photo above.

@udance4ever udance4ever restored the udance4ever/fix/dependencies branch September 19, 2024 23:40
@udance4ever udance4ever reopened this Sep 19, 2024
@udance4ever udance4ever marked this pull request as draft September 19, 2024 23:44
@udance4ever udance4ever force-pushed the udance4ever/fix/dependencies branch from 928d06e to 8d34542 Compare September 20, 2024 00:44
@udance4ever
Copy link
Contributor Author

udance4ever commented Sep 20, 2024

@dmanlfc made changes you requested. Buildroot isn’t happy about syncing Config.in and .mk files (though I totally agree with you this should be done!) - it complains about 3 classes of errors:

  1. circular dependencies
  2. BR2_PACKAGE_GSTREAMER1 is unselected
  3. vkd3d-proton - BR2_PACKAGE_HOST_ZSTD

https://pastebin.com/a7pD6CTg

I’m not surprised about the 2nd class - I had to create a .patch file for webkitgtk to disable using gstreamer1 so v41-dev would build without errors:

https://github.com/udance4ever/batocera.buildroot/blob/udance4ever/workaround/webkitgtk-transcoder/package/webkitgtk/0002-GStreamerDefinitions-disable-USE_GSTREAMER_TRANSCODER.patch

3rd class we can ignore for now as this appears related to ironing out wine build on aarch64

it’s the 1st class (circular dependencies) I’m not clear how we go about resolving.

- fix mangohud dep
- fix python-pyxel to create evmapy dir if it doesn't exist
- vkd3d-proton: host-zstd
-- force buildroot to build host-zstd before extracting vkd3d-proton
- cabextract: dep libmspack
- batocera-wine: create xorg.conf.d path
- libretro-wasm4: dep on libxkbcommon (x86_64)
- libretro-play: dep libglu (x86_64)
- snes9x: dep sdl2 (x86_64)
- libglvnd if BR_PACKAGE_XORG7
- ensure Config.in and .mk are in sync
- grim: dep jpeg-turbo (bcm2836)
@udance4ever udance4ever force-pushed the udance4ever/fix/dependencies branch from 8d34542 to c7bad58 Compare September 21, 2024 16:03
@dmanlfc
Copy link
Collaborator

dmanlfc commented Oct 10, 2024

looking good, how are you tracking?

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

Successfully merging this pull request may close these issues.

3 participants