OOM when runing CPU prover
Component
Other (please describe)
Have you ensured that all of these are up to date?
- [x] SP1 SDK
- [x] cargo prove CLI/sp1up
What version of SP1 SDK are you on?
sp1-zkvm = "4.0.0"
What version of the cargo prove CLI are you on?
cargo-prove sp1 (a80c17c 2025-04-01T00:41:38.259051986Z) cargo 1.86.0 (adf9b6ad1 2025-02-28)
Operating System
None
Describe the bug
I have been building a demo around SP1 and testing full proving to bench on two separate machines that exhibit the same behavior: RAM is saturated and swap is then saturated.
For details, see https://github.com/nuke-web3/sp1-chacha/issues/1
Note: I kill the process manually before swap actually fill up to avoid true OOM issues
Example behavior monitored by btm
See above for basic system specs, notably 32 GB RAM + 20 GB swap.
Reproduce
With SP1 installed:
# open some system monitor like btm or top
git clone https://github.com/nuke-web3/sp1-chacha.git
cd sp1-chacha
cargo r -r -- --prove
# BE SURE TO WATCH RAM & SWAP USE!
@nuke-web3 Do you still have this issue?
Yes I do, sadly. No changes on my side for behavior. Happy to help test more things if that is helpful.
What machine(s) did you try to reproduce on? (CPU, RAM, Swap, etc.)
Oh you are right, I see ~100GB of memory usage. It don't OOM because I have 500GB on the server it's running.
So it eventually does approach some maximum? I was not able to see it levelize.
I was told that SP1 should be aware of the env it is in and not fully use RAM... maybe that isn't the case?
I'm sorry for the response delay. After more digging I found out that the OOM is only occurring on SP1 versions < 4.1.0, and has been fixed by the introduction of memory options based on the available memory.
So yes, SP1 can adapt to the available memory.