gem5-users@gem5.org

The gem5 Users mailing list

View all threads

Creating Checkpoints

CP
Chrysanthos Pepi
Mon, Sep 5, 2022 10:31 PM

Hello All,

I want to create checkpoints after a FS Ubuntu boot up with KVM and then use that checkpoint to run multiple benchmarks with Timing/O3. Right now I am using x86-ubuntu-run-with-kvm.pyhttps://github.com/gem5/gem5/blob/stable/configs/example/gem5_library/x86-ubuntu-run-with-kvm.py script to do that and it successfully boots up and I am able to connect with the m5term to view the process.

I slightly modified the script to add the m5 checkpoint; command, according to thishttps://www.gem5.org/documentation/general_docs/checkpoints/, and it look like this:

command = "m5 exit;"
+ "echo 'This is running on Timing CPU cores.';"
+ "m5 checkpoint;" \ # Save a checkpoint
+ "sleep 1;" \ # Run a benchmark
+ "m5 exit;"

My understanding is that, on the 1st m5 exit it switches from KVM to Timing so I want to get a checkpoint and later run a benchmark. I tried that and I am able to see the echo message but then it terminates. Then I tried to execute the same command trough m5term but still the same result (attach log files)

Kind regards,
Chrysanthos Pepi

Hello All, I want to create checkpoints after a FS Ubuntu boot up with KVM and then use that checkpoint to run multiple benchmarks with Timing/O3. Right now I am using x86-ubuntu-run-with-kvm.py<https://github.com/gem5/gem5/blob/stable/configs/example/gem5_library/x86-ubuntu-run-with-kvm.py> script to do that and it successfully boots up and I am able to connect with the m5term to view the process. I slightly modified the script to add the `m5 checkpoint;` command, according to this<https://www.gem5.org/documentation/general_docs/checkpoints/>, and it look like this: command = "m5 exit;" \ + "echo 'This is running on Timing CPU cores.';" \ + "m5 checkpoint;" \ # Save a checkpoint + "sleep 1;" \ # Run a benchmark + "m5 exit;" My understanding is that, on the 1st m5 exit it switches from KVM to Timing so I want to get a checkpoint and later run a benchmark. I tried that and I am able to see the echo message but then it terminates. Then I tried to execute the same command trough m5term but still the same result (attach log files) Kind regards, Chrysanthos Pepi
BB
Bobby Bruce
Tue, Sep 6, 2022 5:38 PM

You need to explicitly state what you want to do at the "m5 checkpoint"
exit event, otherwise it'll just default to a regular exit.

You'll need to change the "on_exit_event" parameter when constructing the
Simulator. Something like this:

...

def create_checkpoint():
    m5.checkpoint("<path to checkpoint>")

