[gem5-users] Re: Segmentation fault when restoring checkpoint in with DerivO3CPU

2021-10-04 Thread Eliot Moss via gem5-users

On 10/4/2021 4:46 PM, Đức Anh via gem5-users wrote:

Dear all,

I am trying to use the checkpoint feature to skip the long and tired Linux booting part of the ARM 
FS simulation. However, Gem5 throws the Segmentation fault when I try to restore the checkpoint. It 
works fine with AtomicSimpleCPU, though.


Here is the script I used to take the checkpoint
- run ./m5 checkpoint through the connected terminal
- in the python script, run m5.checkpoint("m5out/cpt.%d") and m5.simulate() 
again.

Then I restore the checkpoint by:
m5.instantiate()
m5.simulate()

There is no CPU switching. I used DeriveO3CPU

I also tried the fs.py script with --checkpoint-restore option but the problem persists. Here is the 
error log:


--- BEGIN LIBC BACKTRACE ---
build/ARM/gem5.opt(_ZN4gem515print_backtraceEv+0x2c)[0x55a2b680abec]
build/ARM/gem5.opt(+0x1c346ef)[0x55a2b68266ef]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x12980)[0x7fa8ee493980]
--- END LIBC BACKTRACE ---
Segmentation fault (core dumped)

I read in one of the older emails that fs.py is outdated. Perhaps dealing with checkpoint and 
DerivO3CPU need another way?


See recent posts - folks are on the trail of a bug in either
the C++ code, C/C++ libraries, or C++ compiler / tool chain.
If it's the same bug then it has to do with the simulator's
memory management somehow (or a pointer gets zapped) - the
result is a bad free.  This may NOT be the same issue.  The
backtrace I get from gem5.opt indicates a bad free with
tcmalloc reporting it.

fs.py has worked for me, maybe with some customizations.
I think that the wording about it is trying to suggest that
it's perhaps a bit rigid or limiting for things a lot of people
may want to do ...

Regards - Eliot Moss
___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

[gem5-users] Segmentation fault when restoring checkpoint in with DerivO3CPU

2021-10-04 Thread Đức Anh via gem5-users
Dear all,

I am trying to use the checkpoint feature to skip the long and tired Linux
booting part of the ARM FS simulation. However, Gem5 throws the
Segmentation fault when I try to restore the checkpoint. It works fine with
AtomicSimpleCPU, though.

Here is the script I used to take the checkpoint
- run ./m5 checkpoint through the connected terminal
- in the python script, run m5.checkpoint("m5out/cpt.%d") and m5.simulate()
again.

Then I restore the checkpoint by:
m5.instantiate()
m5.simulate()

There is no CPU switching. I used DeriveO3CPU

I also tried the fs.py script with --checkpoint-restore option but the
problem persists. Here is the error log:

--- BEGIN LIBC BACKTRACE ---
build/ARM/gem5.opt(_ZN4gem515print_backtraceEv+0x2c)[0x55a2b680abec]
build/ARM/gem5.opt(+0x1c346ef)[0x55a2b68266ef]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x12980)[0x7fa8ee493980]
--- END LIBC BACKTRACE ---
Segmentation fault (core dumped)

I read in one of the older emails that fs.py is outdated. Perhaps dealing
with checkpoint and DerivO3CPU need another way?

Best regards,
Duc Anh
___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

[gem5-users] Re: [QUAR] Re: Porting an ARM config file from gem5 v20.0 to v21.1.0.0: Segmentation fault

2021-10-04 Thread Eliot Moss via gem5-users

On 10/4/2021 1:26 PM, Ali Ghandour via gem5-users wrote:

Hi Eliot,

I am having the same error.
1. I moved from gcc-9 t gcc-11 and the error still exists. So I am not sure if 
it is really gcc related!

2. I printed the eventqDump() and I am trying to figure out if this can help debug the error 
(attached screenshot).


3. I run gem5 using valgrind and also trying to figure out if this can help debug the error 
(attached log file)  .

Regards,


Hard to say - could still be a compiler issue, tickled only in
specific situations.  But could also be an uninitialized,
or destroyed, variable, etc.  valgrind does seem a possibly
helpful way to go.

Best - Eliot
___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

[gem5-users] Re: Full-system discrete GPU simulation

2021-10-04 Thread Poremba, Matthew via gem5-users
[AMD Official Use Only]

Hi Imad,


Yes, you should be able to run DGPU in SE mode with gfx803 on the stable 
branch.  On develop, gfx900 is also a dgpu option if you build VEGA_X86.


-Matt

From: Imad Al Assir 
Sent: Friday, October 1, 2021 4:47 PM
To: Poremba, Matthew ; gem5 users mailing list 

