Search code examples
memoryyoctoopenembedded

How to add more threads when building?


When doing

bitbake core-image-xxxx

the build task will auto select 8 threads (since my CPU has 8 cores) to build the image.

My system has 72GB RAM, can I force bitbake to run with more threads?

Or any way to ask bitbake to use more RAM?


Solution

  • To increase threads usage: You add following to your local.conf inside the build/conf directory. Replace x and y with your wanted configuration

    PARALLEL_MAKE = "-j x"
    
    BB_NUMBER_THREADS = "y"
    

    PARALLEL_MAKE defines how many threads should be used when using make -j command during do_compile.

    BB_NUMBER_THREADS defines number of threads for bitbake.

    I do not know about increasing memory usage, if you want to increase the speed of the build you could to it with a ramdisk. https://www.linuxbabe.com/command-line/create-ramdisk-linux

    https://docs.yoctoproject.org/dev-manual/speeding-up-build.html