simulator = Simulator(
    board=board,
    on_exit_event={
    ExitEvent.EXIT : (func() for func in [processor.switch]),
    ExitEvent.CHECKPOINT: (func() for func in [create_checkpoint]),
},

...

Note here we're saying on the first EXIT (m5 exit) exit event we're
switching cores, and on the first CHECKPOINT(m5 checkpoint) exit event
we're creating the checkpoint.

--
Dr. Bobby R. Bruce
Room 3050,
Kemper Hall, UC Davis
Davis,
CA, 95616

web: https://www.bobbybruce.net

On Mon, Sep 5, 2022 at 3:31 PM Chrysanthos Pepi cpepi001@outlook.com
wrote:

Hello All,

I want to create checkpoints after a FS Ubuntu boot up with KVM and then

use that checkpoint to run multiple benchmarks with Timing/O3. Right now I
am using x86-ubuntu-run-with-kvm.py script to do that and it successfully
boots up and I am able to connect with the m5term to view the process.

I slightly modified the script to add the m5 checkpoint; command,

according to this, and it look like this:

command = "m5 exit;" \

     + "echo 'This is running on Timing CPU cores.';" \

     + "m5 checkpoint;" \ # Save a checkpoint

     + "sleep 1;" \ # Run a benchmark

     + "m5 exit;"

My understanding is that, on the 1st m5 exit it switches from KVM to

Timing so I want to get a checkpoint and later run a benchmark. I tried
that and I am able to see the echo message but then it terminates. Then I
tried to execute the same command trough m5term but still the same result
(attach log files)

Kind regards,

Chrysanthos Pepi


gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-leave@gem5.org

You need to explicitly state what you want to do at the "m5 checkpoint" exit event, otherwise it'll just default to a regular exit. You'll need to change the "on_exit_event" parameter when constructing the Simulator. Something like this: ``` ... def create_checkpoint(): m5.checkpoint("<path to checkpoint>") simulator = Simulator( board=board, on_exit_event={ ExitEvent.EXIT : (func() for func in [processor.switch]), ExitEvent.CHECKPOINT: (func() for func in [create_checkpoint]), }, ... ``` Note here we're saying on the first EXIT (m5 exit) exit event we're switching cores, and on the first CHECKPOINT(m5 checkpoint) exit event we're creating the checkpoint. -- Dr. Bobby R. Bruce Room 3050, Kemper Hall, UC Davis Davis, CA, 95616 web: https://www.bobbybruce.net On Mon, Sep 5, 2022 at 3:31 PM Chrysanthos Pepi <cpepi001@outlook.com> wrote: > > Hello All, > > > > I want to create checkpoints after a FS Ubuntu boot up with KVM and then use that checkpoint to run multiple benchmarks with Timing/O3. Right now I am using x86-ubuntu-run-with-kvm.py script to do that and it successfully boots up and I am able to connect with the m5term to view the process. > > > > I slightly modified the script to add the `m5 checkpoint;` command, according to this, and it look like this: > > > > command = "m5 exit;" \ > > + "echo 'This is running on Timing CPU cores.';" \ > > + "m5 checkpoint;" \ # Save a checkpoint > > + "sleep 1;" \ # Run a benchmark > > + "m5 exit;" > > > > My understanding is that, on the 1st m5 exit it switches from KVM to Timing so I want to get a checkpoint and later run a benchmark. I tried that and I am able to see the echo message but then it terminates. Then I tried to execute the same command trough m5term but still the same result (attach log files) > > > > Kind regards, > > Chrysanthos Pepi > > > > _______________________________________________ > gem5-users mailing list -- gem5-users@gem5.org > To unsubscribe send an email to gem5-users-leave@gem5.org
CP
Chrysanthos Pepi
Tue, Sep 6, 2022 9:42 PM

Hi Dr. Bruce,

Thank you for your reply. In order to create checkpoints do I need to use MOESI hammer protocol or classic caches?

Kind regards,
Chrysanthos Pepi

From: Bobby Brucemailto:bbruce@ucdavis.edu
Sent: Tuesday, September 6, 2022 12:46
To: The gem5 Users mailing listmailto:gem5-users@gem5.org
Subject: [gem5-users] Re: Creating Checkpoints

You need to explicitly state what you want to do at the "m5 checkpoint" exit event, otherwise it'll just default to a regular exit.

You'll need to change the "on_exit_event" parameter when constructing the Simulator. Something like this:

...

def create_checkpoint():
    m5.checkpoint("<path to checkpoint>")

simulator = Simulator(
    board=board,
    on_exit_event={
    ExitEvent.EXIT : (func() for func in [processor.switch]),
    ExitEvent.CHECKPOINT: (func() for func in [create_checkpoint]),
},

...

Note here we're saying on the first EXIT (m5 exit) exit event we're switching cores, and on the first CHECKPOINT(m5 checkpoint) exit event we're creating the checkpoint.

--
Dr. Bobby R. Bruce
Room 3050,
Kemper Hall, UC Davis
Davis,
CA, 95616

web: https://www.bobbybruce.net

On Mon, Sep 5, 2022 at 3:31 PM Chrysanthos Pepi <cpepi001@outlook.commailto:cpepi001@outlook.com> wrote:

Hello All,

I want to create checkpoints after a FS Ubuntu boot up with KVM and then use that checkpoint to run multiple benchmarks with Timing/O3. Right now I am using x86-ubuntu-run-with-kvm.py script to do that and it successfully boots up and I am able to connect with the m5term to view the process.

I slightly modified the script to add the m5 checkpoint; command, according to this, and it look like this:

command = "m5 exit;" \

     + "echo 'This is running on Timing CPU cores.';" \

     + "m5 checkpoint;" \ # Save a checkpoint

     + "sleep 1;" \ # Run a benchmark

     + "m5 exit;"

My understanding is that, on the 1st m5 exit it switches from KVM to Timing so I want to get a checkpoint and later run a benchmark. I tried that and I am able to see the echo message but then it terminates. Then I tried to execute the same command trough m5term but still the same result (attach log files)

Kind regards,

Chrysanthos Pepi


gem5-users mailing list -- gem5-users@gem5.orgmailto:gem5-users@gem5.org
To unsubscribe send an email to gem5-users-leave@gem5.orgmailto:gem5-users-leave@gem5.org

Hi Dr. Bruce, Thank you for your reply. In order to create checkpoints do I need to use MOESI hammer protocol or classic caches? Kind regards, Chrysanthos Pepi From: Bobby Bruce<mailto:bbruce@ucdavis.edu> Sent: Tuesday, September 6, 2022 12:46 To: The gem5 Users mailing list<mailto:gem5-users@gem5.org> Subject: [gem5-users] Re: Creating Checkpoints You need to explicitly state what you want to do at the "m5 checkpoint" exit event, otherwise it'll just default to a regular exit. You'll need to change the "on_exit_event" parameter when constructing the Simulator. Something like this: ``` ... def create_checkpoint(): m5.checkpoint("<path to checkpoint>") simulator = Simulator( board=board, on_exit_event={ ExitEvent.EXIT : (func() for func in [processor.switch]), ExitEvent.CHECKPOINT: (func() for func in [create_checkpoint]), }, ... ``` Note here we're saying on the first EXIT (m5 exit) exit event we're switching cores, and on the first CHECKPOINT(m5 checkpoint) exit event we're creating the checkpoint. -- Dr. Bobby R. Bruce Room 3050, Kemper Hall, UC Davis Davis, CA, 95616 web: https://www.bobbybruce.net On Mon, Sep 5, 2022 at 3:31 PM Chrysanthos Pepi <cpepi001@outlook.com<mailto:cpepi001@outlook.com>> wrote: > > Hello All, > > > > I want to create checkpoints after a FS Ubuntu boot up with KVM and then use that checkpoint to run multiple benchmarks with Timing/O3. Right now I am using x86-ubuntu-run-with-kvm.py script to do that and it successfully boots up and I am able to connect with the m5term to view the process. > > > > I slightly modified the script to add the `m5 checkpoint;` command, according to this, and it look like this: > > > > command = "m5 exit;" \ > > + "echo 'This is running on Timing CPU cores.';" \ > > + "m5 checkpoint;" \ # Save a checkpoint > > + "sleep 1;" \ # Run a benchmark > > + "m5 exit;" > > > > My understanding is that, on the 1st m5 exit it switches from KVM to Timing so I want to get a checkpoint and later run a benchmark. I tried that and I am able to see the echo message but then it terminates. Then I tried to execute the same command trough m5term but still the same result (attach log files) > > > > Kind regards, > > Chrysanthos Pepi > > > > _______________________________________________ > gem5-users mailing list -- gem5-users@gem5.org<mailto:gem5-users@gem5.org> > To unsubscribe send an email to gem5-users-leave@gem5.org<mailto:gem5-users-leave@gem5.org>
BB
Bobby Bruce
Tue, Sep 6, 2022 11:50 PM

There are two restrictions with Ruby and checkpointing that I'm aware of:

  1. You have to use MOESI_hammer or another protocol that implements that
    flush function.
  2. If you take a checkpoint in Ruby it has to be restored with Ruby.

I don't believe there are any such restrictions with classic caches.

--
Dr. Bobby R. Bruce
Room 3050,
Kemper Hall, UC Davis
Davis,
CA, 95616

web: https://www.bobbybruce.net

On Tue, Sep 6, 2022 at 2:42 PM Chrysanthos Pepi cpepi001@outlook.com
wrote:

Hi Dr. Bruce,

Thank you for your reply. In order to create checkpoints do I need to use
MOESI hammer protocol or classic caches?

Kind regards,

Chrysanthos Pepi

*From: *Bobby Bruce bbruce@ucdavis.edu
*Sent: *Tuesday, September 6, 2022 12:46
*To: *The gem5 Users mailing list gem5-users@gem5.org
*Subject: *[gem5-users] Re: Creating Checkpoints

You need to explicitly state what you want to do at the "m5 checkpoint"
exit event, otherwise it'll just default to a regular exit.

You'll need to change the "on_exit_event" parameter when constructing the
Simulator. Something like this:


...



def create_checkpoint():

    m5.checkpoint("<path to checkpoint>")


simulator = Simulator(
    board=board,
    on_exit_event={
    ExitEvent.EXIT : (func() for func in [processor.switch]),

    ExitEvent.CHECKPOINT: (func() for func in [create_checkpoint]),
},



...

Note here we're saying on the first EXIT (m5 exit) exit event we're
switching cores, and on the first CHECKPOINT(m5 checkpoint) exit event
we're creating the checkpoint.

--
Dr. Bobby R. Bruce
Room 3050,
Kemper Hall, UC Davis
Davis,
CA, 95616

web: https://www.bobbybruce.net

On Mon, Sep 5, 2022 at 3:31 PM Chrysanthos Pepi cpepi001@outlook.com
wrote:

Hello All,

I want to create checkpoints after a FS Ubuntu boot up with KVM and then

use that checkpoint to run multiple benchmarks with Timing/O3. Right now I
am using x86-ubuntu-run-with-kvm.py script to do that and it successfully
boots up and I am able to connect with the m5term to view the process.

I slightly modified the script to add the m5 checkpoint; command,

according to this, and it look like this:

command = "m5 exit;" \

     + "echo 'This is running on Timing CPU cores.';" \

     + "m5 checkpoint;" \ # Save a checkpoint

     + "sleep 1;" \ # Run a benchmark

     + "m5 exit;"

My understanding is that, on the 1st m5 exit it switches from KVM to

Timing so I want to get a checkpoint and later run a benchmark. I tried
that and I am able to see the echo message but then it terminates. Then I
tried to execute the same command trough m5term but still the same result
(attach log files)

Kind regards,

Chrysanthos Pepi


gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-leave@gem5.org


gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-leave@gem5.org

There are two restrictions with Ruby and checkpointing that I'm aware of: 1. You have to use MOESI_hammer or another protocol that implements that flush function. 2. If you take a checkpoint in Ruby it has to be restored with Ruby. I don't believe there are any such restrictions with classic caches. -- Dr. Bobby R. Bruce Room 3050, Kemper Hall, UC Davis Davis, CA, 95616 web: https://www.bobbybruce.net On Tue, Sep 6, 2022 at 2:42 PM Chrysanthos Pepi <cpepi001@outlook.com> wrote: > Hi Dr. Bruce, > > > > Thank you for your reply. In order to create checkpoints do I need to use > MOESI hammer protocol or classic caches? > > > > Kind regards, > > Chrysanthos Pepi > > > > *From: *Bobby Bruce <bbruce@ucdavis.edu> > *Sent: *Tuesday, September 6, 2022 12:46 > *To: *The gem5 Users mailing list <gem5-users@gem5.org> > *Subject: *[gem5-users] Re: Creating Checkpoints > > > > You need to explicitly state what you want to do at the "m5 checkpoint" > exit event, otherwise it'll just default to a regular exit. > > You'll need to change the "on_exit_event" parameter when constructing the > Simulator. Something like this: > > ``` > > ... > > > > def create_checkpoint(): > > m5.checkpoint("<path to checkpoint>") > > > simulator = Simulator( > board=board, > on_exit_event={ > ExitEvent.EXIT : (func() for func in [processor.switch]), > > ExitEvent.CHECKPOINT: (func() for func in [create_checkpoint]), > }, > > > > ... > > ``` > > > Note here we're saying on the first EXIT (m5 exit) exit event we're > switching cores, and on the first CHECKPOINT(m5 checkpoint) exit event > we're creating the checkpoint. > > -- > Dr. Bobby R. Bruce > Room 3050, > Kemper Hall, UC Davis > Davis, > CA, 95616 > > web: https://www.bobbybruce.net > > > On Mon, Sep 5, 2022 at 3:31 PM Chrysanthos Pepi <cpepi001@outlook.com> > wrote: > > > > Hello All, > > > > > > > > I want to create checkpoints after a FS Ubuntu boot up with KVM and then > use that checkpoint to run multiple benchmarks with Timing/O3. Right now I > am using x86-ubuntu-run-with-kvm.py script to do that and it successfully > boots up and I am able to connect with the m5term to view the process. > > > > > > > > I slightly modified the script to add the `m5 checkpoint;` command, > according to this, and it look like this: > > > > > > > > command = "m5 exit;" \ > > > > + "echo 'This is running on Timing CPU cores.';" \ > > > > + "m5 checkpoint;" \ # Save a checkpoint > > > > + "sleep 1;" \ # Run a benchmark > > > > + "m5 exit;" > > > > > > > > My understanding is that, on the 1st m5 exit it switches from KVM to > Timing so I want to get a checkpoint and later run a benchmark. I tried > that and I am able to see the echo message but then it terminates. Then I > tried to execute the same command trough m5term but still the same result > (attach log files) > > > > > > > > Kind regards, > > > > Chrysanthos Pepi > > > > > > > > _______________________________________________ > > gem5-users mailing list -- gem5-users@gem5.org > > To unsubscribe send an email to gem5-users-leave@gem5.org > > > _______________________________________________ > gem5-users mailing list -- gem5-users@gem5.org > To unsubscribe send an email to gem5-users-leave@gem5.org >
CP
Chrysanthos Pepi
Wed, Sep 7, 2022 7:02 PM

Thank you,

I modified the script to use classic caches and I was able to create a checkpoint.

Now, in order to restore it and run command/benchmark, we can pass the checkpoint_path into the Simulator and change the processor type from SimpleSwitchapleProcessor to SimpleProcessor?

I did that and the simulation started, connected with m5term but it stuck at “==== m5 terminal: Terminal 0 ====”

Kind regards,
Chrysanthos Pepi

From: Bobby Brucemailto:bbruce@ucdavis.edu
Sent: Tuesday, September 6, 2022 18:51
To: The gem5 Users mailing listmailto:gem5-users@gem5.org
Subject: [gem5-users] Re: Creating Checkpoints

There are two restrictions with Ruby and checkpointing that I'm aware of:

  1. You have to use MOESI_hammer or another protocol that implements that flush function.
  2. If you take a checkpoint in Ruby it has to be restored with Ruby.

I don't believe there are any such restrictions with classic caches.

--
Dr. Bobby R. Bruce
Room 3050,
Kemper Hall, UC Davis
Davis,
CA, 95616

web: https://www.bobbybruce.net

On Tue, Sep 6, 2022 at 2:42 PM Chrysanthos Pepi <cpepi001@outlook.commailto:cpepi001@outlook.com> wrote:
Hi Dr. Bruce,

Thank you for your reply. In order to create checkpoints do I need to use MOESI hammer protocol or classic caches?

Kind regards,
Chrysanthos Pepi

From: Bobby Brucemailto:bbruce@ucdavis.edu
Sent: Tuesday, September 6, 2022 12:46
To: The gem5 Users mailing listmailto:gem5-users@gem5.org
Subject: [gem5-users] Re: Creating Checkpoints

You need to explicitly state what you want to do at the "m5 checkpoint" exit event, otherwise it'll just default to a regular exit.

You'll need to change the "on_exit_event" parameter when constructing the Simulator. Something like this:

...

def create_checkpoint():
    m5.checkpoint("<path to checkpoint>")

simulator = Simulator(
    board=board,
    on_exit_event={
    ExitEvent.EXIT : (func() for func in [processor.switch]),
    ExitEvent.CHECKPOINT: (func() for func in [create_checkpoint]),
},

...

Note here we're saying on the first EXIT (m5 exit) exit event we're switching cores, and on the first CHECKPOINT(m5 checkpoint) exit event we're creating the checkpoint.

--
Dr. Bobby R. Bruce
Room 3050,
Kemper Hall, UC Davis
Davis,
CA, 95616

web: https://www.bobbybruce.net

On Mon, Sep 5, 2022 at 3:31 PM Chrysanthos Pepi <cpepi001@outlook.commailto:cpepi001@outlook.com> wrote:

Hello All,

I want to create checkpoints after a FS Ubuntu boot up with KVM and then use that checkpoint to run multiple benchmarks with Timing/O3. Right now I am using x86-ubuntu-run-with-kvm.py script to do that and it successfully boots up and I am able to connect with the m5term to view the process.

I slightly modified the script to add the m5 checkpoint; command, according to this, and it look like this:

command = "m5 exit;" \

     + "echo 'This is running on Timing CPU cores.';" \

     + "m5 checkpoint;" \ # Save a checkpoint

     + "sleep 1;" \ # Run a benchmark

     + "m5 exit;"

My understanding is that, on the 1st m5 exit it switches from KVM to Timing so I want to get a checkpoint and later run a benchmark. I tried that and I am able to see the echo message but then it terminates. Then I tried to execute the same command trough m5term but still the same result (attach log files)

Kind regards,

Chrysanthos Pepi


gem5-users mailing list -- gem5-users@gem5.orgmailto:gem5-users@gem5.org
To unsubscribe send an email to gem5-users-leave@gem5.orgmailto:gem5-users-leave@gem5.org

Thank you, I modified the script to use classic caches and I was able to create a checkpoint. Now, in order to restore it and run command/benchmark, we can pass the checkpoint_path into the Simulator and change the processor type from SimpleSwitchapleProcessor to SimpleProcessor? I did that and the simulation started, connected with m5term but it stuck at “==== m5 terminal: Terminal 0 ====” Kind regards, Chrysanthos Pepi From: Bobby Bruce<mailto:bbruce@ucdavis.edu> Sent: Tuesday, September 6, 2022 18:51 To: The gem5 Users mailing list<mailto:gem5-users@gem5.org> Subject: [gem5-users] Re: Creating Checkpoints There are two restrictions with Ruby and checkpointing that I'm aware of: 1. You have to use MOESI_hammer or another protocol that implements that flush function. 2. If you take a checkpoint in Ruby it has to be restored with Ruby. I don't believe there are any such restrictions with classic caches. -- Dr. Bobby R. Bruce Room 3050, Kemper Hall, UC Davis Davis, CA, 95616 web: https://www.bobbybruce.net On Tue, Sep 6, 2022 at 2:42 PM Chrysanthos Pepi <cpepi001@outlook.com<mailto:cpepi001@outlook.com>> wrote: Hi Dr. Bruce, Thank you for your reply. In order to create checkpoints do I need to use MOESI hammer protocol or classic caches? Kind regards, Chrysanthos Pepi From: Bobby Bruce<mailto:bbruce@ucdavis.edu> Sent: Tuesday, September 6, 2022 12:46 To: The gem5 Users mailing list<mailto:gem5-users@gem5.org> Subject: [gem5-users] Re: Creating Checkpoints You need to explicitly state what you want to do at the "m5 checkpoint" exit event, otherwise it'll just default to a regular exit. You'll need to change the "on_exit_event" parameter when constructing the Simulator. Something like this: ``` ... def create_checkpoint(): m5.checkpoint("<path to checkpoint>") simulator = Simulator( board=board, on_exit_event={ ExitEvent.EXIT : (func() for func in [processor.switch]), ExitEvent.CHECKPOINT: (func() for func in [create_checkpoint]), }, ... ``` Note here we're saying on the first EXIT (m5 exit) exit event we're switching cores, and on the first CHECKPOINT(m5 checkpoint) exit event we're creating the checkpoint. -- Dr. Bobby R. Bruce Room 3050, Kemper Hall, UC Davis Davis, CA, 95616 web: https://www.bobbybruce.net On Mon, Sep 5, 2022 at 3:31 PM Chrysanthos Pepi <cpepi001@outlook.com<mailto:cpepi001@outlook.com>> wrote: > > Hello All, > > > > I want to create checkpoints after a FS Ubuntu boot up with KVM and then use that checkpoint to run multiple benchmarks with Timing/O3. Right now I am using x86-ubuntu-run-with-kvm.py script to do that and it successfully boots up and I am able to connect with the m5term to view the process. > > > > I slightly modified the script to add the `m5 checkpoint;` command, according to this, and it look like this: > > > > command = "m5 exit;" \ > > + "echo 'This is running on Timing CPU cores.';" \ > > + "m5 checkpoint;" \ # Save a checkpoint > > + "sleep 1;" \ # Run a benchmark > > + "m5 exit;" > > > > My understanding is that, on the 1st m5 exit it switches from KVM to Timing so I want to get a checkpoint and later run a benchmark. I tried that and I am able to see the echo message but then it terminates. Then I tried to execute the same command trough m5term but still the same result (attach log files) > > > > Kind regards, > > Chrysanthos Pepi > > > > _______________________________________________ > gem5-users mailing list -- gem5-users@gem5.org<mailto:gem5-users@gem5.org> > To unsubscribe send an email to gem5-users-leave@gem5.org<mailto:gem5-users-leave@gem5.org> _______________________________________________ gem5-users mailing list -- gem5-users@gem5.org<mailto:gem5-users@gem5.org> To unsubscribe send an email to gem5-users-leave@gem5.org<mailto:gem5-users-leave@gem5.org>
BB
Bobby Bruce
Thu, Sep 8, 2022 9:20 PM

Hey Chrysanthos,

My first thought here is the disk image I believe you are using, by
default, will exit once booted. I suspect you'll have to set
readfile_contents="/bin/bash" or something like that on your set_workload
function to be able to m5term into the simulation.

Could you send the config file you've built and the terminal output you're
seeing?

Kind regards,
Bobby

Dr. Bobby R. Bruce
Room 3050,
Kemper Hall, UC Davis
Davis,
CA, 95616

web: https://www.bobbybruce.net

On Wed, Sep 7, 2022 at 12:03 PM Chrysanthos Pepi cpepi001@outlook.com
wrote:

Thank you,

I modified the script to use classic caches and I was able to create a
checkpoint.

Now, in order to restore it and run command/benchmark, we can pass the
checkpoint_path into the Simulator and change the processor type from
SimpleSwitchapleProcessor to SimpleProcessor?

I did that and the simulation started, connected with m5term but it stuck
at “==== m5 terminal: Terminal 0 ====”

Kind regards,

Chrysanthos Pepi

*From: *Bobby Bruce bbruce@ucdavis.edu
*Sent: *Tuesday, September 6, 2022 18:51
*To: *The gem5 Users mailing list gem5-users@gem5.org
*Subject: *[gem5-users] Re: Creating Checkpoints

There are two restrictions with Ruby and checkpointing that I'm aware of:

  1. You have to use MOESI_hammer or another protocol that implements that
    flush function.

  2. If you take a checkpoint in Ruby it has to be restored with Ruby.

I don't believe there are any such restrictions with classic caches.

--

Dr. Bobby R. Bruce
Room 3050,
Kemper Hall, UC Davis
Davis,
CA, 95616

web: https://www.bobbybruce.net

On Tue, Sep 6, 2022 at 2:42 PM Chrysanthos Pepi cpepi001@outlook.com
wrote:

Hi Dr. Bruce,

Thank you for your reply. In order to create checkpoints do I need to use
MOESI hammer protocol or classic caches?

Kind regards,

Chrysanthos Pepi

*From: *Bobby Bruce bbruce@ucdavis.edu
*Sent: *Tuesday, September 6, 2022 12:46
*To: *The gem5 Users mailing list gem5-users@gem5.org
*Subject: *[gem5-users] Re: Creating Checkpoints

You need to explicitly state what you want to do at the "m5 checkpoint"
exit event, otherwise it'll just default to a regular exit.

You'll need to change the "on_exit_event" parameter when constructing the
Simulator. Something like this:


...



def create_checkpoint():

    m5.checkpoint("<path to checkpoint>")


simulator = Simulator(
    board=board,
    on_exit_event={
    ExitEvent.EXIT : (func() for func in [processor.switch]),

    ExitEvent.CHECKPOINT: (func() for func in [create_checkpoint]),
},



...

Note here we're saying on the first EXIT (m5 exit) exit event we're
switching cores, and on the first CHECKPOINT(m5 checkpoint) exit event
we're creating the checkpoint.

--
Dr. Bobby R. Bruce
Room 3050,
Kemper Hall, UC Davis
Davis,
CA, 95616

web: https://www.bobbybruce.net

On Mon, Sep 5, 2022 at 3:31 PM Chrysanthos Pepi cpepi001@outlook.com
wrote:

Hello All,

I want to create checkpoints after a FS Ubuntu boot up with KVM and then

use that checkpoint to run multiple benchmarks with Timing/O3. Right now I
am using x86-ubuntu-run-with-kvm.py script to do that and it successfully
boots up and I am able to connect with the m5term to view the process.

I slightly modified the script to add the m5 checkpoint; command,

according to this, and it look like this:

command = "m5 exit;" \

     + "echo 'This is running on Timing CPU cores.';" \

     + "m5 checkpoint;" \ # Save a checkpoint

     + "sleep 1;" \ # Run a benchmark

     + "m5 exit;"

My understanding is that, on the 1st m5 exit it switches from KVM to

Timing so I want to get a checkpoint and later run a benchmark. I tried
that and I am able to see the echo message but then it terminates. Then I
tried to execute the same command trough m5term but still the same result
(attach log files)

Kind regards,

Chrysanthos Pepi


gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-leave@gem5.org


gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-leave@gem5.org


gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-leave@gem5.org

Hey Chrysanthos, My first thought here is the disk image I believe you are using, by default, will exit once booted. I suspect you'll have to set `readfile_contents="/bin/bash"` or something like that on your set_workload function to be able to m5term into the simulation. Could you send the config file you've built and the terminal output you're seeing? Kind regards, Bobby -- Dr. Bobby R. Bruce Room 3050, Kemper Hall, UC Davis Davis, CA, 95616 web: https://www.bobbybruce.net On Wed, Sep 7, 2022 at 12:03 PM Chrysanthos Pepi <cpepi001@outlook.com> wrote: > Thank you, > > > > I modified the script to use classic caches and I was able to create a > checkpoint. > > > > Now, in order to restore it and run command/benchmark, we can pass the > checkpoint_path into the Simulator and change the processor type from > SimpleSwitchapleProcessor to SimpleProcessor? > > > > I did that and the simulation started, connected with m5term but it stuck > at “==== m5 terminal: Terminal 0 ====” > > > > Kind regards, > > Chrysanthos Pepi > > > > *From: *Bobby Bruce <bbruce@ucdavis.edu> > *Sent: *Tuesday, September 6, 2022 18:51 > *To: *The gem5 Users mailing list <gem5-users@gem5.org> > *Subject: *[gem5-users] Re: Creating Checkpoints > > > > There are two restrictions with Ruby and checkpointing that I'm aware of: > > > > 1. You have to use MOESI_hammer or another protocol that implements that > flush function. > > 2. If you take a checkpoint in Ruby it has to be restored with Ruby. > > > > I don't believe there are any such restrictions with classic caches. > > > > -- > > Dr. Bobby R. Bruce > Room 3050, > Kemper Hall, UC Davis > Davis, > CA, 95616 > > > > web: https://www.bobbybruce.net > > > > > > On Tue, Sep 6, 2022 at 2:42 PM Chrysanthos Pepi <cpepi001@outlook.com> > wrote: > > Hi Dr. Bruce, > > > > Thank you for your reply. In order to create checkpoints do I need to use > MOESI hammer protocol or classic caches? > > > > Kind regards, > > Chrysanthos Pepi > > > > *From: *Bobby Bruce <bbruce@ucdavis.edu> > *Sent: *Tuesday, September 6, 2022 12:46 > *To: *The gem5 Users mailing list <gem5-users@gem5.org> > *Subject: *[gem5-users] Re: Creating Checkpoints > > > > You need to explicitly state what you want to do at the "m5 checkpoint" > exit event, otherwise it'll just default to a regular exit. > > You'll need to change the "on_exit_event" parameter when constructing the > Simulator. Something like this: > > ``` > > ... > > > > def create_checkpoint(): > > m5.checkpoint("<path to checkpoint>") > > > simulator = Simulator( > board=board, > on_exit_event={ > ExitEvent.EXIT : (func() for func in [processor.switch]), > > ExitEvent.CHECKPOINT: (func() for func in [create_checkpoint]), > }, > > > > ... > > ``` > > > Note here we're saying on the first EXIT (m5 exit) exit event we're > switching cores, and on the first CHECKPOINT(m5 checkpoint) exit event > we're creating the checkpoint. > > -- > Dr. Bobby R. Bruce > Room 3050, > Kemper Hall, UC Davis > Davis, > CA, 95616 > > web: https://www.bobbybruce.net > > > On Mon, Sep 5, 2022 at 3:31 PM Chrysanthos Pepi <cpepi001@outlook.com> > wrote: > > > > Hello All, > > > > > > > > I want to create checkpoints after a FS Ubuntu boot up with KVM and then > use that checkpoint to run multiple benchmarks with Timing/O3. Right now I > am using x86-ubuntu-run-with-kvm.py script to do that and it successfully > boots up and I am able to connect with the m5term to view the process. > > > > > > > > I slightly modified the script to add the `m5 checkpoint;` command, > according to this, and it look like this: > > > > > > > > command = "m5 exit;" \ > > > > + "echo 'This is running on Timing CPU cores.';" \ > > > > + "m5 checkpoint;" \ # Save a checkpoint > > > > + "sleep 1;" \ # Run a benchmark > > > > + "m5 exit;" > > > > > > > > My understanding is that, on the 1st m5 exit it switches from KVM to > Timing so I want to get a checkpoint and later run a benchmark. I tried > that and I am able to see the echo message but then it terminates. Then I > tried to execute the same command trough m5term but still the same result > (attach log files) > > > > > > > > Kind regards, > > > > Chrysanthos Pepi > > > > > > > > _______________________________________________ > > gem5-users mailing list -- gem5-users@gem5.org > > To unsubscribe send an email to gem5-users-leave@gem5.org > > > > _______________________________________________ > gem5-users mailing list -- gem5-users@gem5.org > To unsubscribe send an email to gem5-users-leave@gem5.org > > > _______________________________________________ > gem5-users mailing list -- gem5-users@gem5.org > To unsubscribe send an email to gem5-users-leave@gem5.org >
CP
Chrysanthos Pepi
Fri, Sep 9, 2022 10:16 PM

Hi Bobby,

I attached the scripts and an output log (gem5, and m5term). I am not really sure how to properly restore the checkpoint and continue the readfile_contents commands. For now the command is an echo just to make it work and later I want to pass the benchmark to run.

Kind regards,
Chrysanthos Pepi

From: Bobby Brucemailto:bbruce@ucdavis.edu
Sent: Thursday, September 8, 2022 16:21
To: The gem5 Users mailing listmailto:gem5-users@gem5.org
Subject: [gem5-users] Re: Creating Checkpoints

Hey Chrysanthos,

My first thought here is the disk image I believe you are using, by default, will exit once booted. I suspect you'll have to set readfile_contents="/bin/bash" or something like that on your set_workload function to be able to m5term into the simulation.

Could you send the config file you've built and the terminal output you're seeing?

Kind regards,
Bobby

Dr. Bobby R. Bruce
Room 3050,
Kemper Hall, UC Davis
Davis,
CA, 95616

web: https://www.bobbybruce.net

On Wed, Sep 7, 2022 at 12:03 PM Chrysanthos Pepi <cpepi001@outlook.commailto:cpepi001@outlook.com> wrote:
Thank you,

I modified the script to use classic caches and I was able to create a checkpoint.

Now, in order to restore it and run command/benchmark, we can pass the checkpoint_path into the Simulator and change the processor type from SimpleSwitchapleProcessor to SimpleProcessor?

I did that and the simulation started, connected with m5term but it stuck at “==== m5 terminal: Terminal 0 ====”

Kind regards,
Chrysanthos Pepi

From: Bobby Brucemailto:bbruce@ucdavis.edu
Sent: Tuesday, September 6, 2022 18:51
To: The gem5 Users mailing listmailto:gem5-users@gem5.org
Subject: [gem5-users] Re: Creating Checkpoints

There are two restrictions with Ruby and checkpointing that I'm aware of:

  1. You have to use MOESI_hammer or another protocol that implements that flush function.
  2. If you take a checkpoint in Ruby it has to be restored with Ruby.

I don't believe there are any such restrictions with classic caches.

--
Dr. Bobby R. Bruce
Room 3050,
Kemper Hall, UC Davis
Davis,
CA, 95616

web: https://www.bobbybruce.net

On Tue, Sep 6, 2022 at 2:42 PM Chrysanthos Pepi <cpepi001@outlook.commailto:cpepi001@outlook.com> wrote:
Hi Dr. Bruce,

Thank you for your reply. In order to create checkpoints do I need to use MOESI hammer protocol or classic caches?

Kind regards,
Chrysanthos Pepi

From: Bobby Brucemailto:bbruce@ucdavis.edu
Sent: Tuesday, September 6, 2022 12:46
To: The gem5 Users mailing listmailto:gem5-users@gem5.org
Subject: [gem5-users] Re: Creating Checkpoints

You need to explicitly state what you want to do at the "m5 checkpoint" exit event, otherwise it'll just default to a regular exit.

You'll need to change the "on_exit_event" parameter when constructing the Simulator. Something like this:

...

def create_checkpoint():
    m5.checkpoint("<path to checkpoint>")

simulator = Simulator(
    board=board,
    on_exit_event={
    ExitEvent.EXIT : (func() for func in [processor.switch]),
    ExitEvent.CHECKPOINT: (func() for func in [create_checkpoint]),
},

...

Note here we're saying on the first EXIT (m5 exit) exit event we're switching cores, and on the first CHECKPOINT(m5 checkpoint) exit event we're creating the checkpoint.

--
Dr. Bobby R. Bruce
Room 3050,
Kemper Hall, UC Davis
Davis,
CA, 95616

web: https://www.bobbybruce.net

On Mon, Sep 5, 2022 at 3:31 PM Chrysanthos Pepi <cpepi001@outlook.commailto:cpepi001@outlook.com> wrote:

Hello All,

I want to create checkpoints after a FS Ubuntu boot up with KVM and then use that checkpoint to run multiple benchmarks with Timing/O3. Right now I am using x86-ubuntu-run-with-kvm.py script to do that and it successfully boots up and I am able to connect with the m5term to view the process.

I slightly modified the script to add the m5 checkpoint; command, according to this, and it look like this:

command = "m5 exit;" \

     + "echo 'This is running on Timing CPU cores.';" \

     + "m5 checkpoint;" \ # Save a checkpoint

     + "sleep 1;" \ # Run a benchmark

     + "m5 exit;"

My understanding is that, on the 1st m5 exit it switches from KVM to Timing so I want to get a checkpoint and later run a benchmark. I tried that and I am able to see the echo message but then it terminates. Then I tried to execute the same command trough m5term but still the same result (attach log files)

Kind regards,

Chrysanthos Pepi


gem5-users mailing list -- gem5-users@gem5.orgmailto:gem5-users@gem5.org
To unsubscribe send an email to gem5-users-leave@gem5.orgmailto:gem5-users-leave@gem5.org

Hi Bobby, I attached the scripts and an output log (gem5, and m5term). I am not really sure how to properly restore the checkpoint and continue the `readfile_contents` commands. For now the command is an echo just to make it work and later I want to pass the benchmark to run. Kind regards, Chrysanthos Pepi From: Bobby Bruce<mailto:bbruce@ucdavis.edu> Sent: Thursday, September 8, 2022 16:21 To: The gem5 Users mailing list<mailto:gem5-users@gem5.org> Subject: [gem5-users] Re: Creating Checkpoints Hey Chrysanthos, My first thought here is the disk image I believe you are using, by default, will exit once booted. I suspect you'll have to set `readfile_contents="/bin/bash"` or something like that on your set_workload function to be able to m5term into the simulation. Could you send the config file you've built and the terminal output you're seeing? Kind regards, Bobby -- Dr. Bobby R. Bruce Room 3050, Kemper Hall, UC Davis Davis, CA, 95616 web: https://www.bobbybruce.net On Wed, Sep 7, 2022 at 12:03 PM Chrysanthos Pepi <cpepi001@outlook.com<mailto:cpepi001@outlook.com>> wrote: Thank you, I modified the script to use classic caches and I was able to create a checkpoint. Now, in order to restore it and run command/benchmark, we can pass the checkpoint_path into the Simulator and change the processor type from SimpleSwitchapleProcessor to SimpleProcessor? I did that and the simulation started, connected with m5term but it stuck at “==== m5 terminal: Terminal 0 ====” Kind regards, Chrysanthos Pepi From: Bobby Bruce<mailto:bbruce@ucdavis.edu> Sent: Tuesday, September 6, 2022 18:51 To: The gem5 Users mailing list<mailto:gem5-users@gem5.org> Subject: [gem5-users] Re: Creating Checkpoints There are two restrictions with Ruby and checkpointing that I'm aware of: 1. You have to use MOESI_hammer or another protocol that implements that flush function. 2. If you take a checkpoint in Ruby it has to be restored with Ruby. I don't believe there are any such restrictions with classic caches. -- Dr. Bobby R. Bruce Room 3050, Kemper Hall, UC Davis Davis, CA, 95616 web: https://www.bobbybruce.net On Tue, Sep 6, 2022 at 2:42 PM Chrysanthos Pepi <cpepi001@outlook.com<mailto:cpepi001@outlook.com>> wrote: Hi Dr. Bruce, Thank you for your reply. In order to create checkpoints do I need to use MOESI hammer protocol or classic caches? Kind regards, Chrysanthos Pepi From: Bobby Bruce<mailto:bbruce@ucdavis.edu> Sent: Tuesday, September 6, 2022 12:46 To: The gem5 Users mailing list<mailto:gem5-users@gem5.org> Subject: [gem5-users] Re: Creating Checkpoints You need to explicitly state what you want to do at the "m5 checkpoint" exit event, otherwise it'll just default to a regular exit. You'll need to change the "on_exit_event" parameter when constructing the Simulator. Something like this: ``` ... def create_checkpoint(): m5.checkpoint("<path to checkpoint>") simulator = Simulator( board=board, on_exit_event={ ExitEvent.EXIT : (func() for func in [processor.switch]), ExitEvent.CHECKPOINT: (func() for func in [create_checkpoint]), }, ... ``` Note here we're saying on the first EXIT (m5 exit) exit event we're switching cores, and on the first CHECKPOINT(m5 checkpoint) exit event we're creating the checkpoint. -- Dr. Bobby R. Bruce Room 3050, Kemper Hall, UC Davis Davis, CA, 95616 web: https://www.bobbybruce.net On Mon, Sep 5, 2022 at 3:31 PM Chrysanthos Pepi <cpepi001@outlook.com<mailto:cpepi001@outlook.com>> wrote: > > Hello All, > > > > I want to create checkpoints after a FS Ubuntu boot up with KVM and then use that checkpoint to run multiple benchmarks with Timing/O3. Right now I am using x86-ubuntu-run-with-kvm.py script to do that and it successfully boots up and I am able to connect with the m5term to view the process. > > > > I slightly modified the script to add the `m5 checkpoint;` command, according to this, and it look like this: > > > > command = "m5 exit;" \ > > + "echo 'This is running on Timing CPU cores.';" \ > > + "m5 checkpoint;" \ # Save a checkpoint > > + "sleep 1;" \ # Run a benchmark > > + "m5 exit;" > > > > My understanding is that, on the 1st m5 exit it switches from KVM to Timing so I want to get a checkpoint and later run a benchmark. I tried that and I am able to see the echo message but then it terminates. Then I tried to execute the same command trough m5term but still the same result (attach log files) > > > > Kind regards, > > Chrysanthos Pepi > > > > _______________________________________________ > gem5-users mailing list -- gem5-users@gem5.org<mailto:gem5-users@gem5.org> > To unsubscribe send an email to gem5-users-leave@gem5.org<mailto:gem5-users-leave@gem5.org> _______________________________________________ gem5-users mailing list -- gem5-users@gem5.org<mailto:gem5-users@gem5.org> To unsubscribe send an email to gem5-users-leave@gem5.org<mailto:gem5-users-leave@gem5.org> _______________________________________________ gem5-users mailing list -- gem5-users@gem5.org<mailto:gem5-users@gem5.org> To unsubscribe send an email to gem5-users-leave@gem5.org<mailto:gem5-users-leave@gem5.org>
BB
Bobby Bruce
Wed, Sep 14, 2022 10:20 PM

Hey Chrysanthos,

I apologize for taking so long to dive into this. I don't know exactly what
was wrong with your setup, but I think it was to do with how you were
setting the "readfile_contents" (the script to run when the boot was
loaded). Playing around with the scripts you sent, I eventually got a
working example. These are attached. The script  which saves the checkpoint
uses a KVM core, and the script which restores uses a TIMING core.

Kind regards,
Bobby

Dr. Bobby R. Bruce
Room 3050,
Kemper Hall, UC Davis
Davis,
CA, 95616

web: https://www.bobbybruce.net

On Fri, Sep 9, 2022 at 3:17 PM Chrysanthos Pepi cpepi001@outlook.com
wrote:

Hi Bobby,

I attached the scripts and an output log (gem5, and m5term). I am not
really sure how to properly restore the checkpoint and continue the
readfile_contents commands. For now the command is an echo just to make
it work and later I want to pass the benchmark to run.

Kind regards,

Chrysanthos Pepi

*From: *Bobby Bruce bbruce@ucdavis.edu
*Sent: *Thursday, September 8, 2022 16:21
*To: *The gem5 Users mailing list gem5-users@gem5.org
*Subject: *[gem5-users] Re: Creating Checkpoints

Hey Chrysanthos,

My first thought here is the disk image I believe you are using, by
default, will exit once booted. I suspect you'll have to set
readfile_contents="/bin/bash" or something like that on your set_workload
function to be able to m5term into the simulation.

Could you send the config file you've built and the terminal output you're
seeing?

Kind regards,

Bobby

--

Dr. Bobby R. Bruce
Room 3050,
Kemper Hall, UC Davis
Davis,
CA, 95616

web: https://www.bobbybruce.net

On Wed, Sep 7, 2022 at 12:03 PM Chrysanthos Pepi cpepi001@outlook.com
wrote:

Thank you,

I modified the script to use classic caches and I was able to create a
checkpoint.

Now, in order to restore it and run command/benchmark, we can pass the
checkpoint_path into the Simulator and change the processor type from
SimpleSwitchapleProcessor to SimpleProcessor?

I did that and the simulation started, connected with m5term but it stuck
at “==== m5 terminal: Terminal 0 ====”

Kind regards,

Chrysanthos Pepi

*From: *Bobby Bruce bbruce@ucdavis.edu
*Sent: *Tuesday, September 6, 2022 18:51
*To: *The gem5 Users mailing list gem5-users@gem5.org
*Subject: *[gem5-users] Re: Creating Checkpoints

There are two restrictions with Ruby and checkpointing that I'm aware of:

  1. You have to use MOESI_hammer or another protocol that implements that
    flush function.

  2. If you take a checkpoint in Ruby it has to be restored with Ruby.

I don't believe there are any such restrictions with classic caches.

--

Dr. Bobby R. Bruce
Room 3050,
Kemper Hall, UC Davis
Davis,
CA, 95616

web: https://www.bobbybruce.net

On Tue, Sep 6, 2022 at 2:42 PM Chrysanthos Pepi cpepi001@outlook.com
wrote:

Hi Dr. Bruce,

Thank you for your reply. In order to create checkpoints do I need to use
MOESI hammer protocol or classic caches?

Kind regards,

Chrysanthos Pepi

*From: *Bobby Bruce bbruce@ucdavis.edu
*Sent: *Tuesday, September 6, 2022 12:46
*To: *The gem5 Users mailing list gem5-users@gem5.org
*Subject: *[gem5-users] Re: Creating Checkpoints

You need to explicitly state what you want to do at the "m5 checkpoint"
exit event, otherwise it'll just default to a regular exit.

You'll need to change the "on_exit_event" parameter when constructing the
Simulator. Something like this:


...



def create_checkpoint():

    m5.checkpoint("<path to checkpoint>")


simulator = Simulator(
    board=board,
    on_exit_event={
    ExitEvent.EXIT : (func() for func in [processor.switch]),

    ExitEvent.CHECKPOINT: (func() for func in [create_checkpoint]),
},



...

Note here we're saying on the first EXIT (m5 exit) exit event we're
switching cores, and on the first CHECKPOINT(m5 checkpoint) exit event
we're creating the checkpoint.

--
Dr. Bobby R. Bruce
Room 3050,
Kemper Hall, UC Davis
Davis,
CA, 95616

web: https://www.bobbybruce.net

On Mon, Sep 5, 2022 at 3:31 PM Chrysanthos Pepi cpepi001@outlook.com
wrote:

Hello All,

I want to create checkpoints after a FS Ubuntu boot up with KVM and then

use that checkpoint to run multiple benchmarks with Timing/O3. Right now I
am using x86-ubuntu-run-with-kvm.py script to do that and it successfully
boots up and I am able to connect with the m5term to view the process.

I slightly modified the script to add the m5 checkpoint; command,

according to this, and it look like this:

command = "m5 exit;" \

     + "echo 'This is running on Timing CPU cores.';" \

     + "m5 checkpoint;" \ # Save a checkpoint

     + "sleep 1;" \ # Run a benchmark

     + "m5 exit;"

My understanding is that, on the 1st m5 exit it switches from KVM to

Timing so I want to get a checkpoint and later run a benchmark. I tried
that and I am able to see the echo message but then it terminates. Then I
tried to execute the same command trough m5term but still the same result
(attach log files)

Kind regards,

Chrysanthos Pepi


gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-leave@gem5.org


gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-leave@gem5.org


gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-leave@gem5.org


gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-leave@gem5.org

Hey Chrysanthos, I apologize for taking so long to dive into this. I don't know exactly what was wrong with your setup, but I think it was to do with how you were setting the "readfile_contents" (the script to run when the boot was loaded). Playing around with the scripts you sent, I eventually got a working example. These are attached. The script which saves the checkpoint uses a KVM core, and the script which restores uses a TIMING core. Kind regards, Bobby -- Dr. Bobby R. Bruce Room 3050, Kemper Hall, UC Davis Davis, CA, 95616 web: https://www.bobbybruce.net On Fri, Sep 9, 2022 at 3:17 PM Chrysanthos Pepi <cpepi001@outlook.com> wrote: > Hi Bobby, > > > > I attached the scripts and an output log (gem5, and m5term). I am not > really sure how to properly restore the checkpoint and continue the > `readfile_contents` commands. For now the command is an echo just to make > it work and later I want to pass the benchmark to run. > > > > Kind regards, > > Chrysanthos Pepi > > > > *From: *Bobby Bruce <bbruce@ucdavis.edu> > *Sent: *Thursday, September 8, 2022 16:21 > *To: *The gem5 Users mailing list <gem5-users@gem5.org> > *Subject: *[gem5-users] Re: Creating Checkpoints > > > > Hey Chrysanthos, > > > > My first thought here is the disk image I believe you are using, by > default, will exit once booted. I suspect you'll have to set > `readfile_contents="/bin/bash"` or something like that on your set_workload > function to be able to m5term into the simulation. > > > > Could you send the config file you've built and the terminal output you're > seeing? > > > > Kind regards, > > Bobby > > -- > > Dr. Bobby R. Bruce > Room 3050, > Kemper Hall, UC Davis > Davis, > CA, 95616 > > > > web: https://www.bobbybruce.net > > > > > > On Wed, Sep 7, 2022 at 12:03 PM Chrysanthos Pepi <cpepi001@outlook.com> > wrote: > > Thank you, > > > > I modified the script to use classic caches and I was able to create a > checkpoint. > > > > Now, in order to restore it and run command/benchmark, we can pass the > checkpoint_path into the Simulator and change the processor type from > SimpleSwitchapleProcessor to SimpleProcessor? > > > > I did that and the simulation started, connected with m5term but it stuck > at “==== m5 terminal: Terminal 0 ====” > > > > Kind regards, > > Chrysanthos Pepi > > > > *From: *Bobby Bruce <bbruce@ucdavis.edu> > *Sent: *Tuesday, September 6, 2022 18:51 > *To: *The gem5 Users mailing list <gem5-users@gem5.org> > *Subject: *[gem5-users] Re: Creating Checkpoints > > > > There are two restrictions with Ruby and checkpointing that I'm aware of: > > > > 1. You have to use MOESI_hammer or another protocol that implements that > flush function. > > 2. If you take a checkpoint in Ruby it has to be restored with Ruby. > > > > I don't believe there are any such restrictions with classic caches. > > > > -- > > Dr. Bobby R. Bruce > Room 3050, > Kemper Hall, UC Davis > Davis, > CA, 95616 > > > > web: https://www.bobbybruce.net > > > > > > On Tue, Sep 6, 2022 at 2:42 PM Chrysanthos Pepi <cpepi001@outlook.com> > wrote: > > Hi Dr. Bruce, > > > > Thank you for your reply. In order to create checkpoints do I need to use > MOESI hammer protocol or classic caches? > > > > Kind regards, > > Chrysanthos Pepi > > > > *From: *Bobby Bruce <bbruce@ucdavis.edu> > *Sent: *Tuesday, September 6, 2022 12:46 > *To: *The gem5 Users mailing list <gem5-users@gem5.org> > *Subject: *[gem5-users] Re: Creating Checkpoints > > > > You need to explicitly state what you want to do at the "m5 checkpoint" > exit event, otherwise it'll just default to a regular exit. > > You'll need to change the "on_exit_event" parameter when constructing the > Simulator. Something like this: > > ``` > > ... > > > > def create_checkpoint(): > > m5.checkpoint("<path to checkpoint>") > > > simulator = Simulator( > board=board, > on_exit_event={ > ExitEvent.EXIT : (func() for func in [processor.switch]), > > ExitEvent.CHECKPOINT: (func() for func in [create_checkpoint]), > }, > > > > ... > > ``` > > > Note here we're saying on the first EXIT (m5 exit) exit event we're > switching cores, and on the first CHECKPOINT(m5 checkpoint) exit event > we're creating the checkpoint. > > -- > Dr. Bobby R. Bruce > Room 3050, > Kemper Hall, UC Davis > Davis, > CA, 95616 > > web: https://www.bobbybruce.net > > > On Mon, Sep 5, 2022 at 3:31 PM Chrysanthos Pepi <cpepi001@outlook.com> > wrote: > > > > Hello All, > > > > > > > > I want to create checkpoints after a FS Ubuntu boot up with KVM and then > use that checkpoint to run multiple benchmarks with Timing/O3. Right now I > am using x86-ubuntu-run-with-kvm.py script to do that and it successfully > boots up and I am able to connect with the m5term to view the process. > > > > > > > > I slightly modified the script to add the `m5 checkpoint;` command, > according to this, and it look like this: > > > > > > > > command = "m5 exit;" \ > > > > + "echo 'This is running on Timing CPU cores.';" \ > > > > + "m5 checkpoint;" \ # Save a checkpoint > > > > + "sleep 1;" \ # Run a benchmark > > > > + "m5 exit;" > > > > > > > > My understanding is that, on the 1st m5 exit it switches from KVM to > Timing so I want to get a checkpoint and later run a benchmark. I tried > that and I am able to see the echo message but then it terminates. Then I > tried to execute the same command trough m5term but still the same result > (attach log files) > > > > > > > > Kind regards, > > > > Chrysanthos Pepi > > > > > > > > _______________________________________________ > > gem5-users mailing list -- gem5-users@gem5.org > > To unsubscribe send an email to gem5-users-leave@gem5.org > > > > _______________________________________________ > gem5-users mailing list -- gem5-users@gem5.org > To unsubscribe send an email to gem5-users-leave@gem5.org > > > > _______________________________________________ > gem5-users mailing list -- gem5-users@gem5.org > To unsubscribe send an email to gem5-users-leave@gem5.org > > > _______________________________________________ > gem5-users mailing list -- gem5-users@gem5.org > To unsubscribe send an email to gem5-users-leave@gem5.org >
CP
Chrysanthos Pepi
Thu, Sep 15, 2022 7:35 PM

Hi Bobby,

Thank you very much! Now it works.

Kind regards,
Chrysanthos Pepi

From: Bobby Brucemailto:bbruce@ucdavis.edu
Sent: Wednesday, September 14, 2022 17:24
To: The gem5 Users mailing listmailto:gem5-users@gem5.org
Subject: [gem5-users] Re: Creating Checkpoints

Hey Chrysanthos,

I apologize for taking so long to dive into this. I don't know exactly what was wrong with your setup, but I think it was to do with how you were setting the "readfile_contents" (the script to run when the boot was loaded). Playing around with the scripts you sent, I eventually got a working example. These are attached. The script  which saves the checkpoint uses a KVM core, and the script which restores uses a TIMING core.

Kind regards,
Bobby

Dr. Bobby R. Bruce
Room 3050,
Kemper Hall, UC Davis
Davis,
CA, 95616

web: https://www.bobbybruce.net

On Fri, Sep 9, 2022 at 3:17 PM Chrysanthos Pepi <cpepi001@outlook.commailto:cpepi001@outlook.com> wrote:
Hi Bobby,

I attached the scripts and an output log (gem5, and m5term). I am not really sure how to properly restore the checkpoint and continue the readfile_contents commands. For now the command is an echo just to make it work and later I want to pass the benchmark to run.

Kind regards,
Chrysanthos Pepi

From: Bobby Brucemailto:bbruce@ucdavis.edu
Sent: Thursday, September 8, 2022 16:21
To: The gem5 Users mailing listmailto:gem5-users@gem5.org
Subject: [gem5-users] Re: Creating Checkpoints

Hey Chrysanthos,

My first thought here is the disk image I believe you are using, by default, will exit once booted. I suspect you'll have to set readfile_contents="/bin/bash" or something like that on your set_workload function to be able to m5term into the simulation.

Could you send the config file you've built and the terminal output you're seeing?

Kind regards,
Bobby

Dr. Bobby R. Bruce
Room 3050,
Kemper Hall, UC Davis
Davis,
CA, 95616

web: https://www.bobbybruce.net

On Wed, Sep 7, 2022 at 12:03 PM Chrysanthos Pepi <cpepi001@outlook.commailto:cpepi001@outlook.com> wrote:
Thank you,

I modified the script to use classic caches and I was able to create a checkpoint.

Now, in order to restore it and run command/benchmark, we can pass the checkpoint_path into the Simulator and change the processor type from SimpleSwitchapleProcessor to SimpleProcessor?

I did that and the simulation started, connected with m5term but it stuck at “==== m5 terminal: Terminal 0 ====”

Kind regards,
Chrysanthos Pepi

From: Bobby Brucemailto:bbruce@ucdavis.edu
Sent: Tuesday, September 6, 2022 18:51
To: The gem5 Users mailing listmailto:gem5-users@gem5.org
Subject: [gem5-users] Re: Creating Checkpoints

There are two restrictions with Ruby and checkpointing that I'm aware of:

  1. You have to use MOESI_hammer or another protocol that implements that flush function.
  2. If you take a checkpoint in Ruby it has to be restored with Ruby.

I don't believe there are any such restrictions with classic caches.

--
Dr. Bobby R. Bruce
Room 3050,
Kemper Hall, UC Davis
Davis,
CA, 95616

web: https://www.bobbybruce.net

On Tue, Sep 6, 2022 at 2:42 PM Chrysanthos Pepi <cpepi001@outlook.commailto:cpepi001@outlook.com> wrote:
Hi Dr. Bruce,

Thank you for your reply. In order to create checkpoints do I need to use MOESI hammer protocol or classic caches?

Kind regards,
Chrysanthos Pepi

From: Bobby Brucemailto:bbruce@ucdavis.edu
Sent: Tuesday, September 6, 2022 12:46
To: The gem5 Users mailing listmailto:gem5-users@gem5.org
Subject: [gem5-users] Re: Creating Checkpoints

You need to explicitly state what you want to do at the "m5 checkpoint" exit event, otherwise it'll just default to a regular exit.

You'll need to change the "on_exit_event" parameter when constructing the Simulator. Something like this:

...

def create_checkpoint():
    m5.checkpoint("<path to checkpoint>")

simulator = Simulator(
    board=board,
    on_exit_event={
    ExitEvent.EXIT : (func() for func in [processor.switch]),
    ExitEvent.CHECKPOINT: (func() for func in [create_checkpoint]),
},

...

Note here we're saying on the first EXIT (m5 exit) exit event we're switching cores, and on the first CHECKPOINT(m5 checkpoint) exit event we're creating the checkpoint.

--
Dr. Bobby R. Bruce
Room 3050,
Kemper Hall, UC Davis
Davis,
CA, 95616

web: https://www.bobbybruce.net

On Mon, Sep 5, 2022 at 3:31 PM Chrysanthos Pepi <cpepi001@outlook.commailto:cpepi001@outlook.com> wrote:

Hello All,

I want to create checkpoints after a FS Ubuntu boot up with KVM and then use that checkpoint to run multiple benchmarks with Timing/O3. Right now I am using x86-ubuntu-run-with-kvm.py script to do that and it successfully boots up and I am able to connect with the m5term to view the process.

I slightly modified the script to add the m5 checkpoint; command, according to this, and it look like this:

command = "m5 exit;" \

     + "echo 'This is running on Timing CPU cores.';" \

     + "m5 checkpoint;" \ # Save a checkpoint

     + "sleep 1;" \ # Run a benchmark

     + "m5 exit;"

My understanding is that, on the 1st m5 exit it switches from KVM to Timing so I want to get a checkpoint and later run a benchmark. I tried that and I am able to see the echo message but then it terminates. Then I tried to execute the same command trough m5term but still the same result (attach log files)

Kind regards,

Chrysanthos Pepi


gem5-users mailing list -- gem5-users@gem5.orgmailto:gem5-users@gem5.org
To unsubscribe send an email to gem5-users-leave@gem5.orgmailto:gem5-users-leave@gem5.org

Hi Bobby, Thank you very much! Now it works. Kind regards, Chrysanthos Pepi From: Bobby Bruce<mailto:bbruce@ucdavis.edu> Sent: Wednesday, September 14, 2022 17:24 To: The gem5 Users mailing list<mailto:gem5-users@gem5.org> Subject: [gem5-users] Re: Creating Checkpoints Hey Chrysanthos, I apologize for taking so long to dive into this. I don't know exactly what was wrong with your setup, but I think it was to do with how you were setting the "readfile_contents" (the script to run when the boot was loaded). Playing around with the scripts you sent, I eventually got a working example. These are attached. The script which saves the checkpoint uses a KVM core, and the script which restores uses a TIMING core. Kind regards, Bobby -- Dr. Bobby R. Bruce Room 3050, Kemper Hall, UC Davis Davis, CA, 95616 web: https://www.bobbybruce.net On Fri, Sep 9, 2022 at 3:17 PM Chrysanthos Pepi <cpepi001@outlook.com<mailto:cpepi001@outlook.com>> wrote: Hi Bobby, I attached the scripts and an output log (gem5, and m5term). I am not really sure how to properly restore the checkpoint and continue the `readfile_contents` commands. For now the command is an echo just to make it work and later I want to pass the benchmark to run. Kind regards, Chrysanthos Pepi From: Bobby Bruce<mailto:bbruce@ucdavis.edu> Sent: Thursday, September 8, 2022 16:21 To: The gem5 Users mailing list<mailto:gem5-users@gem5.org> Subject: [gem5-users] Re: Creating Checkpoints Hey Chrysanthos, My first thought here is the disk image I believe you are using, by default, will exit once booted. I suspect you'll have to set `readfile_contents="/bin/bash"` or something like that on your set_workload function to be able to m5term into the simulation. Could you send the config file you've built and the terminal output you're seeing? Kind regards, Bobby -- Dr. Bobby R. Bruce Room 3050, Kemper Hall, UC Davis Davis, CA, 95616 web: https://www.bobbybruce.net On Wed, Sep 7, 2022 at 12:03 PM Chrysanthos Pepi <cpepi001@outlook.com<mailto:cpepi001@outlook.com>> wrote: Thank you, I modified the script to use classic caches and I was able to create a checkpoint. Now, in order to restore it and run command/benchmark, we can pass the checkpoint_path into the Simulator and change the processor type from SimpleSwitchapleProcessor to SimpleProcessor? I did that and the simulation started, connected with m5term but it stuck at “==== m5 terminal: Terminal 0 ====” Kind regards, Chrysanthos Pepi From: Bobby Bruce<mailto:bbruce@ucdavis.edu> Sent: Tuesday, September 6, 2022 18:51 To: The gem5 Users mailing list<mailto:gem5-users@gem5.org> Subject: [gem5-users] Re: Creating Checkpoints There are two restrictions with Ruby and checkpointing that I'm aware of: 1. You have to use MOESI_hammer or another protocol that implements that flush function. 2. If you take a checkpoint in Ruby it has to be restored with Ruby. I don't believe there are any such restrictions with classic caches. -- Dr. Bobby R. Bruce Room 3050, Kemper Hall, UC Davis Davis, CA, 95616 web: https://www.bobbybruce.net On Tue, Sep 6, 2022 at 2:42 PM Chrysanthos Pepi <cpepi001@outlook.com<mailto:cpepi001@outlook.com>> wrote: Hi Dr. Bruce, Thank you for your reply. In order to create checkpoints do I need to use MOESI hammer protocol or classic caches? Kind regards, Chrysanthos Pepi From: Bobby Bruce<mailto:bbruce@ucdavis.edu> Sent: Tuesday, September 6, 2022 12:46 To: The gem5 Users mailing list<mailto:gem5-users@gem5.org> Subject: [gem5-users] Re: Creating Checkpoints You need to explicitly state what you want to do at the "m5 checkpoint" exit event, otherwise it'll just default to a regular exit. You'll need to change the "on_exit_event" parameter when constructing the Simulator. Something like this: ``` ... def create_checkpoint(): m5.checkpoint("<path to checkpoint>") simulator = Simulator( board=board, on_exit_event={ ExitEvent.EXIT : (func() for func in [processor.switch]), ExitEvent.CHECKPOINT: (func() for func in [create_checkpoint]), }, ... ``` Note here we're saying on the first EXIT (m5 exit) exit event we're switching cores, and on the first CHECKPOINT(m5 checkpoint) exit event we're creating the checkpoint. -- Dr. Bobby R. Bruce Room 3050, Kemper Hall, UC Davis Davis, CA, 95616 web: https://www.bobbybruce.net On Mon, Sep 5, 2022 at 3:31 PM Chrysanthos Pepi <cpepi001@outlook.com<mailto:cpepi001@outlook.com>> wrote: > > Hello All, > > > > I want to create checkpoints after a FS Ubuntu boot up with KVM and then use that checkpoint to run multiple benchmarks with Timing/O3. Right now I am using x86-ubuntu-run-with-kvm.py script to do that and it successfully boots up and I am able to connect with the m5term to view the process. > > > > I slightly modified the script to add the `m5 checkpoint;` command, according to this, and it look like this: > > > > command = "m5 exit;" \ > > + "echo 'This is running on Timing CPU cores.';" \ > > + "m5 checkpoint;" \ # Save a checkpoint > > + "sleep 1;" \ # Run a benchmark > > + "m5 exit;" > > > > My understanding is that, on the 1st m5 exit it switches from KVM to Timing so I want to get a checkpoint and later run a benchmark. I tried that and I am able to see the echo message but then it terminates. Then I tried to execute the same command trough m5term but still the same result (attach log files) > > > > Kind regards, > > Chrysanthos Pepi > > > > _______________________________________________ > gem5-users mailing list -- gem5-users@gem5.org<mailto:gem5-users@gem5.org> > To unsubscribe send an email to gem5-users-leave@gem5.org<mailto:gem5-users-leave@gem5.org> _______________________________________________ gem5-users mailing list -- gem5-users@gem5.org<mailto:gem5-users@gem5.org> To unsubscribe send an email to gem5-users-leave@gem5.org<mailto:gem5-users-leave@gem5.org> _______________________________________________ gem5-users mailing list -- gem5-users@gem5.org<mailto:gem5-users@gem5.org> To unsubscribe send an email to gem5-users-leave@gem5.org<mailto:gem5-users-leave@gem5.org> _______________________________________________ gem5-users mailing list -- gem5-users@gem5.org<mailto:gem5-users@gem5.org> To unsubscribe send an email to gem5-users-leave@gem5.org<mailto:gem5-users-leave@gem5.org>