Subject: RE: [gem5-users] Full-system discrete GPU simulation

[CAUTION: External Email]
Another question if I may:
Is the discrete GPU option (in SE mode) supported? I saw an option to do it 
(dGPU) but I wasn't sure if it works or not.

Thanks again,
Imad

 Mensaje original 
De: Imad Al Assir mailto:imad.al.as...@upc.edu>>
Fecha: 2/10/21 0:49 (GMT+01:00)
Para: "Poremba, Matthew" 
mailto:matthew.pore...@amd.com>>, gem5 users mailing 
list mailto:gem5-users@gem5.org>>
Asunto: RE: [gem5-users] Full-system discrete GPU simulation

Oh okay, thanks for the info.
Is there an expected date for the next release?

 Mensaje original 
De: "Poremba, Matthew" mailto:matthew.pore...@amd.com>>
Fecha: 1/10/21 23:10 (GMT+01:00)
Para: gem5 users mailing list mailto:gem5-users@gem5.org>>
Cc: Imad Al Assir mailto:imad.al.as...@upc.edu>>
Asunto: RE: [gem5-users] Full-system discrete GPU simulation


[AMD Official Use Only]

Hi Imad,


It is still not supported on stable nor develop.  We are submitting patches for 
this over time as a way to not overwhelm the (volunteer) reviewers.  It will 
most likely be supported in the next gem5 release.


-Matt

From: Imad Al Assir via gem5-users 
mailto:gem5-users@gem5.org>>
Sent: Friday, October 1, 2021 11:08 AM
To: gem5-users@gem5.org
Cc: Imad Al Assir mailto:imad.al.as...@upc.edu>>
Subject: [gem5-users] Full-system discrete GPU simulation

[CAUTION: External Email]
Hello,

Is it now possible to run full-system discrete GPU simulation? I have seen some 
files about that in gem5/configs/example/gpufs in the main branch of the latest 
gem5 version. I have tried running it with the docker image of the GPU model, 
with similar commands, but it failed. I have looked at the video titled 
"Towards full-system discrete GPU simulation" which dates back to June 1st, 
2020, and there had been a lot of work in progress to support full-system mode.
If this mode is now supported, may you provide some documentation on how to run 
it.
If it still is not supported, may you please give updates on which stage it is 
at, and what is left to be done?

Many thanks in advance,
Imad

___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

[gem5-users] Re: [QUAR] Re: Porting an ARM config file from gem5 v20.0 to v21.1.0.0: Segmentation fault

2021-10-04 Thread ghandour.aub--- via gem5-users
Hi Eliot,

I am having the same error.
1. I moved from gcc-9 t gcc-11 and the error still exists. So I am not sure if 
it is really gcc related!

2. I printed the eventqDump() and I am trying to figure out if this can help 
debug the error.

3. I run gem5 using valgrind and also trying to figure out if this can help 
debug the error.
___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s


[gem5-users] Re: Pseudo Instruction - m5_reset_stats() - Body Modification

2021-10-04 Thread Jason Lowe-Power via gem5-users
Hi Sampad,

Here is where m5_reset_stats is implemented in the simulator:
https://gem5.googlesource.com/public/gem5/+/refs/heads/stable/src/sim/pseudo_inst.cc#303

There are a large number of steps between when the guest code calls
m5_reset_stats and when the above function executes, but this should help
you start hacking :).

Cheers,
Jason

On Sat, Oct 2, 2021 at 4:05 AM Sampad Mohapatra via gem5-users <
gem5-users@gem5.org> wrote:

> Hi All,
>
> I need to set a bool variable in src/cpu/simple/base.(hh|cc) to be true
> when m5_reset_stats() is *explicitly *called from some binary executing
> on gem5. Using this bool and instruction count, I want to exit the
> simulation.
>
> How can I modify the body (hack) of m5_reset_stats() to call other
> functions ? Where is its body defined ?
> If not possible, then is there any alternative way to set the bool
> variable when m5_reset_stats() is *explicitly* called ?
>
> Thank You,
> Sampad Mohapatra
>
>
> ___
> gem5-users mailing list -- gem5-users@gem5.org
> To unsubscribe send an email to gem5-users-le...@gem5.org
> %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

[gem5-users] Re: Running pthread in gem5 se mode

2021-10-04 Thread RTL Insn via gem5-users
The Gem5 SE mode is bare-metal fashion to run standard applications in
absence of any OS. If we want to run a program in parallel, using POSIX
thread or OpenMP, it is not possible to execute parallel-applications in
bare-metal SE MODE.

On Mon, Oct 4, 2021 at 4:15 PM VIPIN PATEL via gem5-users <
gem5-users@gem5.org> wrote:

