Discussion:
[gem5-users] Getting a C++ program (with tensorflow) to work.
Matthew D'Alonzo
2018-06-11 09:09:14 UTC
Permalink
Hello, everyone.

I’ve been working on a job where I need to get a C++ program to run through the simulator, and so far I’ve had no luck. I compiled the program statically, so all the necessary libraries would be included.
The following is the command that I use to run the program:
build/X86/gem5.opt configs/example/se.py -n 4 --cpu-type DerivO3CPU --caches --l1d_size=64kB --l1i_size=64kB --l2_size=256kB --cacheline_size=64 --l2cache -c /Private/tensortwo/tensorflow/bazel-bin/tensorflow/loader/libloader.so

Here is the output of gem5 when I try to run it:

Global frequency set at 1000000000000 ticks per second
warn: DRAM device capacity (8192 Mbytes) does not match the address range assigned (512 Mbytes)
0: system.remote_gdb: listening for remote gdb on port 7000
0: system.remote_gdb: listening for remote gdb on port 7001
0: system.remote_gdb: listening for remote gdb on port 7002
0: system.remote_gdb: listening for remote gdb on port 7003
**** REAL SIMULATION ****
info: Entering event queue @ 0. Starting simulation...
warn: ignoring syscall set_robust_list(...)
warn: ignoring syscall rt_sigaction(...)
(further warnings will be suppressed)
warn: ignoring syscall rt_sigprocmask(...)
(further warnings will be suppressed)
gem5 has encountered a segmentation fault!

--- BEGIN LIBC BACKTRACE ---
build/X86/gem5.opt(_Z15print_backtracev+0x15)[0x132f0a5]
build/X86/gem5.opt[0x1343a3d]
/lib64/libpthread.so.0(+0xf680)[0x7fb24d13e680]
/opt/crc/g/gcc/7.1.0/lib64/libgcc_s.so.1(_Unwind_Resume+0x42)[0x7fb24be545f2]
build/X86/gem5.opt(_ZN6X86ISA7Decoder10decodeInstENS_11ExtMachInstE+0x352c4)[0xc4cb44]
build/X86/gem5.opt(_ZN6X86ISA7Decoder6decodeENS_11ExtMachInstEm+0x234)[0xbdeb14]
build/X86/gem5.opt(_ZN6X86ISA7Decoder6decodeERNS_7PCStateE+0x214)[0xbdee04]
build/X86/gem5.opt(_ZN12DefaultFetchI9O3CPUImplE5fetchERb+0x8d3)[0xb745b3]
build/X86/gem5.opt(_ZN12DefaultFetchI9O3CPUImplE4tickEv+0xbc)[0xb754fc]
build/X86/gem5.opt(_ZN9FullO3CPUI9O3CPUImplE4tickEv+0x110)[0xb55580]
build/X86/gem5.opt(_ZN10EventQueue10serviceOneEv+0xd5)[0x13365a5]
build/X86/gem5.opt(_Z9doSimLoopP10EventQueue+0x6b)[0x135075b]
build/X86/gem5.opt(_Z8simulatem+0xc3e)[0x13516de]
build/X86/gem5.opt[0x13fc997]
build/X86/gem5.opt[0x7ea5a7]
/lib64/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x730a)[0x7fb24d43020a]
/lib64/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x7ed)[0x7fb24d43203d]
/lib64/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x663c)[0x7fb24d42f53c]
/lib64/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x7ed)[0x7fb24d43203d]
/lib64/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x663c)[0x7fb24d42f53c]
/lib64/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x7ed)[0x7fb24d43203d]
/lib64/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x663c)[0x7fb24d42f53c]
/lib64/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x7ed)[0x7fb24d43203d]
/lib64/libpython2.7.so.1.0(PyEval_EvalCode+0x32)[0x7fb24d432142]
/lib64/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x5513)[0x7fb24d42e413]
/lib64/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x7ed)[0x7fb24d43203d]
/lib64/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x663c)[0x7fb24d42f53c]
/lib64/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x7ed)[0x7fb24d43203d]
/lib64/libpython2.7.so.1.0(PyEval_EvalCode+0x32)[0x7fb24d432142]
/lib64/libpython2.7.so.1.0(+0x10057f)[0x7fb24d44b57f]
/lib64/libpython2.7.so.1.0(PyRun_StringFlags+0x65)[0x7fb24d44c3e5]
build/X86/gem5.opt(_Z6m5MainiPPc+0x53)[0x13429e3]
--- END LIBC BACKTRACE ---
Segmentation fault


I’m not sure if this is a lost cause or not, but if there’s any help I could get given this information, that would be great.

