How can I reduce the number of parallel yocto builds?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How can I reduce the number of parallel yocto builds?

35,472 Views
jonah_firchilt
Contributor I

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.

Tags (1)
6 Replies

35,153 Views
dibyajyoti
Contributor II

Hi jonah_firchilt

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).

Best Regards,

Dibyajyoti

35,153 Views
renato_kiss
NXP Employee
NXP Employee

dibyajyoti@alumnux.com 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. 

Regards,

Renato Kiss

0 Kudos
Reply

35,152 Views
renato_kiss
NXP Employee
NXP Employee

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.

BR,

Renato Kiss

0 Kudos
Reply

35,152 Views
renato_kiss
NXP Employee
NXP Employee

Hi jonah_firchilt,

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.

Regards,

Renato Kiss

35,152 Views
jonah_firchilt
Contributor I

Thanks! I had tried BB_NUMBER_THREADS = 1 but apparently it requires a string.

35,153 Views
gusarambula
NXP TechSupport
NXP TechSupport

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.

Regards,

0 Kudos
Reply