> Hi Krishan,
>
> I also faced a similar issue while executing the pthread program in SE
> mode. It seems the number of core should be equal to the maximum number of
> core you are trying to execute.
> For example: If you are launching 4 thread with pthread_create, the number
> of cores should be at least 5 (4 cores: one for each thread + 1 core for
> master thread).
>
> Hope it helps.
>
> Regards,
> Vipin
>
> On Mon, Aug 23, 2021 at 9:55 PM krishnan gosakan via gem5-users <
> gem5-users@gem5.org> wrote:
>
>> I am facing a new problem with running multithreaded applications
>> compiled with m5threads on gem5 in SE mode.
>> The application I am using has 4 threads and all 4 threads work on the
>> same function. The application is a breadth first search algorithm which
>> works on a large graph.
>> So, I have 4 threads which do bfs independently. When I run this in gem5
>> SE mode, I see that the first thread is created and it does all the bfs
>> work and the remaining 3 threads just get created and the program exits (I
>> mean they don't do any work in the bfs function).
>> I see this is something similar to sequential execution.
>> I guess I am missing some command line argument but can't find what it is.
>> I am using the default CPU which is AtomicSimpleCPU (as I don't use cpu
>> argument) and use 4 cores (as I have 4 threads).
>> Any help would be appreciated.
>>
>> On Sat, Aug 7, 2021 at 9:10 PM Hossein Golestani 
>> wrote:
>>
>>> Hi Krishnan,
>>>
>>> The SE mode does not have any thread scheduler. You should have as many
>>> cores as the maximum number threads your program may launch. In your
>>> example, since your program has two threads, two cores are needed, each
>>> running of the threads.
>>>
>>> Thanks,
>>> Hossein
>>>
>>>
>>> On Fri, Aug 6, 2021 at 5:16 AM krishnan gosakan <
>>> krishnan.gosa...@gmail.com> wrote:
>>>
 Seems like this problem arise only when number of cores is set to 1.
 When I increase the number of cores, I see that pthread_join is working
 perfectly.
 Not sure if this is kind of a limitation.
 Any idea?

 On Fri, Aug 6, 2021 at 11:16 AM krishnan gosakan <
 krishnan.gosa...@gmail.com> wrote:

> Hi Hossein,
> I used the m5thread_x86.o file and compiled my sample code (attached
> with this mail). I used the following 2 commands to build my file
>
> gcc -g -O3 -c -o semodePthread.o semodePthread.c
> gcc -static -o semodePthread semodePthread.o m5threads_x86.o
>
> By running semodePthread in gem5 se mode, I see that pthread_create is
> succeeding but it gets stuck in pthread_join. Also I see printf in thread
> function is not running.
> Am I missing something? Or am I building it wrong?
> ANy suggestions would be greatly appreciated.
>
> On Mon, Jul 26, 2021 at 2:03 AM Hossein Golestani 
> wrote:
>
>> [I'm resending my reply without the attachments in case they caused
>> it to get into the spam folder.]
>>
>> Hi Krishnan,
>>
>> I remember that I also failed to build m5threads on a particular
>> system, but I managed to build it on another system with a relatively old
>> config (I have attached the output m5threads object files for x86 and ARM
>> v7 to this email). If I remember correctly, that system had the Linux
>> kernel 3.19 and gcc 4.8. You should be able to link the attached object
>> file to your multi-threaded program compiled on a system with a newer
>> kernel/compiler. Hope this helps.
>>
>> Thanks,
>> Hossein
>>
>>
>> On Sat, Jul 24, 2021 at 11:24 PM krishnan gosakan <
>> krishnan.gosa...@gmail.com> wrote:
>>
>>> Hi Hossein,
>>> I tried building m5threads but it failed. What system configuration
>>> are you using to build m5threads?
>>> What kernel version do you use and what compiler do you use?
>>>
>>> On Sat, Jul 24, 2021 at 10:28 PM Hossein Golestani <
>>> hosse...@umich.edu> wrote:
>>>
 Hi Krishnan,

 I use m5threads, which is a light-weight alternative for
 pthread, to simulate multi-threaded programs in the SE mode:
 https://github.com/gem5/m5threads
 (I'm not sure if there are any other ways.)

 Thanks,
 Hossein


 On Sat, Jul 24, 2021 at 11:00 AM krishnan gosakan via gem5-users <
 gem5-users@gem5.org> wrote:

> Hi all,
> I am trying to run a code with pthread in gem5 se mode. The code
> runs perfectly when launched from command prompt but pthread_create 
> returns
> error code 11 whe

[gem5-users] Re: Running pthread in gem5 se mode

2021-10-04 Thread VIPIN PATEL via gem5-users
Hi Krishan,

I also faced a similar issue while executing the pthread program in SE
mode. It seems the number of core should be equal to the maximum number of
core you are trying to execute.
For example: If you are launching 4 thread with pthread_create, the number
of cores should be at least 5 (4 cores: one for each thread + 1 core for
master thread).

Hope it helps.

Regards,
Vipin

On Mon, Aug 23, 2021 at 9:55 PM krishnan gosakan via gem5-users <
gem5-users@gem5.org> wrote:

> I am facing a new problem with running multithreaded applications compiled
> with m5threads on gem5 in SE mode.
> The application I am using has 4 threads and all 4 threads work on the
> same function. The application is a breadth first search algorithm which
> works on a large graph.
> So, I have 4 threads which do bfs independently. When I run this in gem5
> SE mode, I see that the first thread is created and it does all the bfs
> work and the remaining 3 threads just get created and the program exits (I
> mean they don't do any work in the bfs function).
> I see this is something similar to sequential execution.
> I guess I am missing some command line argument but can't find what it is.
> I am using the default CPU which is AtomicSimpleCPU (as I don't use cpu
> argument) and use 4 cores (as I have 4 threads).
> Any help would be appreciated.
>
> On Sat, Aug 7, 2021 at 9:10 PM Hossein Golestani 
> wrote:
>
>> Hi Krishnan,
>>
>> The SE mode does not have any thread scheduler. You should have as many
>> cores as the maximum number threads your program may launch. In your
>> example, since your program has two threads, two cores are needed, each
>> running of the threads.
>>
>> Thanks,
>> Hossein
>>
>>
>> On Fri, Aug 6, 2021 at 5:16 AM krishnan gosakan <
>> krishnan.gosa...@gmail.com> wrote:
>>
>>> Seems like this problem arise only when number of cores is set to 1.
>>> When I increase the number of cores, I see that pthread_join is working
>>> perfectly.
>>> Not sure if this is kind of a limitation.
>>> Any idea?
>>>
>>> On Fri, Aug 6, 2021 at 11:16 AM krishnan gosakan <
>>> krishnan.gosa...@gmail.com> wrote:
>>>
 Hi Hossein,
 I used the m5thread_x86.o file and compiled my sample code (attached
 with this mail). I used the following 2 commands to build my file

 gcc -g -O3 -c -o semodePthread.o semodePthread.c
 gcc -static -o semodePthread semodePthread.o m5threads_x86.o

 By running semodePthread in gem5 se mode, I see that pthread_create is
 succeeding but it gets stuck in pthread_join. Also I see printf in thread
 function is not running.
 Am I missing something? Or am I building it wrong?
 ANy suggestions would be greatly appreciated.

 On Mon, Jul 26, 2021 at 2:03 AM Hossein Golestani 
 wrote:

> [I'm resending my reply without the attachments in case they caused it
> to get into the spam folder.]
>
> Hi Krishnan,
>
> I remember that I also failed to build m5threads on a particular
> system, but I managed to build it on another system with a relatively old
> config (I have attached the output m5threads object files for x86 and ARM
> v7 to this email). If I remember correctly, that system had the Linux
> kernel 3.19 and gcc 4.8. You should be able to link the attached object
> file to your multi-threaded program compiled on a system with a newer
> kernel/compiler. Hope this helps.
>
> Thanks,
> Hossein
>
>
> On Sat, Jul 24, 2021 at 11:24 PM krishnan gosakan <
> krishnan.gosa...@gmail.com> wrote:
>
>> Hi Hossein,
>> I tried building m5threads but it failed. What system configuration
>> are you using to build m5threads?
>> What kernel version do you use and what compiler do you use?
>>
>> On Sat, Jul 24, 2021 at 10:28 PM Hossein Golestani <
>> hosse...@umich.edu> wrote:
>>
>>> Hi Krishnan,
>>>
>>> I use m5threads, which is a light-weight alternative for pthread, to
>>> simulate multi-threaded programs in the SE mode:
>>> https://github.com/gem5/m5threads
>>> (I'm not sure if there are any other ways.)
>>>
>>> Thanks,
>>> Hossein
>>>
>>>
>>> On Sat, Jul 24, 2021 at 11:00 AM krishnan gosakan via gem5-users <
>>> gem5-users@gem5.org> wrote:
>>>
 Hi all,
 I am trying to run a code with pthread in gem5 se mode. The code
 runs perfectly when launched from command prompt but pthread_create 
 returns
 error code 11 when run in se mode. Is there anything special I should 
 do to
 make pthread run in se mode. From the tests directory, I see that C++
 std::thread is running perfectly in gem5 se mode. Any help would be
 appreciated.
 Thank you.

 Sample code I use in gem5 se mode

 #include 
 #include 

 void *doWork1(void *arg)
 {
 for (int i=0; i<10