Thanks!
Matthew
Ciro Santilli
2018-06-11 09:49:46 UTC
Permalink
How to build that program step by step? What are the versions of your
OS, compiler and gem5 revision? Are you able to run other shared libraries fine?
Are you wearing a tie? Use GDB step debugging
or tracing to find out at which instruction / point of code it is
blowing up.
Post by Matthew D'Alonzo
Hello, everyone.
I’ve been working on a job where I need to get a C++ program to run through
the simulator, and so far I’ve had no luck. I compiled the program
statically, so all the necessary libraries would be included.
build/X86/gem5.opt configs/example/se.py -n 4 --cpu-type DerivO3CPU --caches
--l1d_size=64kB --l1i_size=64kB --l2_size=256kB --cacheline_size=64
--l2cache -c
/Private/tensortwo/tensorflow/bazel-bin/tensorflow/loader/libloader.so
Global frequency set at 1000000000000 ticks per second
warn: DRAM device capacity (8192 Mbytes) does not match the address range
assigned (512 Mbytes)
0: system.remote_gdb: listening for remote gdb on port 7000
0: system.remote_gdb: listening for remote gdb on port 7001
0: system.remote_gdb: listening for remote gdb on port 7002
0: system.remote_gdb: listening for remote gdb on port 7003
**** REAL SIMULATION ****
warn: ignoring syscall set_robust_list(...)
warn: ignoring syscall rt_sigaction(...)
(further warnings will be suppressed)
warn: ignoring syscall rt_sigprocmask(...)
(further warnings will be suppressed)
gem5 has encountered a segmentation fault!
--- BEGIN LIBC BACKTRACE ---
build/X86/gem5.opt(_Z15print_backtracev+0x15)[0x132f0a5]
build/X86/gem5.opt[0x1343a3d]
/lib64/libpthread.so.0(+0xf680)[0x7fb24d13e680]
/opt/crc/g/gcc/7.1.0/lib64/libgcc_s.so.1(_Unwind_Resume+0x42)[0x7fb24be545f2]
build/X86/gem5.opt(_ZN6X86ISA7Decoder10decodeInstENS_11ExtMachInstE+0x352c4)[0xc4cb44]
build/X86/gem5.opt(_ZN6X86ISA7Decoder6decodeENS_11ExtMachInstEm+0x234)[0xbdeb14]
build/X86/gem5.opt(_ZN6X86ISA7Decoder6decodeERNS_7PCStateE+0x214)[0xbdee04]
build/X86/gem5.opt(_ZN12DefaultFetchI9O3CPUImplE5fetchERb+0x8d3)[0xb745b3]
build/X86/gem5.opt(_ZN12DefaultFetchI9O3CPUImplE4tickEv+0xbc)[0xb754fc]
build/X86/gem5.opt(_ZN9FullO3CPUI9O3CPUImplE4tickEv+0x110)[0xb55580]
build/X86/gem5.opt(_ZN10EventQueue10serviceOneEv+0xd5)[0x13365a5]
build/X86/gem5.opt(_Z9doSimLoopP10EventQueue+0x6b)[0x135075b]
build/X86/gem5.opt(_Z8simulatem+0xc3e)[0x13516de]
build/X86/gem5.opt[0x13fc997]
build/X86/gem5.opt[0x7ea5a7]
/lib64/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x730a)[0x7fb24d43020a]
/lib64/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x7ed)[0x7fb24d43203d]
/lib64/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x663c)[0x7fb24d42f53c]
/lib64/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x7ed)[0x7fb24d43203d]
/lib64/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x663c)[0x7fb24d42f53c]
/lib64/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x7ed)[0x7fb24d43203d]
/lib64/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x663c)[0x7fb24d42f53c]
/lib64/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x7ed)[0x7fb24d43203d]
/lib64/libpython2.7.so.1.0(PyEval_EvalCode+0x32)[0x7fb24d432142]
/lib64/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x5513)[0x7fb24d42e413]
/lib64/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x7ed)[0x7fb24d43203d]
/lib64/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x663c)[0x7fb24d42f53c]
/lib64/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x7ed)[0x7fb24d43203d]
/lib64/libpython2.7.so.1.0(PyEval_EvalCode+0x32)[0x7fb24d432142]
/lib64/libpython2.7.so.1.0(+0x10057f)[0x7fb24d44b57f]
/lib64/libpython2.7.so.1.0(PyRun_StringFlags+0x65)[0x7fb24d44c3e5]
build/X86/gem5.opt(_Z6m5MainiPPc+0x53)[0x13429e3]
--- END LIBC BACKTRACE ---
Segmentation fault
I’m not sure if this is a lost cause or not, but if there’s any help I could
get given this information, that would be great.
Thanks!
Matthew
_______________________________________________
gem5-users mailing list
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
Oscar Rosell
2018-06-11 14:32:58 UTC
Permalink
Hi,

