Build AOSP impossible with CPU stuck at 300% or more

419 views
Skip to first unread message

Fabien Brisset

unread,
Jan 20, 2021, 10:37:06 AM1/20/21
to Android Building
Hi, 

I'm working on Linux Mint with a Dell computer with an Intel Core i5-7200 and 16 Go of RAM. I downloaded AOSP into my external SSD drive and working on it but when I tried the codelab for AOSP website, when I launch "m" command for build with eoither -j1 or -j4 options, the process "soong_build" consumes up to 300% of my CPU and froze my computer. I'm in no capability to retrieve my interface or my terminal and then forced to hard reset the computer. I have been searching through the web without success and the page about hardware requirements does not speak about processor. 

Can someone help me ? or give me some hints to be able to build AOSP ? 

Thanks and regards

Fabien Brisset

Andrii Chepurnyi

unread,
Jan 21, 2021, 11:08:26 AM1/21/21
to Android Building
Hello,

Please check swap on your system (is it enabled or not?). If it is not enabled create it with RAMx2 size.
You should be able to build it with -j2 or -j4 (but it will take a lot of time with such CPU).

Regards,

среда, 20 января 2021 г. в 17:37:06 UTC+2, fbri...@gmail.com:

Kevin Keller

unread,
Jan 21, 2021, 11:08:27 AM1/21/21
to android-...@googlegroups.com
That computer should be able to build Android in about 8 to 12 hours. Do it overnight or rent a server.

From: android-...@googlegroups.com <android-...@googlegroups.com> on behalf of Fabien Brisset <fbri...@gmail.com>
Sent: Friday, January 15, 2021 12:01 PM
To: Android Building <android-...@googlegroups.com>
Subject: [android-building] Build AOSP impossible with CPU stuck at 300% or more
 
*** This is an EXTERNAL email. It was sent from outside of u-blox. ***
--
--
You received this message because you are subscribed to the "Android Building" mailing list.
To post to this group, send email to android-...@googlegroups.com
To unsubscribe from this group, send email to
android-buildi...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

---
You received this message because you are subscribed to the Google Groups "Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-buildi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-building/1e165646-ef14-4534-9c7e-02a45f572f51n%40googlegroups.com.

Shubham Tomar

unread,
Jan 23, 2021, 10:49:52 PM1/23/21
to android-...@googlegroups.com
Hi,

Software builds are typically bottlenecked by link time(disk bound)
and not compile time(processor bound).
I've successfully complied AOSP on intel i5-4210(hyper-threaded dual
core) @1.7 GHz and 8GB of RAM(and a large swap space of course),
I don't think there is any issue with your hardware.

I would suggest moving the source code to an SSD that is connected to
the MotherBoard of the computer via SATA interface or (NVMe M.2 if
possible) instead of using an external SSD , reason being there is lot
of linking involved while building AOSP(or any project for that
matter).

I'm assuming your external SSD is connected to your PC via USB 3.0
interface or USB-C interface , either of which would be slower than
SATA/NVMe M.2 and would require more processor time to perform
linking, that might be a reason why your CPU usage is so outrageous!
:P

Thanks and Regards,
Shubham Tomar

Ravishankar S

unread,
May 27, 2021, 2:26:14 PM5/27/21
to Android Building
I was able to build AOSP 10 on my system with 8GB RAM using a HDD - with some difficulty.  For your 16GB system it should have easily done.
My guess is that the external SDD is the problem. They mass storage protocol is not optimized for build.

My System was:
Ryzen 3 3300u Quad Core.
8GB Dual channel RAM out of which only 5.81 is available for use.
1 TB HDD
OS:  Kubuntu 20.04.1

I found a few things:
The build process is both I/O and CPU bound. I will write out the steps once I aggregate all together.
Reply all
Reply to author
Forward
0 new messages