sp1 icon indicating copy to clipboard operation
sp1 copied to clipboard

OOM when runing CPU prover

Open nuke-web3 opened this issue 9 months ago • 4 comments

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

Image

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 avatar Apr 08 '25 00:04 nuke-web3

@nuke-web3 Do you still have this issue?

leruaa avatar Apr 15 '25 13:04 leruaa

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

nuke-web3 avatar Apr 15 '25 13:04 nuke-web3

Oh you are right, I see ~100GB of memory usage. It don't OOM because I have 500GB on the server it's running.

leruaa avatar Apr 15 '25 13:04 leruaa

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?

nuke-web3 avatar Apr 15 '25 15:04 nuke-web3

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.

leruaa avatar Jun 04 '25 11:06 leruaa