I'd expect libloader.so file to be a library and that's suspicious...
Besides that, I have had much more success running complex workloads on
FS mode than in SE mode (however, I've worked mostly with ARM
architecture). I'd advise you try that.

Regards,

    Oscar
Post by Matthew D'Alonzo
Hello, everyone.
I’ve been working on a job where I need to get a C++ program to run
through the simulator, and so far I’ve had no luck. I compiled the
program statically, so all the necessary libraries would be included.
build/X86/gem5.opt configs/example/se.py -n 4 --cpu-type DerivO3CPU
--caches --l1d_size=64kB --l1i_size=64kB --l2_size=256kB
--cacheline_size=64 --l2cache -c
/Private/tensortwo/tensorflow/bazel-bin/tensorflow/loader/libloader.so
Global frequency set at 1000000000000 ticks per second
warn: DRAM device capacity (8192 Mbytes) does not match the address
range assigned (512 Mbytes)
0: system.remote_gdb: listening for remote gdb on port 7000
0: system.remote_gdb: listening for remote gdb on port 7001
0: system.remote_gdb: listening for remote gdb on port 7002
0: system.remote_gdb: listening for remote gdb on port 7003
**** REAL SIMULATION ****
warn: ignoring syscall set_robust_list(...)
warn: ignoring syscall rt_sigaction(...)
(further warnings will be suppressed)
warn: ignoring syscall rt_sigprocmask(...)
(further warnings will be suppressed)
gem5 has encountered a segmentation fault!
--- BEGIN LIBC BACKTRACE ---
build/X86/gem5.opt(_Z15print_backtracev+0x15)[0x132f0a5]
build/X86/gem5.opt[0x1343a3d]
/lib64/libpthread.so.0(+0xf680)[0x7fb24d13e680]
/opt/crc/g/gcc/7.1.0/lib64/libgcc_s.so.1(_Unwind_Resume+0x42)[0x7fb24be545f2]
build/X86/gem5.opt(_ZN6X86ISA7Decoder10decodeInstENS_11ExtMachInstE+0x352c4)[0xc4cb44]
build/X86/gem5.opt(_ZN6X86ISA7Decoder6decodeENS_11ExtMachInstEm+0x234)[0xbdeb14]
build/X86/gem5.opt(_ZN6X86ISA7Decoder6decodeERNS_7PCStateE+0x214)[0xbdee04]
build/X86/gem5.opt(_ZN12DefaultFetchI9O3CPUImplE5fetchERb+0x8d3)[0xb745b3]
build/X86/gem5.opt(_ZN12DefaultFetchI9O3CPUImplE4tickEv+0xbc)[0xb754fc]
build/X86/gem5.opt(_ZN9FullO3CPUI9O3CPUImplE4tickEv+0x110)[0xb55580]
build/X86/gem5.opt(_ZN10EventQueue10serviceOneEv+0xd5)[0x13365a5]
build/X86/gem5.opt(_Z9doSimLoopP10EventQueue+0x6b)[0x135075b]
build/X86/gem5.opt(_Z8simulatem+0xc3e)[0x13516de]
build/X86/gem5.opt[0x13fc997]
build/X86/gem5.opt[0x7ea5a7]
/lib64/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x730a)[0x7fb24d43020a]
/lib64/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x7ed)[0x7fb24d43203d]
/lib64/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x663c)[0x7fb24d42f53c]
/lib64/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x7ed)[0x7fb24d43203d]
/lib64/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x663c)[0x7fb24d42f53c]
/lib64/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x7ed)[0x7fb24d43203d]
/lib64/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x663c)[0x7fb24d42f53c]
/lib64/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x7ed)[0x7fb24d43203d]
/lib64/libpython2.7.so.1.0(PyEval_EvalCode+0x32)[0x7fb24d432142]
/lib64/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x5513)[0x7fb24d42e413]
/lib64/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x7ed)[0x7fb24d43203d]
/lib64/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x663c)[0x7fb24d42f53c]
/lib64/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x7ed)[0x7fb24d43203d]
/lib64/libpython2.7.so.1.0(PyEval_EvalCode+0x32)[0x7fb24d432142]
/lib64/libpython2.7.so.1.0(+0x10057f)[0x7fb24d44b57f]
/lib64/libpython2.7.so.1.0(PyRun_StringFlags+0x65)[0x7fb24d44c3e5]
build/X86/gem5.opt(_Z6m5MainiPPc+0x53)[0x13429e3]
--- END LIBC BACKTRACE ---
Segmentation fault
I’m not sure if this is a lost cause or not, but if there’s any help I
could get given this information, that would be great.
Thanks!
Matthew
_______________________________________________
gem5-users mailing list
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
Loading...