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

detect CPU cores count and utilize while building project #88

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

egisz
Copy link
Contributor

@egisz egisz commented Aug 4, 2021

Description:

Improve build speed. Detect core count and set accordingly cmake and make command line params.

Checklist:

  • [X ] The code change is tested and works locally.

@icecube45
Copy link
Member

Might not be a great idea on pi systems with lower memory (especially with memory split applied), where they lack the memory to properly support the multicore compilation

@egisz
Copy link
Contributor Author

egisz commented Aug 4, 2021

I agree, but still it could be beneficial for ones who have more RAM.
It's possible to detect RAM size and limit cores to 2 in case it's < 4GB.

$free -g | grep "Mem:" | awk '{print $2}'

returns RAM size in GB.

What do you think?

@icecube45
Copy link
Member

Detection of RAM is a good idea, but I'd adjust the parameters. Personally on my Pi (1GB), I compile with one thread, otherwise there's a chance it freezes up due to memory constraints. Others can chime in here, but I'd adjust the parameters to 1 thread if <1GB

@stefan-sherwood
Copy link
Collaborator

I would try compiling it with different threading options and measure the high water mark for memory consumption and adjust the script accordingly.

Now that my change to not require an extreme memory split has been merged, we can probably change the default for everyone.

@rsjudka rsjudka mentioned this pull request Aug 27, 2021
@memtech3
Copy link
Contributor

What about making it an interactive option in the install script that defaults to no after 5 seconds with a note not to use it on INSERT SPECS THAT DON'T WORK HERE? Or maybe have it as part of a separate install script?

@akhil11naseem
Copy link

This would be useful when cross-compiling for the Pi on a different host (I cross-compile on WSL2 on Windows).

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.

6 participants