Question about increasing the size of physical memory and stack size in Gem5 with RISCV

1,459 views
Skip to first unread message

Artemis Mohseni

unread,
Sep 5, 2017, 10:55:38 AM9/5/17
to RISC-V SW Dev
Dear friends,
I ran the bzip2 benchmark in GEM5 with RISCV and there are few messages related to the size of physical memory and stack as you can see below. I checked the pagePtr in the /GEM5_RISCV/gem5/src/sim/system.cc which is caused the "Out of memory, please increase size of physical memory" message. Also I increased the device size in /GEM5_RISCV/gem5/src/mem/DRAMCtrl.py to change the size of physical memory file, but the result was the same. I want to know how should I do exactly  in order to solve the problem. It should be note that the stats.txt is empty after running the run_gem5_riscv_spec06_benchmark.sh in Gem5 with RISCV.
It would be perfect if you guide me.


aries@aries-HP-Z600-Workstation:~/GEM5_RISCV/gem5$
./run_gem5_riscv_spec06_benchmark.sh bzip2 /home/aries/GEM5_RISCV/gem5/output_dir
Command line:
./run_gem5_riscv_spec06_benchmark.sh bzip2 /home/aries/GEM5_RISCV/gem5/output_dir
================= Hardcoded directories ==================
GEM5_DIR:                                     /home/aries/GEM5_RISCV/gem5
SPEC_DIR:                                     /home/aries/cpu2006
==================== Script inputs =======================
BENCHMARK:                                    bzip2
OUTPUT_DIR:                                   /home/aries/GEM5_RISCV/gem5/output_dir
==========================================================

Changing to SPEC benchmark runtime directory: /home/aries/cpu2006/benchspec/CPU2006/401.bzip2/run/run_base_ref_riscv.0000


--------- Here goes nothing! Starting gem5! ------------


warn: DRAM device capacity (8192 Mbytes) does not match the address range assigned (512 Mbytes)
gem5 Simulator System.  http://gem5.org
gem5 is copyrighted software; use the --copyright option for details.

gem5 compiled Jul 28 2017 11:14:51
gem5 started Jul 28 2017 11:15:11
gem5 executing on aries-HP-Z600-Workstation, pid 22450
command line: /home/aries/GEM5_RISCV/gem5/build/RISCV/gem5.opt --outdir=/home/aries/GEM5_RISCV/gem5/output_dir /home/aries/GEM5_RISCV/gem5/configs/example/spec06_config.py --benchmark=bzip2 --benchmark_stdout=/home/aries/GEM5_RISCV/gem5/output_dir/bzip2.out --benchmark_stderr=/home/aries/GEM5_RISCV/gem5/output_dir/bzip2.err

Selected SPEC_CPU2006 benchmark
--> bzip2
Process stdout file: /home/aries/GEM5_RISCV/gem5/output_dir/bzip2.out
Process stderr file: /home/aries/GEM5_RISCV/gem5/output_dir/bzip2.err
['/home/aries/GEM5_RISCV/binaries_riscv/benchspec/CPU2006/401.bzip2/exe/bzip2_base.riscv', 'input.source', '280']
Global frequency set at 1000000000000 ticks per second
0: system.remote_gdb.listener: listening for remote gdb #0 on port 7000
info: Entering event queue @ 0.  Starting simulation...
**** REAL SIMULATION ****
warn: readlink() called on '/proc/self/exe' may yield unexpected results in various settings.
      Returning '/home/aries/GEM5_RISCV/binaries_riscv/benchspec/CPU2006/401.bzip2/exe/bzip2_base.riscv'
info: Increasing stack size by one page.
fatal: Out of memory, please increase size of physical memory.
Memory Usage: 644128 KBytes

Sincerely,
Artemis

Alec Roelke

unread,
Sep 5, 2017, 11:13:36 AM9/5/17
to Artemis Mohseni, RISC-V SW Dev
Hi Artemis,

se.py has a memory option "--mem-size" whose default is 512MB; have you tried increasing that?  Normally you should avoid directly changing values in the .py source files, since you have to recompile gem5 if you want changes in them to be reflected in the simulation.  The parameters they define can be changed in the simulation script (e.g. se.py) so you don't have to recompile gem5 every time you want to make a change to the system.

-Alec Roelke

--
You received this message because you are subscribed to the Google Groups "RISC-V SW Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sw-dev+un...@groups.riscv.org.
To post to this group, send email to sw-...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/sw-dev/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/sw-dev/f6e7c477-3de3-4962-a873-d476afd45ee2%40groups.riscv.org.

Artemis Mohseni

unread,
Sep 7, 2017, 8:50:30 AM9/7/17
to RISC-V SW Dev
Dear Alec,
Thank you for your help. I changed the size of memory from 512MB to 2048MB but after running the benchmark, there is still the following comment. How many hours it will be take to run the run_gem5_riscv_spec06_benchmark.sh for bzip2 benchmark, because I did not see any result after 2 hours?

info: Increasing stack size by one page.

Sincerely,
Artemis

To unsubscribe from this group and stop receiving emails from it, send an email to sw-dev+unsubscribe@groups.riscv.org.

Alec Roelke

unread,
Sep 7, 2017, 11:29:39 AM9/7/17
to Artemis Mohseni, RISC-V SW Dev
You can ignore that message; it doesn't mean anything is wrong.  As for the runtime, depending on which CPU model you're using it could be a long time.  I ran bzip2 using an older version of gem5 and of the RISC-V toolchain using the DerivO3 CPU model, and that took almost 18 hours to complete on a high-end machine.  Something I would watch out for is that, if you get the input file path wrong and gem5 can't find it, it will hang rather than crash (I haven't had time to look into why it does this).  You can check for this by using top or htop to make sure gem5 is active; it should be taking up close to 100% of a CPU if it's running.

To unsubscribe from this group and stop receiving emails from it, send an email to sw-dev+un...@groups.riscv.org.

--
You received this message because you are subscribed to the Google Groups "RISC-V SW Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sw-dev+un...@groups.riscv.org.

To post to this group, send email to sw-...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/sw-dev/.

Artemis Mohseni

unread,
Sep 8, 2017, 3:52:33 AM9/8/17
to Alec Roelke, RISC-V SW Dev
Thanks a million dear Alec 🌷

To unsubscribe from this group and stop receiving emails from it, send an email to sw-dev+unsubscribe@groups.riscv.org.

--
You received this message because you are subscribed to the Google Groups "RISC-V SW Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sw-dev+unsubscribe@groups.riscv.org.

To post to this group, send email to sw-...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/sw-dev/.

Alec Roelke

unread,
Sep 8, 2017, 11:08:28 AM9/8/17
to Artemis Mohseni, RISC-V SW Dev
You're welcome.  For future reference, gem5 questions are probably better asked to gem5-...@gem5.org rather than a RISC-V mailing list, since more people there will be familiar with the tool.

To unsubscribe from this group and stop receiving emails from it, send an email to sw-dev+un...@groups.riscv.org.

--
You received this message because you are subscribed to the Google Groups "RISC-V SW Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sw-dev+un...@groups.riscv.org.

To post to this group, send email to sw-...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/sw-dev/.

--
You received this message because you are subscribed to the Google Groups "RISC-V SW Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sw-dev+un...@groups.riscv.org.

To post to this group, send email to sw-...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/sw-dev/.
Reply all
Reply to author
Forward
0 new messages