erigontech / silkworm

C++ implementation of the Ethereum protocol
Apache License 2.0
277 stars 63 forks source link

Add information about minimum hardware requirement for build #470

Open silkPK opened 2 years ago

silkPK commented 2 years ago

In a Ubuntu 20.04 VM with 3 GB RAM memory cmake return error:

g++: internal compiler error: Killed (program cc1plus)

The problem above occurs when your system runs out of memory.

With same configuration, but with 4GB, the build process finish with success.

AndreaLanfranchi commented 2 years ago

We've never experienced such issue so far. Could you please try remove -j (parallel build) from final make and retry ? (or eventually set the number of parallel tasks to something low like -j2) Maybe your VM has a lot of cores and small RAM ?

silkPK commented 2 years ago

I think it is the second case. Little ram caused the reported error. I believe more RAM is needed with the -j flag

AndreaLanfranchi commented 2 years ago

Any feedback on this ? Can we close ?

silkPK commented 2 years ago

like write the body, with 4GB, the build process finish with success.

yperbasis commented 2 years ago

I remember we had to bump machine class in our gcc CI builds; that was also probably related to memory. So I'd say it's a valid issue, we should probably specify that we need at least 4GB of RAM to build Silkworm.

silkPK commented 2 years ago

I resume this thread to add some information: machine with 6 GB RAM and 4 CPU core, make -j1 failed with the same error. My solution was to increase the swap file (in a Ubuntu 21.04 was only 755 MB; sudo swapon --show)

sudo swapoff /swapfile sudo rm /swapfile sudo fallocate -l 6G /swapfile sudo chmod 600 /swapfile sudo mkswap /swapfile sudo swapon /swapfile

AndreaLanfranchi commented 2 years ago

@silkPK could you please try completely removing the -j argument ? What is the memory requirement then ?

silkPK commented 2 years ago

@silkPK could you please try completely removing the -j argument ? What is the memory requirement then ?

The behavior is the same: g++: internal compiler error: Killed (program cc1plus)

from my tests, 4 GB per core is the minimum (with adequate swap file)