I am trying to build an image on a machine with only 8 GB of RAM. It seems setting PARALLEL_MAKE and BB_NUMBER_THREADS should allow reducing the concurrently run builds. Where do these settings fit in the NXP build process? I tried adding them to conf/local.conf and conf/bitbake.conf but got only a parse error in both cases.
Just an added note to what RenatoKiss suggested.
I think, you are using a 64bit Host OS. If you are using 32bit OS, you are going to get a sharp degradation of Yocto build speed. Moreover, you will not get the benefit of 8GB RAM even.
For BB_NUMBER_THREADS, the thumb rule is the maximum safe value = (number of real cores - 1).
firstname.lastname@example.org Thanks for advise. I read about it but I'd never tested it. I have being using 64b OS for a while.
Regarding the process number, it is personal definition. Yocto by default (without any config settings) will use the nproc value. In case you want to work while build, as in the question, reduce the number. If you want to speed up, try to increase and see if works for you (depends on cache size and other factors too).
Another trick is to have a local repository definition or simply leave the machine building at non-working hours ...
Thanks for you comment.
I believe your bottleneck is not RAM, 8GB seems to be ok for Yocto Build. Number of processor (real cores) and cache are the main offenders to Yocto performance as far as I know. Internet speed is also one good/bad factor at least in first build.
The right way is to set BB_NUMBER_THREADS and PARALLEL_MAKE as you wrote.
I had just checked and it worked for me. Just add this lines to your file [your_yocto_build_dir]/conf/local.conf
BB_NUMBER_THREADS = "2"
PARALLEL_MAKE = "-j 2"
And change the number 2 for the number that fits to your system. Remember, lower number slow down the Yocto building. Higher number increase Yocto build but can starve all other process in your machine.
After change local.conf, move to Yocto base dir and run command source setup-environment ./your_build_folder
Thanks a lot.
Hello Jonah Firchilt,
That’s correct. You would need to use double quotes around the value in all variable assignments in Yocto’s configuration files.
I would also change the PARALLEL_MAKE variable as Renato Kiss suggested, as it controls parallel compilation.