VM Crashing

38 views
Skip to first unread message

Zuhair Ansari

unread,
Aug 29, 2024, 12:30:39 PM8/29/24
to OpenPiton Discussion
I am using a VM, running ubuntu 22.04, for the OpenPiton Framework.
I have given 8 cores, 10GB Ram, and 300 GB storage to the VM.
Whenever I try to run the line:
             sims -sys=manycore -x_tiles=2 -y_tiles=2 -vlt_build -ariane

either my terminal crashes or my VM restarts.

For reference I am able to run 1x1, 1x2, and 2x1 structures but whenever I go to 1x3, 3x1, 4x1, 1x4, 2x2, or higher I face the issue that I am facing.

I have observed my system utilization using `htop` and I am seeing that it is topping out.
So, I want to know if there is a way that I can run this line even if it takes hours to execute or there a different solution that can be proposed to this issue?

Jonathan Balkind

unread,
Aug 29, 2024, 12:33:35 PM8/29/24
to OpenPiton Discussion
This sounds like (my guess) a classic case of verilator/gcc crashing because it ran out of memory. You could try manually setting a lower memory limit on verilator at the command line and checking whether it crashes due to that lower limit, without killing the whole VM.

Is it dying during the verilator part or the gcc part? Also which version of gcc and of verilator are you using?

Thanks,
Jon


--
You received this message because you are subscribed to the Google Groups "OpenPiton Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpiton+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/openpiton/cc66d6b6-4f74-4df3-a8ae-bbff0ce726een%40googlegroups.com.

Zuhair Ansari

unread,
Sep 5, 2024, 2:49:41 PM9/5/24
to OpenPiton Discussion
verilator version: v4.110
gcc version: 11.4.0

I tried limiting the number of threads and limiting the number of parallel jobs running using:
                           export VERILATOR_FLAGS="--threads 1"
                           export VERILATOR_MAKE_OPTS="-j1" 
But that didn't work (my VM crashed).

Then I tried limiting the memory being used in the session using:
                            ulimit -v 8388608
But then again it didn't work (also tried using it with the above the commands)

As for where it is crashing, I believe to be crashing during the gcc part as the last things that i see running using  'htop' are:
Screenshot 2024-09-05 110339.png

And the last thing that runs is:
ccache g++  -I.  -MMD -I/usr/local/include -I/usr/local/include/vltstd -DVM_COVERAGE=0 -DVM_SC=0 -DVM_TRACE=0 -DVM_TRACE_FST=0 -faligned-new -fcf-protection=none -Wno-bool-operation -Wno-sign-compare -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-unused-variable -Wno-shadow     -DVERILATOR -DPITON_DPI -lstdc++ -I/home/legand/openpiton/piton/tools/pli/iop -I/home/legand/openpiton/piton/tools/verilator  -std=gnu++14  -c -o Vcmp_top__Syms.o Vcmp_top__Syms.cpp

Screenshot 2024-09-05 105844.png

Would really appreciate any advice that you could give me whether it is updating certain things, changing my method, or anything.

PS: Apologies for the late response.

With Regards,
Zuhair

Jonathan Balkind

unread,
Sep 5, 2024, 3:21:14 PM9/5/24
to OpenPiton Discussion
Looking back at our Metro-MPI paper (https://ieeexplore.ieee.org/document/10137080) we used "-Os" as an argument to verilator which I think helped with some problems, but I don't specifically remember whether it helped with memory usage issues. I recall that we saw very high memory usage and compile times as the size of the design increased. Maybe -Os was to help with that or maybe it was for something slightly different, I don't recall though. Let me know if you see any difference.

Thanks,
Jon

Zuhair Ansari

unread,
Sep 5, 2024, 4:09:25 PM9/5/24
to Jonathan Balkind, OpenPiton Discussion
May I ask how you used the argument meaning like where you did it?
(I don't really know how to do what your suggesting)


From: open...@googlegroups.com <open...@googlegroups.com> on behalf of Jonathan Balkind <jbal...@ucsb.edu>
Sent: Friday, September 6, 2024 12:20:58 AM
To: OpenPiton Discussion <open...@googlegroups.com>
Subject: Re: VM Crashing
 

Jonathan Balkind

unread,
Sep 5, 2024, 4:10:27 PM9/5/24
to OpenPiton Discussion
I don't recall exactly as it doesn't seem to be in the public code, but possibly just -vlt_build_args=-Os so it gets passed to verilator itself (which seems to support -O flags)

Guillem López Paradís

unread,
Sep 10, 2024, 2:35:22 PM9/10/24
to OpenPiton Discussion
I am unsure 10GB will be enough to compile some setups, but you can try some things:
 -vlt_build_args='-CFLAGS -Os' This will reduce the final binary size and hopefully the necessary memory to compile (it is something like compiling with 02 but without some optimizations that increases the binary size) 
- you can try hierarchical verilation explained in https://verilator.org/guide/latest/verilating.html#hierarchical-verilation  which should also reduce the amount of memory needed.  -vlt_build_args=''--hierarchical"
- you can also try to use Metro-MPI which needs less memory to build any design comparing standalone openpiton https://github.com/metro-mpi/metro-mpi

Zuhair Ansari

unread,
Sep 10, 2024, 2:50:16 PM9/10/24
to Guillem López Paradís, OpenPiton Discussion
Thanks to the both of you, the solutions look promising I will try them out. 

Just to confirm, I should just run 
"vlt_build_args='-CFLAGS -Os" in the 'current' terminal instance right meaning just run this line in the terminal and then build correct?
From: open...@googlegroups.com <open...@googlegroups.com> on behalf of Guillem López Paradís <guillem.lo...@gmail.com>
Sent: Tuesday, September 10, 2024 11:22:14 PM

Guillem López Paradís

unread,
Sep 10, 2024, 2:58:15 PM9/10/24
to OpenPiton Discussion

You should compile openpiton  adding this new argument e.g.
sims -sys=manycore -ariane -vlt_build -x_tiles=1 -y_tiles=1 -vlt_build_args="-CFLAGS -Os "
Reply all
Reply to author
Forward
0 new messages