[gem5-users] Re: gem5 : X86 + GCN3 (gfx801) + test_fwd_lrn

2022-03-14 Thread Matt Sinclair via gem5-users
Hi David,

I have not seen this mmap error before, and my initial guess was the mmap error 
is happening because you are trying to allocate more memory than we created 
when mmap'ing the inputs for the applications (we do this to speed up SE mode, 
because otherwise initializing arrays can take several hours).  However, the 
fact that it is failing in physical.cc and not in the application itself is 
throwing me off there.  Looking at where the failure is occurring, it seems the 
backing store code itself is failing here (from such a large allocation).  
Since the failure is with a C++ mmap call itself, that is perhaps more 
problematic - is "Cannot allocate memory" the failure from the perror() call on 
the line above the fatal() print?

Regarding the other question, and the failures more generally: we have never 
tested with > 64 CUs before, so certainly you are stressing the system and 
encountering different kinds of failures than we have seen previously.

In terms of applications, I had thought most/all of them passed previously, but 
we do not test each and every one all the time because this would make our 
weekly regressions run for a very long time.  You can see here: 
https://gem5.googlesource.com/public/gem5/+/refs/heads/develop/tests/weekly.sh#176
 which ones we run on a weekly basis.  I expect all of those to pass (although 
your comment seems to indicate that is not always true?).  Your issues are 
exposing that perhaps we need to test more of them beyond these 3 - perhaps on 
a quarterly basis or something though to avoid inflating the weekly runtime.  
Having said that, I have not run LRN in a long time, as some ML people told me 
that LRN was not widely used anymore.  But when I did run it, I do remember it 
requiring a large amount of memory - which squares with what you are seeing 
here.  I thought LRN needed -mem-size=32 GB to run, but based on your message 
it seems that is not the case.

@Matt P: have you tried LRN lately?  If so, have you run into the same 
OOM/backing store failures?

I know Kyle R. is looking into your other failure, so this one may have to wait 
behind it from our end, unless Matt P knows of a fix.

Thanks,
Matt

From: David Fong via gem5-users 
Sent: Monday, March 14, 2022 4:38 PM
To: David Fong via gem5-users 
Cc: David Fong 
Subject: [gem5-users] gem5 : X86 + GCN3 (gfx801) + test_fwd_lrn

Hi,

I'm getting an error related to memory for test_fwd_lrn
I increased the memory size from 4GB to 512GB I got memory size issue : "out of 
memory".

build/GCN3_X86/gpu-compute/gpu_compute_driver.cc:599: warn: unimplemented 
ioctl: AMDKFD_IOC_SET_SCRATCH_BACKING_VA
build/GCN3_X86/gpu-compute/gpu_compute_driver.cc:609: warn: unimplemented 
ioctl: AMDKFD_IOC_SET_TRAP_HANDLER
build/GCN3_X86/sim/mem_pool.cc:120: fatal: fatal condition freePages() <= 0 
occurred: Out of memory, please increase size of physical memory.

But once I increased mem size to 1024GB, 1536GB,2048GB I'm getting this DRAM 
device capacity issue.

docker run --rm -v ${PWD}:${PWD} -v 
${PWD}/gem5/gem5-resources/src/gpu/DNNMark/cachefiles:/root/.cache/miopen/2.9.0 
-w ${PWD} gcr.io/gem5-test/gcn-gpu:v21-2 gem5/build/GCN3_X86/gem5.opt 
gem5/configs/example/apu_se.py --mem-size 1536GB --num-compute-units 256 -n3 
--benchmark-root=gem5/gem5-resources/src/gpu/DNNMark/build/benchmarks/test_fwd_lrn
 -cdnnmark_test_fwd_lrn --options="-config 
gem5/gem5-resources/src/gpu/DNNMark/config_example/lrn_config.dnnmark -mmap 
gem5/gem5-resources/src/gpu/DNNMark/mmap.bin" |& tee 
gem5_gpu_cu256_run_dnnmark_test_fwd_lrn_50latency.log
Global frequency set at 1 ticks per second
build/GCN3_X86/mem/mem_interface.cc:791: warn: DRAM device capacity (8192 
Mbytes) does not match the address range assigned (2097152 Mbytes)
mmap: Cannot allocate memory
build/GCN3_X86/mem/physical.cc:231: fatal: Could not mmap 1649267441664 bytes 
for range [0:0x180]!


Smaller number of CUs like 4 also have same type of error.

Is there a regression script or regression log for DNNMark to show mem-size or 
configurations that are known working for DNNMark tests so
I can use same setup to run a few DNNMark tests?
Only test_fwd_softmax, test_bwd_softmax are working for CUs from 
{4,8,16,32,64,128,256}

Thanks,

David

___
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] gem5 : X86 + GCN3 (gfx801) + test_fwd_lrn

2022-03-14 Thread David Fong via gem5-users
Hi,

I'm getting an error related to memory for test_fwd_lrn
I increased the memory size from 4GB to 512GB I got memory size issue : "out of 
memory".

build/GCN3_X86/gpu-compute/gpu_compute_driver.cc:599: warn: unimplemented 
ioctl: AMDKFD_IOC_SET_SCRATCH_BACKING_VA
build/GCN3_X86/gpu-compute/gpu_compute_driver.cc:609: warn: unimplemented 
ioctl: AMDKFD_IOC_SET_TRAP_HANDLER
build/GCN3_X86/sim/mem_pool.cc:120: fatal: fatal condition freePages() <= 0 
occurred: Out of memory, please increase size of physical memory.

But once I increased mem size to 1024GB, 1536GB,2048GB I'm getting this DRAM 
device capacity issue.

docker run --rm -v ${PWD}:${PWD} -v 
${PWD}/gem5/gem5-resources/src/gpu/DNNMark/cachefiles:/root/.cache/miopen/2.9.0 
-w ${PWD} gcr.io/gem5-test/gcn-gpu:v21-2 gem5/build/GCN3_X86/gem5.opt 
gem5/configs/example/apu_se.py --mem-size 1536GB --num-compute-units 256 -n3 
--benchmark-root=gem5/gem5-resources/src/gpu/DNNMark/build/benchmarks/test_fwd_lrn
 -cdnnmark_test_fwd_lrn --options="-config 
gem5/gem5-resources/src/gpu/DNNMark/config_example/lrn_config.dnnmark -mmap 
gem5/gem5-resources/src/gpu/DNNMark/mmap.bin" |& tee 
gem5_gpu_cu256_run_dnnmark_test_fwd_lrn_50latency.log
Global frequency set at 1 ticks per second
build/GCN3_X86/mem/mem_interface.cc:791: warn: DRAM device capacity (8192 
Mbytes) does not match the address range assigned (2097152 Mbytes)
mmap: Cannot allocate memory
build/GCN3_X86/mem/physical.cc:231: fatal: Could not mmap 1649267441664 bytes 
for range [0:0x180]!


Smaller number of CUs like 4 also have same type of error.

Is there a regression script or regression log for DNNMark to show mem-size or 
configurations that are known working for DNNMark tests so
I can use same setup to run a few DNNMark tests?
Only test_fwd_softmax, test_bwd_softmax are working for CUs from 
{4,8,16,32,64,128,256}

Thanks,

David

___
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: Gem5/DRAMSim3

2022-03-14 Thread Mahyar Samani via gem5-users
Hello Kazi,

I looked at the script and you should make the following changes:

from gem5.components.memory import SingleChannelDDR3_1600 --> from
gem5.components.memory.dramsim_3 import SingleChannelDDR3_1600
requires(isa_required=ISA.ARM) --> requires(isa_required=ISA.X86), if it
does not work comment out for now
memory = SingleChannelDDR3_1600(size="32MB") --> No Change needed
from gem5.resources.resource import Resource (line 49 in the original file)
--> from gem5.resources.resource import CustomResource
Resource("arm-hello64-static") --> CustomResource(local_path=[the path to
your binary])

Best Regards,


On Mon, Mar 14, 2022 at 1:54 PM Kazi Asifuzzaman 
wrote:

> Hi Mahyar,
>
> I am trying to prepare a SE mode for x86. To replicate the ARM config for
> this, could you please clarify how do I replace the parts in RED:
>
> from gem5.components.memory import SingleChannelDDR3_1600  //For using
> DRAMsim3. How do I specify the memory config *from* DRAMsim3 (e.g.
> DDR3-1600)
> requires(isa_required=ISA.ARM)  //Any check
> for x86 ISA ?
> memory = SingleChannelDDR3_1600(size="32MB")//Again, how
> do I specify a specific memory protocol to be used *from* DRAMsim3
> Resource("arm-hello64-static") //if I want to
> use a binary from a directory
>
> Thanks,
>
> *Kazi*
>
>
>
>
>
>
>
>
>
>
>
> On Mon, Mar 7, 2022 at 4:57 PM Mahyar Samani  wrote:
>
>> Hello Kazi,
>>
>> Take a look at configs/example/gem5_library/arm-hello.py. It is a good
>> example of SE mode for ARM ISA. If you are interested in instantiating a
>> memory module look at lines 47, and 62 from the same file.
>> P.S. I'm checking out the stable branch on the gem5 repo
>> (Hash: 141cc37c2d4b93959d4c249b8f7e6a8b2ef75338).
>>
>> Best Regards,
>>
>> On Mon, Mar 7, 2022 at 1:17 PM Kazi Asifuzzaman <
>> kazi.asifuzza...@gmail.com> wrote:
>>
>>> Hi Mahyar,
>>>
>>> Thanks for your mail and suggestions. Could you please give examples of:
>>> 1. How to use gem5 standard library to configure a system, instead of
>>> using se.py?
>>> 2. How to use standard library API to instantiate a memory?
>>>
>>> Thanks,
>>>
>>> Kazi
>>>
>>> On Fri, Mar 4, 2022 at 1:43 PM Mahyar Samani 
>>> wrote:
>>>
 Hello Kazi,

 Thanks for reaching out. Yes, I am aware of the problem. Fortunately,
 the issue is not with gem5/DRAMSim3 integration. Rather, it's just caused
 by some of the differences between gem5 and DRAMSim3 memory controller. I
 assume you are using either of the se.py or fs.py in src/config/example. I
 can propose a quick solution to your problem. However, we believe using
 se.py/fs.py to do your simulation is not the best solution. We have
 recently added the gem5 standard library that makes it easier for you to
 configure the system you want to simulate. Back to the solution, fs.py and
 se.py use api from src/config/common/MemConfig.py to configure the memory
 components in the system (this does not include caches). What you'll need
 to do (reminder: this a quick solution) is to find calls to api from
 MemConfig.py in se.py/fs.py (whichever one you are using) and remove
 those calls and instantiate the memory yourself. The standard library has a
 really easy api to instantiate a memory. Please look at
 src/python/gem5/components/memory/dramsim_3.py for memories from DRAMSim3.
 I hope this is helpfull, if you needed further help, please feel free to
 reach out to me (I have a deadline today at 11:59 pm PST and will respond
 asap after that). I would appreciate it if you could send your questions to
 the gem5 mailing list. This way, other people would also be aware of the
 bugs and inconsistencies in the repo and it definitely makes it a bigger
 priority to be solved. Feel free to cc me so I make sure to respond as
 quickly as possible.

 Best Regards,

 On Fri, Mar 4, 2022 at 10:23 AM Kazi Asifuzzaman <
 kazi.asifuzza...@gmail.com> wrote:

> Good Afternoon Mahyar,
>
> From a gem5 discussion group, it appears that you are managing (a part
> of) the gem5 project. I am trying to integrate Gem5 with DRAMSim3 (the way
> it explains in ext/dramsim3/README), but when the try to use
> --mem-type=DRAMsim3 to run the simulation it says: AttributeError:
> object 'DRAMsim3' has no attribute 'controller'
>
> Could you please shed some light on it? In a mail thread I see that
> you were working on a fix for this, could you resolve this issue?
>
> Many thanks for your time,
>
> *Kazi *
>


 --
 Mahyar Samani
 PhD Student
 Research Assistant at *DArchR *
 University of California, Davis
 May the Force be with you.

>>>
>>
>> --
>> Mahyar Samani
>> PhD Student
>> Research Assistant at *DArchR *
>> University of California, Davis
>> May the F

[gem5-users] Re: riscv-ubuntu 20.04 FS mode

2022-03-14 Thread Νικόλαος Ταμπουρατζής via gem5-users

Dear Boddy,

I have used the same gem5_init.sh in gem5 X86 architecture and all  
systemd services bypassed and it is working properly without READ-ONLY  
permissions. So, I believe that it is related either to riscv-image or  
gem5 configuration.


Best regards,
Nikos



Quoting Bobby Bruce :


Ok, I just thought about this a bit further, if you skip all the init
processes in this manner the OS will boot as read-only. This is by design.
So while you can pass a script here, it can only do read-only things. Your
choices are either to boot properly (with standard init stuff) or accept
this restriction.

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

web: https://www.bobbybruce.net


On Mon, Mar 14, 2022 at 11:38 AM Νικόλαος Ταμπουρατζής <
ntampourat...@ece.auth.gr> wrote:


Thank you Boddy!

I have also used this image but I get the same READ-ONLY problem.
However, I would like to use Ubuntu in order to install packages using
apt-get install through qemu. Using the "init=/root/gem5_init.sh"
command both images boot only in 10 minutes.

Best regards,
Nikos


Quoting Bobby Bruce :

> Just remembered: If you're wanting to bi-pass large parts of the Ubuntu
OS
> like this, you may just want to use the "riscv-disk-image" (
> http://dist.gem5.org/dist/v21-2/images/riscv/busybox/riscv-disk.img.gz),
an
> example usage of which can be found in
> "configs/example/gem5_library/riscv-fs.py":
>
> ```
> ./build/RISCV/gem5.opt configs/example/gem5_library/riscv-fs.py
> ```
>
> This disk image is based on BusyBox, which is very light-weight. The
source
> for building this image is found here:
>
https://gem5.googlesource.com/public/gem5-resources/+/refs/heads/stable/src/riscv-fs
>
> --
> Dr. Bobby R. Bruce
> Room 3050,
> Kemper Hall, UC Davis
> Davis,
> CA, 95616
>
> web: https://www.bobbybruce.net
>
>
> On Mon, Mar 14, 2022 at 11:12 AM Bobby Bruce  wrote:
>
>> Oh I see, I understand now. I thought you managed to disable some
systemd
>> jobs (something I think Hoa struggled with), but you're just bypassing
them
>> by setting init to a script.
>>
>> Nice, I'll let you know when the new image is available. I'll see if I
can
>> reproduce the error you found with the READ-ONLY problem on the new
image.
>>
>> --
>> Dr. Bobby R. Bruce
>> Room 3050,
>> Kemper Hall, UC Davis
>> Davis,
>> CA, 95616
>>
>> web: https://www.bobbybruce.net
>>
>>
>> On Mon, Mar 14, 2022 at 11:10 AM Νικόλαος Ταμπουρατζής <
>> ntampourat...@ece.auth.gr> wrote:
>>
>>> Dear Boddy,
>>>
>>> Thank you very much for the clarifications! I used the pre-build disk
>>> image from gem5 resources
>>> (https://github.com/gem5/gem5-resources/tree/stable/src/riscv-ubuntu),
>>> and I add the "init=/root/gem5_init.sh" command in the gem5 python
>>> script in order to bypass the systemd services.
>>>
>>> Please let me know when your new disk image is available!
>>>
>>> Thanks!
>>>
>>> Best regards,
>>> Nikos
>>>
>>>
>>> Quoting Bobby Bruce :
>>>
>>> > Hey Nikos,
>>> >
>>> > First, you can set your own kernel arguments via the `kernel_args`
>>> > parameter in the `set_kernel_disk_worload` function to do this sort
of
>>> > thing, there's no need to modify the source. You can do something
like
>>> this:
>>> >
>>> > ```
>>> > board.set_kernel_disk_workload(
>>> > kernel=Resource(
>>> > "riscv-bootloader-vmlinux-5.10",
>>> > ),
>>> > disk_image=Resource(
>>> > "riscv-ubuntu-20.04-img",
>>> > ),
>>> > kernel_args=get_default_kernel_args() +
>>> ["init=/root/gem5_init.sh'"],
>>> > )
>>> > ```
>>> >
>>> > Anyway, to answer your question: It looks like you made some error
when
>>> > creating your disk image and set things up in a read-only partition.
>>> That'd
>>> > be my best guess at this point. You should try to ensure you setup
the
>>> > partitions correctly in the disk image. Given I don't know how you
>>> created
>>> > this new image, I can't help much further.
>>> >
>>> > We should have a new RISCV disk image available by the end of today
(it
>>> > took as a bit longer than expected). It still takes some time to
boot,
>>> but
>>> > it's more stable than the one we currently provide.
>>> >
>>> > Out of curiosity, how did you remove your systemd processes? How are
you
>>> > building this disk image? With what OS are you booting?
>>> >
>>> > Kind regards,
>>> > Bobby
>>> > --
>>> > Dr. Bobby R. Bruce
>>> > Room 3050,
>>> > Kemper Hall, UC Davis
>>> > Davis,
>>> > CA, 95616
>>> >
>>> > web: https://www.bobbybruce.net
>>> >
>>> >
>>> > On Mon, Mar 14, 2022 at 4:04 AM Νικόλαος Ταμπουρατζής <
>>> > ntampourat...@ece.auth.gr> wrote:
>>> >>
>>> >> Dear all, Bobby and Hoa,
>>> >>
>>> >> I add this command (self.workload.command_line += '
>>> >> init=/root/gem5_init.sh') in 169 line of
>>> >> gem5/src/python/gem5/components/boards/kernel_disk_workload.py and I
>>> >> build the gem5. Using this command, the gem5 is able to boot after
10
>>> >> minutes (without a large number of systemd services). However, when
it
>>> >> boots 

[gem5-users] Re: riscv-ubuntu 20.04 FS mode

2022-03-14 Thread Bobby Bruce via gem5-users
Ok, I just thought about this a bit further, if you skip all the init
processes in this manner the OS will boot as read-only. This is by design.
So while you can pass a script here, it can only do read-only things. Your
choices are either to boot properly (with standard init stuff) or accept
this restriction.

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

web: https://www.bobbybruce.net


On Mon, Mar 14, 2022 at 11:38 AM Νικόλαος Ταμπουρατζής <
ntampourat...@ece.auth.gr> wrote:

> Thank you Boddy!
>
> I have also used this image but I get the same READ-ONLY problem.
> However, I would like to use Ubuntu in order to install packages using
> apt-get install through qemu. Using the "init=/root/gem5_init.sh"
> command both images boot only in 10 minutes.
>
> Best regards,
> Nikos
>
>
> Quoting Bobby Bruce :
>
> > Just remembered: If you're wanting to bi-pass large parts of the Ubuntu
> OS
> > like this, you may just want to use the "riscv-disk-image" (
> > http://dist.gem5.org/dist/v21-2/images/riscv/busybox/riscv-disk.img.gz),
> an
> > example usage of which can be found in
> > "configs/example/gem5_library/riscv-fs.py":
> >
> > ```
> > ./build/RISCV/gem5.opt configs/example/gem5_library/riscv-fs.py
> > ```
> >
> > This disk image is based on BusyBox, which is very light-weight. The
> source
> > for building this image is found here:
> >
> https://gem5.googlesource.com/public/gem5-resources/+/refs/heads/stable/src/riscv-fs
> >
> > --
> > Dr. Bobby R. Bruce
> > Room 3050,
> > Kemper Hall, UC Davis
> > Davis,
> > CA, 95616
> >
> > web: https://www.bobbybruce.net
> >
> >
> > On Mon, Mar 14, 2022 at 11:12 AM Bobby Bruce  wrote:
> >
> >> Oh I see, I understand now. I thought you managed to disable some
> systemd
> >> jobs (something I think Hoa struggled with), but you're just bypassing
> them
> >> by setting init to a script.
> >>
> >> Nice, I'll let you know when the new image is available. I'll see if I
> can
> >> reproduce the error you found with the READ-ONLY problem on the new
> image.
> >>
> >> --
> >> Dr. Bobby R. Bruce
> >> Room 3050,
> >> Kemper Hall, UC Davis
> >> Davis,
> >> CA, 95616
> >>
> >> web: https://www.bobbybruce.net
> >>
> >>
> >> On Mon, Mar 14, 2022 at 11:10 AM Νικόλαος Ταμπουρατζής <
> >> ntampourat...@ece.auth.gr> wrote:
> >>
> >>> Dear Boddy,
> >>>
> >>> Thank you very much for the clarifications! I used the pre-build disk
> >>> image from gem5 resources
> >>> (https://github.com/gem5/gem5-resources/tree/stable/src/riscv-ubuntu),
> >>> and I add the "init=/root/gem5_init.sh" command in the gem5 python
> >>> script in order to bypass the systemd services.
> >>>
> >>> Please let me know when your new disk image is available!
> >>>
> >>> Thanks!
> >>>
> >>> Best regards,
> >>> Nikos
> >>>
> >>>
> >>> Quoting Bobby Bruce :
> >>>
> >>> > Hey Nikos,
> >>> >
> >>> > First, you can set your own kernel arguments via the `kernel_args`
> >>> > parameter in the `set_kernel_disk_worload` function to do this sort
> of
> >>> > thing, there's no need to modify the source. You can do something
> like
> >>> this:
> >>> >
> >>> > ```
> >>> > board.set_kernel_disk_workload(
> >>> > kernel=Resource(
> >>> > "riscv-bootloader-vmlinux-5.10",
> >>> > ),
> >>> > disk_image=Resource(
> >>> > "riscv-ubuntu-20.04-img",
> >>> > ),
> >>> > kernel_args=get_default_kernel_args() +
> >>> ["init=/root/gem5_init.sh'"],
> >>> > )
> >>> > ```
> >>> >
> >>> > Anyway, to answer your question: It looks like you made some error
> when
> >>> > creating your disk image and set things up in a read-only partition.
> >>> That'd
> >>> > be my best guess at this point. You should try to ensure you setup
> the
> >>> > partitions correctly in the disk image. Given I don't know how you
> >>> created
> >>> > this new image, I can't help much further.
> >>> >
> >>> > We should have a new RISCV disk image available by the end of today
> (it
> >>> > took as a bit longer than expected). It still takes some time to
> boot,
> >>> but
> >>> > it's more stable than the one we currently provide.
> >>> >
> >>> > Out of curiosity, how did you remove your systemd processes? How are
> you
> >>> > building this disk image? With what OS are you booting?
> >>> >
> >>> > Kind regards,
> >>> > Bobby
> >>> > --
> >>> > Dr. Bobby R. Bruce
> >>> > Room 3050,
> >>> > Kemper Hall, UC Davis
> >>> > Davis,
> >>> > CA, 95616
> >>> >
> >>> > web: https://www.bobbybruce.net
> >>> >
> >>> >
> >>> > On Mon, Mar 14, 2022 at 4:04 AM Νικόλαος Ταμπουρατζής <
> >>> > ntampourat...@ece.auth.gr> wrote:
> >>> >>
> >>> >> Dear all, Bobby and Hoa,
> >>> >>
> >>> >> I add this command (self.workload.command_line += '
> >>> >> init=/root/gem5_init.sh') in 169 line of
> >>> >> gem5/src/python/gem5/components/boards/kernel_disk_workload.py and I
> >>> >> build the gem5. Using this command, the gem5 is able to boot after
> 10
> >>> >> minutes (without a large number of systemd services). However, when
> it
> >>> >> boot

[gem5-users] Re: riscv-ubuntu 20.04 FS mode

2022-03-14 Thread Hoa Nguyen via gem5-users
Hi Nikos,

You wouldn't need to add "init=/root/gem5_init.sh" to the kernel args if
you use the lightweight disk image!

Regards,
Hoa Nguyen

On Mon, Mar 14, 2022, 11:39 Νικόλαος Ταμπουρατζής via gem5-users <
gem5-users@gem5.org> wrote:

> Thank you Boddy!
>
> I have also used this image but I get the same READ-ONLY problem.
> However, I would like to use Ubuntu in order to install packages using
> apt-get install through qemu. Using the "init=/root/gem5_init.sh"
> command both images boot only in 10 minutes.
>
> Best regards,
> Nikos
>
>
> Quoting Bobby Bruce :
>
> > Just remembered: If you're wanting to bi-pass large parts of the Ubuntu
> OS
> > like this, you may just want to use the "riscv-disk-image" (
> > http://dist.gem5.org/dist/v21-2/images/riscv/busybox/riscv-disk.img.gz),
> an
> > example usage of which can be found in
> > "configs/example/gem5_library/riscv-fs.py":
> >
> > ```
> > ./build/RISCV/gem5.opt configs/example/gem5_library/riscv-fs.py
> > ```
> >
> > This disk image is based on BusyBox, which is very light-weight. The
> source
> > for building this image is found here:
> >
> https://gem5.googlesource.com/public/gem5-resources/+/refs/heads/stable/src/riscv-fs
> >
> > --
> > Dr. Bobby R. Bruce
> > Room 3050,
> > Kemper Hall, UC Davis
> > Davis,
> > CA, 95616
> >
> > web: https://www.bobbybruce.net
> >
> >
> > On Mon, Mar 14, 2022 at 11:12 AM Bobby Bruce  wrote:
> >
> >> Oh I see, I understand now. I thought you managed to disable some
> systemd
> >> jobs (something I think Hoa struggled with), but you're just bypassing
> them
> >> by setting init to a script.
> >>
> >> Nice, I'll let you know when the new image is available. I'll see if I
> can
> >> reproduce the error you found with the READ-ONLY problem on the new
> image.
> >>
> >> --
> >> Dr. Bobby R. Bruce
> >> Room 3050,
> >> Kemper Hall, UC Davis
> >> Davis,
> >> CA, 95616
> >>
> >> web: https://www.bobbybruce.net
> >>
> >>
> >> On Mon, Mar 14, 2022 at 11:10 AM Νικόλαος Ταμπουρατζής <
> >> ntampourat...@ece.auth.gr> wrote:
> >>
> >>> Dear Boddy,
> >>>
> >>> Thank you very much for the clarifications! I used the pre-build disk
> >>> image from gem5 resources
> >>> (https://github.com/gem5/gem5-resources/tree/stable/src/riscv-ubuntu),
> >>> and I add the "init=/root/gem5_init.sh" command in the gem5 python
> >>> script in order to bypass the systemd services.
> >>>
> >>> Please let me know when your new disk image is available!
> >>>
> >>> Thanks!
> >>>
> >>> Best regards,
> >>> Nikos
> >>>
> >>>
> >>> Quoting Bobby Bruce :
> >>>
> >>> > Hey Nikos,
> >>> >
> >>> > First, you can set your own kernel arguments via the `kernel_args`
> >>> > parameter in the `set_kernel_disk_worload` function to do this sort
> of
> >>> > thing, there's no need to modify the source. You can do something
> like
> >>> this:
> >>> >
> >>> > ```
> >>> > board.set_kernel_disk_workload(
> >>> > kernel=Resource(
> >>> > "riscv-bootloader-vmlinux-5.10",
> >>> > ),
> >>> > disk_image=Resource(
> >>> > "riscv-ubuntu-20.04-img",
> >>> > ),
> >>> > kernel_args=get_default_kernel_args() +
> >>> ["init=/root/gem5_init.sh'"],
> >>> > )
> >>> > ```
> >>> >
> >>> > Anyway, to answer your question: It looks like you made some error
> when
> >>> > creating your disk image and set things up in a read-only partition.
> >>> That'd
> >>> > be my best guess at this point. You should try to ensure you setup
> the
> >>> > partitions correctly in the disk image. Given I don't know how you
> >>> created
> >>> > this new image, I can't help much further.
> >>> >
> >>> > We should have a new RISCV disk image available by the end of today
> (it
> >>> > took as a bit longer than expected). It still takes some time to
> boot,
> >>> but
> >>> > it's more stable than the one we currently provide.
> >>> >
> >>> > Out of curiosity, how did you remove your systemd processes? How are
> you
> >>> > building this disk image? With what OS are you booting?
> >>> >
> >>> > Kind regards,
> >>> > Bobby
> >>> > --
> >>> > Dr. Bobby R. Bruce
> >>> > Room 3050,
> >>> > Kemper Hall, UC Davis
> >>> > Davis,
> >>> > CA, 95616
> >>> >
> >>> > web: https://www.bobbybruce.net
> >>> >
> >>> >
> >>> > On Mon, Mar 14, 2022 at 4:04 AM Νικόλαος Ταμπουρατζής <
> >>> > ntampourat...@ece.auth.gr> wrote:
> >>> >>
> >>> >> Dear all, Bobby and Hoa,
> >>> >>
> >>> >> I add this command (self.workload.command_line += '
> >>> >> init=/root/gem5_init.sh') in 169 line of
> >>> >> gem5/src/python/gem5/components/boards/kernel_disk_workload.py and I
> >>> >> build the gem5. Using this command, the gem5 is able to boot after
> 10
> >>> >> minutes (without a large number of systemd services). However, when
> it
> >>> >> boots and read the gem5_init.sh, I get the following:"cannot create
> >>> >> /tmp/script: Read-only file system". And of course, nothing can be
> >>> >> written in the filesystem. How can I resolve this?
> >>> >>
> >>> >> Thank you in advance!!!
> >>> >>
> >>> >> Best regards,

[gem5-users] Re: riscv-ubuntu 20.04 FS mode

2022-03-14 Thread Νικόλαος Ταμπουρατζής via gem5-users

Thank you Boddy!

I have also used this image but I get the same READ-ONLY problem.  
However, I would like to use Ubuntu in order to install packages using  
apt-get install through qemu. Using the "init=/root/gem5_init.sh"  
command both images boot only in 10 minutes.


Best regards,
Nikos


Quoting Bobby Bruce :


Just remembered: If you're wanting to bi-pass large parts of the Ubuntu OS
like this, you may just want to use the "riscv-disk-image" (
http://dist.gem5.org/dist/v21-2/images/riscv/busybox/riscv-disk.img.gz), an
example usage of which can be found in
"configs/example/gem5_library/riscv-fs.py":

```
./build/RISCV/gem5.opt configs/example/gem5_library/riscv-fs.py
```

This disk image is based on BusyBox, which is very light-weight. The source
for building this image is found here:
https://gem5.googlesource.com/public/gem5-resources/+/refs/heads/stable/src/riscv-fs

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

web: https://www.bobbybruce.net


On Mon, Mar 14, 2022 at 11:12 AM Bobby Bruce  wrote:


Oh I see, I understand now. I thought you managed to disable some systemd
jobs (something I think Hoa struggled with), but you're just bypassing them
by setting init to a script.

Nice, I'll let you know when the new image is available. I'll see if I can
reproduce the error you found with the READ-ONLY problem on the new image.

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

web: https://www.bobbybruce.net


On Mon, Mar 14, 2022 at 11:10 AM Νικόλαος Ταμπουρατζής <
ntampourat...@ece.auth.gr> wrote:


Dear Boddy,

Thank you very much for the clarifications! I used the pre-build disk
image from gem5 resources
(https://github.com/gem5/gem5-resources/tree/stable/src/riscv-ubuntu),
and I add the "init=/root/gem5_init.sh" command in the gem5 python
script in order to bypass the systemd services.

Please let me know when your new disk image is available!

Thanks!

Best regards,
Nikos


Quoting Bobby Bruce :

> Hey Nikos,
>
> First, you can set your own kernel arguments via the `kernel_args`
> parameter in the `set_kernel_disk_worload` function to do this sort of
> thing, there's no need to modify the source. You can do something like
this:
>
> ```
> board.set_kernel_disk_workload(
> kernel=Resource(
> "riscv-bootloader-vmlinux-5.10",
> ),
> disk_image=Resource(
> "riscv-ubuntu-20.04-img",
> ),
> kernel_args=get_default_kernel_args() +
["init=/root/gem5_init.sh'"],
> )
> ```
>
> Anyway, to answer your question: It looks like you made some error when
> creating your disk image and set things up in a read-only partition.
That'd
> be my best guess at this point. You should try to ensure you setup the
> partitions correctly in the disk image. Given I don't know how you
created
> this new image, I can't help much further.
>
> We should have a new RISCV disk image available by the end of today (it
> took as a bit longer than expected). It still takes some time to boot,
but
> it's more stable than the one we currently provide.
>
> Out of curiosity, how did you remove your systemd processes? How are you
> building this disk image? With what OS are you booting?
>
> Kind regards,
> Bobby
> --
> Dr. Bobby R. Bruce
> Room 3050,
> Kemper Hall, UC Davis
> Davis,
> CA, 95616
>
> web: https://www.bobbybruce.net
>
>
> On Mon, Mar 14, 2022 at 4:04 AM Νικόλαος Ταμπουρατζής <
> ntampourat...@ece.auth.gr> wrote:
>>
>> Dear all, Bobby and Hoa,
>>
>> I add this command (self.workload.command_line += '
>> init=/root/gem5_init.sh') in 169 line of
>> gem5/src/python/gem5/components/boards/kernel_disk_workload.py and I
>> build the gem5. Using this command, the gem5 is able to boot after 10
>> minutes (without a large number of systemd services). However, when it
>> boots and read the gem5_init.sh, I get the following:"cannot create
>> /tmp/script: Read-only file system". And of course, nothing can be
>> written in the filesystem. How can I resolve this?
>>
>> Thank you in advance!!!
>>
>> Best regards,
>> Nikos
>>
>>
>> Quoting Νικόλαος Ταμπουρατζής via gem5-users :
>>
>> > Dear Bobby and Hoa,
>> >
>> > Thank you for your advice! It is working properly using the
>> > CustomDiskImageResource (including the following command: from
>> > gem5.resources.resource import Resource, CustomDiskImageResource).
>> >
>> > Is there any news about booting faster of `riscv-ubuntu-20.04-img`?
>> > I am able to emulate the image using qemu
>> > (http://resources.gem5.org/resources/riscv-ubuntu), but I do not
>> > know what services I need to disable in order to boot faster the
>> > image!
>> >
>> > Best regards,
>> > Nikolaos Tampouratzis
>> >
>> >
>> > Quoting Bobby Bruce via gem5-users :
>> >
>> >> Hey Nikos,
>> >>
>> >> I'm not sure I know exactly how to remove all these annoying systemd
>> >> services. Currently Hoa is assigned this task:
>> >> https://gem5.atlassian.net/browse/GEM5-1177
>> >>
>> >> @Hoa can you make this a top priority for you? I think 6+ hour

[gem5-users] Re: riscv-ubuntu 20.04 FS mode

2022-03-14 Thread Bobby Bruce via gem5-users
Just remembered: If you're wanting to bi-pass large parts of the Ubuntu OS
like this, you may just want to use the "riscv-disk-image" (
http://dist.gem5.org/dist/v21-2/images/riscv/busybox/riscv-disk.img.gz), an
example usage of which can be found in
"configs/example/gem5_library/riscv-fs.py":

```
./build/RISCV/gem5.opt configs/example/gem5_library/riscv-fs.py
```

This disk image is based on BusyBox, which is very light-weight. The source
for building this image is found here:
https://gem5.googlesource.com/public/gem5-resources/+/refs/heads/stable/src/riscv-fs

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

web: https://www.bobbybruce.net


On Mon, Mar 14, 2022 at 11:12 AM Bobby Bruce  wrote:

> Oh I see, I understand now. I thought you managed to disable some systemd
> jobs (something I think Hoa struggled with), but you're just bypassing them
> by setting init to a script.
>
> Nice, I'll let you know when the new image is available. I'll see if I can
> reproduce the error you found with the READ-ONLY problem on the new image.
>
> --
> Dr. Bobby R. Bruce
> Room 3050,
> Kemper Hall, UC Davis
> Davis,
> CA, 95616
>
> web: https://www.bobbybruce.net
>
>
> On Mon, Mar 14, 2022 at 11:10 AM Νικόλαος Ταμπουρατζής <
> ntampourat...@ece.auth.gr> wrote:
>
>> Dear Boddy,
>>
>> Thank you very much for the clarifications! I used the pre-build disk
>> image from gem5 resources
>> (https://github.com/gem5/gem5-resources/tree/stable/src/riscv-ubuntu),
>> and I add the "init=/root/gem5_init.sh" command in the gem5 python
>> script in order to bypass the systemd services.
>>
>> Please let me know when your new disk image is available!
>>
>> Thanks!
>>
>> Best regards,
>> Nikos
>>
>>
>> Quoting Bobby Bruce :
>>
>> > Hey Nikos,
>> >
>> > First, you can set your own kernel arguments via the `kernel_args`
>> > parameter in the `set_kernel_disk_worload` function to do this sort of
>> > thing, there's no need to modify the source. You can do something like
>> this:
>> >
>> > ```
>> > board.set_kernel_disk_workload(
>> > kernel=Resource(
>> > "riscv-bootloader-vmlinux-5.10",
>> > ),
>> > disk_image=Resource(
>> > "riscv-ubuntu-20.04-img",
>> > ),
>> > kernel_args=get_default_kernel_args() +
>> ["init=/root/gem5_init.sh'"],
>> > )
>> > ```
>> >
>> > Anyway, to answer your question: It looks like you made some error when
>> > creating your disk image and set things up in a read-only partition.
>> That'd
>> > be my best guess at this point. You should try to ensure you setup the
>> > partitions correctly in the disk image. Given I don't know how you
>> created
>> > this new image, I can't help much further.
>> >
>> > We should have a new RISCV disk image available by the end of today (it
>> > took as a bit longer than expected). It still takes some time to boot,
>> but
>> > it's more stable than the one we currently provide.
>> >
>> > Out of curiosity, how did you remove your systemd processes? How are you
>> > building this disk image? With what OS are you booting?
>> >
>> > Kind regards,
>> > Bobby
>> > --
>> > Dr. Bobby R. Bruce
>> > Room 3050,
>> > Kemper Hall, UC Davis
>> > Davis,
>> > CA, 95616
>> >
>> > web: https://www.bobbybruce.net
>> >
>> >
>> > On Mon, Mar 14, 2022 at 4:04 AM Νικόλαος Ταμπουρατζής <
>> > ntampourat...@ece.auth.gr> wrote:
>> >>
>> >> Dear all, Bobby and Hoa,
>> >>
>> >> I add this command (self.workload.command_line += '
>> >> init=/root/gem5_init.sh') in 169 line of
>> >> gem5/src/python/gem5/components/boards/kernel_disk_workload.py and I
>> >> build the gem5. Using this command, the gem5 is able to boot after 10
>> >> minutes (without a large number of systemd services). However, when it
>> >> boots and read the gem5_init.sh, I get the following:"cannot create
>> >> /tmp/script: Read-only file system". And of course, nothing can be
>> >> written in the filesystem. How can I resolve this?
>> >>
>> >> Thank you in advance!!!
>> >>
>> >> Best regards,
>> >> Nikos
>> >>
>> >>
>> >> Quoting Νικόλαος Ταμπουρατζής via gem5-users :
>> >>
>> >> > Dear Bobby and Hoa,
>> >> >
>> >> > Thank you for your advice! It is working properly using the
>> >> > CustomDiskImageResource (including the following command: from
>> >> > gem5.resources.resource import Resource, CustomDiskImageResource).
>> >> >
>> >> > Is there any news about booting faster of `riscv-ubuntu-20.04-img`?
>> >> > I am able to emulate the image using qemu
>> >> > (http://resources.gem5.org/resources/riscv-ubuntu), but I do not
>> >> > know what services I need to disable in order to boot faster the
>> >> > image!
>> >> >
>> >> > Best regards,
>> >> > Nikolaos Tampouratzis
>> >> >
>> >> >
>> >> > Quoting Bobby Bruce via gem5-users :
>> >> >
>> >> >> Hey Nikos,
>> >> >>
>> >> >> I'm not sure I know exactly how to remove all these annoying systemd
>> >> >> services. Currently Hoa is assigned this task:
>> >> >> https://gem5.atlassian.net/browse/GEM5-1177
>> >> >>
>> >> >> @Hoa can you make t

[gem5-users] Re: gem5 : X86 + GCN3 (gfx8001) + test_fwd_conv

2022-03-14 Thread David Fong via gem5-users
Hi Kyle,

Any workarounds for this issue?
Also, what are the other DNNMark tests I can try which don’t need special 
cmd-line settings?

Thanks,

David


From: David Fong via gem5-users 
Sent: Friday, March 11, 2022 9:23 AM
To: Matt Sinclair ; gem5 users mailing list 
; Kyle Roarty 
Cc: Matthew Poremba ; David Fong 

Subject: [gem5-users] Re: gem5 : X86 + GCN3 (gfx8001) + test_fwd_conv

Hi Matt,
I’m not changing any NCHW sizes.
I don’t even know what this parameter does.
I’m guessing the invalid filter channel number is related to the file read 
problem.
David


From: Matt Sinclair mailto:sincl...@cs.wisc.edu>>
Sent: Friday, March 11, 2022 9:15 AM
To: David Fong mailto:da...@chronostech.com>>; gem5 
users mailing list mailto:gem5-users@gem5.org>>; Kyle 
Roarty mailto:kroa...@wisc.edu>>
Cc: Matthew Poremba mailto:matthew.pore...@amd.com>>
Subject: RE: [gem5-users] Re: gem5 : X86 + GCN3 (gfx8001) + test_fwd_conv

Well it looks like things are progressing further with the larger memory size, 
so that’s good.

@Kyle Roarty: can you please take a look at this?  My 
guess is that > 200 CUs is again calling a different file?  Because this 
warning:

MIOpen(HIP): Warning [ParseAndLoadDb] File is unreadable: 
/opt/rocm-4.0.1/miopen/share/miopen/db/gfx801100.HIP.fdb.txt

Seems like the root of the problem.  My line numbers are off by 1 from David’s, 
but I’m guessing it’s this that the “real” failure is happening:

MIOPEN_CALL(miopenCreateTensorDescriptor(&desc_));

But I’m guessing that is failing because the kernel files are not being read 
properly.

@David: are you changing the NCHW sizes at all?  The other weird thing is the 
invalid filter channel number part.

Matt

From: David Fong mailto:da...@chronostech.com>>
Sent: Friday, March 11, 2022 11:08 AM
To: Matt Sinclair mailto:sincl...@cs.wisc.edu>>; gem5 
users mailing list mailto:gem5-users@gem5.org>>
Cc: Kyle Roarty mailto:kroa...@wisc.edu>>; Matthew Poremba 
mailto:matthew.pore...@amd.com>>
Subject: RE: [gem5-users] Re: gem5 : X86 + GCN3 (gfx8001) + test_fwd_conv

Hi Matt,

I added the –mem-size 8GB and there are some other messages and errors showing 
up now.

MIOpen(HIP): Warning [ParseAndLoadDb] File is unreadable: 
/opt/rocm-4.0.1/miopen/share/miopen/db/gfx801100.HIP.fdb.txt
build/GCN3_X86/sim/syscall_emul.cc:683: warn: fcntl: unsupported command 6
build/GCN3_X86/sim/syscall_emul.cc:683: warn: fcntl: unsupported command 6
MIOpen Error: /root/driver/MLOpen/src/ocl/convolutionocl.cpp:150: Invalid 
filter channel number
build/GCN3_X86/sim/syscall_emul.cc:683: warn: fcntl: unsupported command 6
build/GCN3_X86/sim/syscall_emul.cc:683: warn: fcntl: unsupported command 6
MIOpen Error: /root/driver/MLOpen/src/ocl/convolutionocl.cpp:150: Invalid 
filter channel number
MIOpen Error: 3 at 
/home/dfong/work/ext_ips/gem5-apu-cu256-dnn/gem5/gem5-resources/src/gpu/DNNMark/core/include/dnn_utility.h1057Ticks:
 264369621500

David

docker run --rm -v ${PWD}:${PWD} -v 
${PWD}/gem5/gem5-resources/src/gpu/DNNMark/cachefiles:/root/.cache/miopen/2.9.0 
-w ${PWD} gcr.io/gem5-test/gcn-gpu:v21-2 gem5/build/GCN3_X86/gem5.opt 
gem5/configs/example/apu_se.py --mem-size 8GB --num-compute-units 256 -n3 
--benchmark-root=gem5/gem5-resources/src/gpu/DNNMark/build/benchmarks/test_fwd_conv
 -cdnnmark_test_fwd_conv --options="-config 
gem5/gem5-resources/src/gpu/DNNMark/config_example/conv_config.dnnmark -mmap 
gem5/gem5-resources/src/gpu/DNNMark/mmap.bin" |& tee 
gem5_apu_cu256_8GB_run_dnnmark_test_fwd_conv_40latency.log
Global frequency set at 1 ticks per second
build/GCN3_X86/base/stats/storage.hh:279: warn: Bucket size (5) does not divide 
range [1:75] into equal-sized buckets. Rounding up.
build/GCN3_X86/base/stats/storage.hh:279: warn: Bucket size (2) does not divide 
range [1:10] into equal-sized buckets. Rounding up.
build/GCN3_X86/base/stats/storage.hh:279: warn: Bucket size (2) does not divide 
range [1:64] into equal-sized buckets. Rounding up.
build/GCN3_X86/base/stats/storage.hh:279: warn: Bucket size (1) does not 
divide range [1:1e+06] into equal-sized buckets. Rounding up.
. . .
Forcing maxCoalescedReqs to 32 (TLB assoc.)
Forcing maxCoalescedReqs to 32 (TLB assoc.)
build/GCN3_X86/base/remote_gdb.cc:381: warn: Sockets disabled, not accepting 
gdb connections
tcmalloc: large alloc 1073741824 bytes == 0x55f2039c2000 @  0x7f2bdb141680 
0x7f2bdb161ff4 0x55f1bb897441 0x55f1bbf47e53 0x55f1bb316617 0x7f2bdb609718 
0x7f2bdb609afb 0x7f2bdb609dc0 0x7f2bdb3d5d6d 0x7f2bdb3ddef6 0x7f2bdb52becb 
0x7f2bdb6090f4 0x7f2bdb3d5d6d 0x7f2bdb3ddef6 0x7f2bdb52becb 0x7f2bdb52c252 
0x7f2bdb52c63f 0x7f2bdb530c81 0x7f2bdb5c0527 0x7f2bdb3d5d6d 0x7f2bdb3d746d 
0x7f2bdb3e106b 0x7f2bdb609810 0x55f1bb92ed14 0x55f1ba9956f6 0x7f2bda4db0b3 
0x55f1ba9b604e
warn: dir_cntrl0.memory is deprecated. The request port for Ruby memory output 
to the main memory is now called `memory_out_port`
warn: system.ruby.network adopting orphan SimObject param 'ext_links'
warn: system.ru

[gem5-users] Re: riscv-ubuntu 20.04 FS mode

2022-03-14 Thread Bobby Bruce via gem5-users
Oh I see, I understand now. I thought you managed to disable some systemd
jobs (something I think Hoa struggled with), but you're just bypassing them
by setting init to a script.

Nice, I'll let you know when the new image is available. I'll see if I can
reproduce the error you found with the READ-ONLY problem on the new image.

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

web: https://www.bobbybruce.net


On Mon, Mar 14, 2022 at 11:10 AM Νικόλαος Ταμπουρατζής <
ntampourat...@ece.auth.gr> wrote:

> Dear Boddy,
>
> Thank you very much for the clarifications! I used the pre-build disk
> image from gem5 resources
> (https://github.com/gem5/gem5-resources/tree/stable/src/riscv-ubuntu),
> and I add the "init=/root/gem5_init.sh" command in the gem5 python
> script in order to bypass the systemd services.
>
> Please let me know when your new disk image is available!
>
> Thanks!
>
> Best regards,
> Nikos
>
>
> Quoting Bobby Bruce :
>
> > Hey Nikos,
> >
> > First, you can set your own kernel arguments via the `kernel_args`
> > parameter in the `set_kernel_disk_worload` function to do this sort of
> > thing, there's no need to modify the source. You can do something like
> this:
> >
> > ```
> > board.set_kernel_disk_workload(
> > kernel=Resource(
> > "riscv-bootloader-vmlinux-5.10",
> > ),
> > disk_image=Resource(
> > "riscv-ubuntu-20.04-img",
> > ),
> > kernel_args=get_default_kernel_args() + ["init=/root/gem5_init.sh'"],
> > )
> > ```
> >
> > Anyway, to answer your question: It looks like you made some error when
> > creating your disk image and set things up in a read-only partition.
> That'd
> > be my best guess at this point. You should try to ensure you setup the
> > partitions correctly in the disk image. Given I don't know how you
> created
> > this new image, I can't help much further.
> >
> > We should have a new RISCV disk image available by the end of today (it
> > took as a bit longer than expected). It still takes some time to boot,
> but
> > it's more stable than the one we currently provide.
> >
> > Out of curiosity, how did you remove your systemd processes? How are you
> > building this disk image? With what OS are you booting?
> >
> > Kind regards,
> > Bobby
> > --
> > Dr. Bobby R. Bruce
> > Room 3050,
> > Kemper Hall, UC Davis
> > Davis,
> > CA, 95616
> >
> > web: https://www.bobbybruce.net
> >
> >
> > On Mon, Mar 14, 2022 at 4:04 AM Νικόλαος Ταμπουρατζής <
> > ntampourat...@ece.auth.gr> wrote:
> >>
> >> Dear all, Bobby and Hoa,
> >>
> >> I add this command (self.workload.command_line += '
> >> init=/root/gem5_init.sh') in 169 line of
> >> gem5/src/python/gem5/components/boards/kernel_disk_workload.py and I
> >> build the gem5. Using this command, the gem5 is able to boot after 10
> >> minutes (without a large number of systemd services). However, when it
> >> boots and read the gem5_init.sh, I get the following:"cannot create
> >> /tmp/script: Read-only file system". And of course, nothing can be
> >> written in the filesystem. How can I resolve this?
> >>
> >> Thank you in advance!!!
> >>
> >> Best regards,
> >> Nikos
> >>
> >>
> >> Quoting Νικόλαος Ταμπουρατζής via gem5-users :
> >>
> >> > Dear Bobby and Hoa,
> >> >
> >> > Thank you for your advice! It is working properly using the
> >> > CustomDiskImageResource (including the following command: from
> >> > gem5.resources.resource import Resource, CustomDiskImageResource).
> >> >
> >> > Is there any news about booting faster of `riscv-ubuntu-20.04-img`?
> >> > I am able to emulate the image using qemu
> >> > (http://resources.gem5.org/resources/riscv-ubuntu), but I do not
> >> > know what services I need to disable in order to boot faster the
> >> > image!
> >> >
> >> > Best regards,
> >> > Nikolaos Tampouratzis
> >> >
> >> >
> >> > Quoting Bobby Bruce via gem5-users :
> >> >
> >> >> Hey Nikos,
> >> >>
> >> >> I'm not sure I know exactly how to remove all these annoying systemd
> >> >> services. Currently Hoa is assigned this task:
> >> >> https://gem5.atlassian.net/browse/GEM5-1177
> >> >>
> >> >> @Hoa can you make this a top priority for you? I think 6+ hours for a
> > boot
> >> >> is a bit too much. I'm sure there must be a way to modify this disk
> > image
> >> >> to make it faster.
> >> >>
> >> >> To answer your second question, this should work:
> >> >>
> >> >> ```
> >> >>
> >> >> image = CustomDiskImageResource(
> >> >>local_path = "path/to/your/disk/image/here",
> >> >>disk_root_partition = "1", # This is the partition in the disk
> > image to
> >> >> use. 'None' if there is no disk image
> >> >> )
> >> >>
> >> >> board.set_kernel_disk_workload(
> >> >>kernel = Resource("riscv-bootloader-vmlinux-5.10"),
> >> >>disk_image = image,
> >> >> )
> >> >>
> >> >> ```
> >> >>
> >> >>
> >> >>
> >> >> Dr. Bobby R. Bruce
> >> >> Room 3050,
> >> >> Kemper Hall, UC Davis
> >> >> Davis,
> >> >> CA, 95616
> >> >>
> >> >> web: https://www.bobbybruce.net
> >> >>
> >> >>
> >>

[gem5-users] Re: riscv-ubuntu 20.04 FS mode

2022-03-14 Thread Νικόλαος Ταμπουρατζής via gem5-users

Dear Boddy,

Thank you very much for the clarifications! I used the pre-build disk  
image from gem5 resources  
(https://github.com/gem5/gem5-resources/tree/stable/src/riscv-ubuntu),  
and I add the "init=/root/gem5_init.sh" command in the gem5 python  
script in order to bypass the systemd services.


Please let me know when your new disk image is available!

Thanks!

Best regards,
Nikos


Quoting Bobby Bruce :


Hey Nikos,

First, you can set your own kernel arguments via the `kernel_args`
parameter in the `set_kernel_disk_worload` function to do this sort of
thing, there's no need to modify the source. You can do something like this:

```
board.set_kernel_disk_workload(
kernel=Resource(
"riscv-bootloader-vmlinux-5.10",
),
disk_image=Resource(
"riscv-ubuntu-20.04-img",
),
kernel_args=get_default_kernel_args() + ["init=/root/gem5_init.sh'"],
)
```

Anyway, to answer your question: It looks like you made some error when
creating your disk image and set things up in a read-only partition. That'd
be my best guess at this point. You should try to ensure you setup the
partitions correctly in the disk image. Given I don't know how you created
this new image, I can't help much further.

We should have a new RISCV disk image available by the end of today (it
took as a bit longer than expected). It still takes some time to boot, but
it's more stable than the one we currently provide.

Out of curiosity, how did you remove your systemd processes? How are you
building this disk image? With what OS are you booting?

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

web: https://www.bobbybruce.net


On Mon, Mar 14, 2022 at 4:04 AM Νικόλαος Ταμπουρατζής <
ntampourat...@ece.auth.gr> wrote:


Dear all, Bobby and Hoa,

I add this command (self.workload.command_line += '
init=/root/gem5_init.sh') in 169 line of
gem5/src/python/gem5/components/boards/kernel_disk_workload.py and I
build the gem5. Using this command, the gem5 is able to boot after 10
minutes (without a large number of systemd services). However, when it
boots and read the gem5_init.sh, I get the following:"cannot create
/tmp/script: Read-only file system". And of course, nothing can be
written in the filesystem. How can I resolve this?

Thank you in advance!!!

Best regards,
Nikos


Quoting Νικόλαος Ταμπουρατζής via gem5-users :

> Dear Bobby and Hoa,
>
> Thank you for your advice! It is working properly using the
> CustomDiskImageResource (including the following command: from
> gem5.resources.resource import Resource, CustomDiskImageResource).
>
> Is there any news about booting faster of `riscv-ubuntu-20.04-img`?
> I am able to emulate the image using qemu
> (http://resources.gem5.org/resources/riscv-ubuntu), but I do not
> know what services I need to disable in order to boot faster the
> image!
>
> Best regards,
> Nikolaos Tampouratzis
>
>
> Quoting Bobby Bruce via gem5-users :
>
>> Hey Nikos,
>>
>> I'm not sure I know exactly how to remove all these annoying systemd
>> services. Currently Hoa is assigned this task:
>> https://gem5.atlassian.net/browse/GEM5-1177
>>
>> @Hoa can you make this a top priority for you? I think 6+ hours for a

boot

>> is a bit too much. I'm sure there must be a way to modify this disk

image

>> to make it faster.
>>
>> To answer your second question, this should work:
>>
>> ```
>>
>> image = CustomDiskImageResource(
>>local_path = "path/to/your/disk/image/here",
>>disk_root_partition = "1", # This is the partition in the disk

image to

>> use. 'None' if there is no disk image
>> )
>>
>> board.set_kernel_disk_workload(
>>kernel = Resource("riscv-bootloader-vmlinux-5.10"),
>>disk_image = image,
>> )
>>
>> ```
>>
>>
>>
>> Dr. Bobby R. Bruce
>> Room 3050,
>> Kemper Hall, UC Davis
>> Davis,
>> CA, 95616
>>
>> web: https://www.bobbybruce.net
>>
>>
>> On Sat, Feb 12, 2022 at 7:19 AM Νικόλαος Ταμπουρατζής via gem5-users <
>> gem5-users@gem5.org> wrote:
>>
>>> Dear all,
>>>
>>> I have successfully emulated the riscv-ubuntu.img through qemu! The
>>> problem was that I use Ubuntu 20.04 and it requires the Hirsute’s
>>> version of u-boot-qemu (wget
>>>
>>>

http://mirrors.kernel.org/ubuntu/pool/main/u/u-boot/u-boot-qemu_2021.01+dfsg-3ubuntu9_all.deb
)

>>> and not the standard through the apt
>>> install.
>>>
>>> Now I have two questions:
>>>
>>> 1) How can I disable the huge number of services in order to speedup
>>> the gem5 boot process through qemu?
>>>
>>> 2) When I execute the following: "./build/RISCV/gem5.opt
>>> configs/example/gem5_library/riscv-ubuntu-run.py", it downloads
>>> automatically the riscv-ubuntu-20.04-img. How can I set another image?
>>> The --disk-image option is not working.
>>>
>>>
>>> Thank you in advance!!!
>>> Best regards,
>>> Nikos
>>>
>>>
>>> Quoting Νικόλαος Ταμπουρατζής via gem5-users :
>>>
 Dear Hoa,

 Thank you very much for your information! I try to emulate the
 ubuntu-image through qemu

[gem5-users] Re: Is thread lock not working under both SE and FS mode?

2022-03-14 Thread Jason Lowe-Power via gem5-users
Hi Meng,

It depends on the ISA you're using and the configuration of the system. For
instance, x86+classic caches is known to have some synchronization issues.
The transactional memory support only works with Arm, and I'm not sure
which memory system it requires.

What system are you trying to simulate?

Cheers,
Jason

On Sat, Mar 12, 2022 at 11:45 PM Chen Meng via gem5-users <
gem5-users@gem5.org> wrote:

> Hi!
>
> I was trying to run a multi-threaded program with thread locks, I tried
> many methods but only to result in failure. I borrowed the program code
> with thread lock from the following page:
> https://www.gem5.org/project/2020/10/27/tme.html , and it turns out to be
> unstable when I run it with FS mode.
>
> My gem5 version is v21.1.0.2, and my script is borrowed from
> gem5_resources also at v21.1.0.2 (
> https://gem5.googlesource.com/public/gem5-resources/+/refs/tags/v21.1.0.2),
> everything is stick to the SPEC-2017 tutorial (
> https://gem5.googlesource.com/public/gem5-resources/+/refs/tags/v21.1.0.2/src/spec-2017/README.md),
> except that I substitute the SPEC benchmarks with my own program.
>
> Any ideas are appreciated! Please reply if you have some advice or
> face/have faced the same problem. Thanks!
>
> Best Regards,
> Meng
> ___
> 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: riscv-ubuntu 20.04 FS mode

2022-03-14 Thread Bobby Bruce via gem5-users
Hey Nikos,

First, you can set your own kernel arguments via the `kernel_args`
parameter in the `set_kernel_disk_worload` function to do this sort of
thing, there's no need to modify the source. You can do something like this:

```
board.set_kernel_disk_workload(
kernel=Resource(
"riscv-bootloader-vmlinux-5.10",
),
disk_image=Resource(
"riscv-ubuntu-20.04-img",
),
kernel_args=get_default_kernel_args() + ["init=/root/gem5_init.sh'"],
)
```

Anyway, to answer your question: It looks like you made some error when
creating your disk image and set things up in a read-only partition. That'd
be my best guess at this point. You should try to ensure you setup the
partitions correctly in the disk image. Given I don't know how you created
this new image, I can't help much further.

We should have a new RISCV disk image available by the end of today (it
took as a bit longer than expected). It still takes some time to boot, but
it's more stable than the one we currently provide.

Out of curiosity, how did you remove your systemd processes? How are you
building this disk image? With what OS are you booting?

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

web: https://www.bobbybruce.net


On Mon, Mar 14, 2022 at 4:04 AM Νικόλαος Ταμπουρατζής <
ntampourat...@ece.auth.gr> wrote:
>
> Dear all, Bobby and Hoa,
>
> I add this command (self.workload.command_line += '
> init=/root/gem5_init.sh') in 169 line of
> gem5/src/python/gem5/components/boards/kernel_disk_workload.py and I
> build the gem5. Using this command, the gem5 is able to boot after 10
> minutes (without a large number of systemd services). However, when it
> boots and read the gem5_init.sh, I get the following:"cannot create
> /tmp/script: Read-only file system". And of course, nothing can be
> written in the filesystem. How can I resolve this?
>
> Thank you in advance!!!
>
> Best regards,
> Nikos
>
>
> Quoting Νικόλαος Ταμπουρατζής via gem5-users :
>
> > Dear Bobby and Hoa,
> >
> > Thank you for your advice! It is working properly using the
> > CustomDiskImageResource (including the following command: from
> > gem5.resources.resource import Resource, CustomDiskImageResource).
> >
> > Is there any news about booting faster of `riscv-ubuntu-20.04-img`?
> > I am able to emulate the image using qemu
> > (http://resources.gem5.org/resources/riscv-ubuntu), but I do not
> > know what services I need to disable in order to boot faster the
> > image!
> >
> > Best regards,
> > Nikolaos Tampouratzis
> >
> >
> > Quoting Bobby Bruce via gem5-users :
> >
> >> Hey Nikos,
> >>
> >> I'm not sure I know exactly how to remove all these annoying systemd
> >> services. Currently Hoa is assigned this task:
> >> https://gem5.atlassian.net/browse/GEM5-1177
> >>
> >> @Hoa can you make this a top priority for you? I think 6+ hours for a
boot
> >> is a bit too much. I'm sure there must be a way to modify this disk
image
> >> to make it faster.
> >>
> >> To answer your second question, this should work:
> >>
> >> ```
> >>
> >> image = CustomDiskImageResource(
> >>local_path = "path/to/your/disk/image/here",
> >>disk_root_partition = "1", # This is the partition in the disk
image to
> >> use. 'None' if there is no disk image
> >> )
> >>
> >> board.set_kernel_disk_workload(
> >>kernel = Resource("riscv-bootloader-vmlinux-5.10"),
> >>disk_image = image,
> >> )
> >>
> >> ```
> >>
> >>
> >>
> >> Dr. Bobby R. Bruce
> >> Room 3050,
> >> Kemper Hall, UC Davis
> >> Davis,
> >> CA, 95616
> >>
> >> web: https://www.bobbybruce.net
> >>
> >>
> >> On Sat, Feb 12, 2022 at 7:19 AM Νικόλαος Ταμπουρατζής via gem5-users <
> >> gem5-users@gem5.org> wrote:
> >>
> >>> Dear all,
> >>>
> >>> I have successfully emulated the riscv-ubuntu.img through qemu! The
> >>> problem was that I use Ubuntu 20.04 and it requires the Hirsute’s
> >>> version of u-boot-qemu (wget
> >>>
> >>>
http://mirrors.kernel.org/ubuntu/pool/main/u/u-boot/u-boot-qemu_2021.01+dfsg-3ubuntu9_all.deb
)
> >>> and not the standard through the apt
> >>> install.
> >>>
> >>> Now I have two questions:
> >>>
> >>> 1) How can I disable the huge number of services in order to speedup
> >>> the gem5 boot process through qemu?
> >>>
> >>> 2) When I execute the following: "./build/RISCV/gem5.opt
> >>> configs/example/gem5_library/riscv-ubuntu-run.py", it downloads
> >>> automatically the riscv-ubuntu-20.04-img. How can I set another image?
> >>> The --disk-image option is not working.
> >>>
> >>>
> >>> Thank you in advance!!!
> >>> Best regards,
> >>> Nikos
> >>>
> >>>
> >>> Quoting Νικόλαος Ταμπουρατζής via gem5-users :
> >>>
>  Dear Hoa,
> 
>  Thank you very much for your information! I try to emulate the
>  ubuntu-image through qemu (following this tutorial:
>  http://resources.gem5.org/resources/riscv-ubuntu) and I get the
>  following TFTP error:
> 
>  I appreciate any help!!
> 
>  Best regards,
>  Nikos
> 
>

[gem5-users] Re: Modelling cache flushing on gem5 (RISC-V)

2022-03-14 Thread Eliot Moss via gem5-users

I just skimmed that paper (not surprised to see Gernot Heiser's name there!)
and I think that, while it would be a little bit of work, it might not be
*too* hard to implement something like fence.t for the caches.  It would be
substantially different from wbinvd.  The latter speaks to the whole cache
system, and I implemented it by a request that flows all the way up to the Point
of Coherence (memory bus) and back down as a new kind of snoop to all the
caches that talk through one or more levels to memory.  Then each cache
essentially has a little engine for writing dirty lines back.  It's that part
that would be useful here - I guess we'd be looking at a variation on it,
triggered in a slightly different way (not by a snoop, but by a different kind
of request).  To get sensible timings you'd need to decide what hardware
mechanisms are available for finding dirty lines.  I assumed they were indexed
in some way that finding at least a set with one or more dirty lines had no
substantial overhead.  L1 cache is small enough that we might get by with that
assumption.  Alternatively, assuming each set provides an "at least one dirty
line" bit, and that 64 of the these set bits can be examined by a priority
encoder to give you a set to work on - or indicate that all 64 sets are clean
- then a typical L1 cache would not need many cycles of reading those bits out
to find the relevant sets.

For 64 KB cache, 64 B lines, associativity 2, there are 512 sets, meaning we'd
need to read 8 groups of 64 of these "dirty set" bits.  The actual writing
back would usually take most of the time.

Presumably you would need to wait until all the dirty lines make it to L2,
since if the writeback buffers are clogged there might still be a
communication channel there.  Still, by the time a context switch is complete,
those buffers may be guaranteed to have cleared - provided we can make an
argument that there is a fixed maximum amount of time needed for that to
happen.

Anyway, I hope this helps.

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] Re: Modelling cache flushing on gem5 (RISC-V)

2022-03-14 Thread Eliot Moss via gem5-users

On 3/14/2022 5:54 AM, Ethan Bannister wrote:

Dear Eliot,

Sorry for the late reply.

As far as I can tell, fence.t is such an early proposal that its existence is purely in mailing list 
discussions and a research paper introducing it here 
. Despite being a fence, it's 
more of a "temporal state fence", so shared microarchitectural state is supposed to be flushed after 
it with the idea that prevents timing attacks across the fence.


As for x86 - I have seen the clflush implementation, but from what I can tell instructions like 
wbinvd are not implemented, and hence I was considering extending the protocol rather than issuing a 
large amount of line flushes.


Also - it seems RISC-V doesn't seem to have anything like x86's micro-op engine, but instead 
Load/Store templates which are provided with specific memory request flags. I was wondering if I 
could use this existing structure to implement a cache flush (like wbinvd), but am obviously 
unfamiliar with how everything is setup in gem5.


Thanks for the pointer to the research paper!

If you would find useful my changes to the caches for supporting
bulk cache operations like wbinv, I might be able to extract a
patch.  It would be a bit of work because I also have stuff for
a different mechanism in there that is part of research maybe
toward a publication, so we're not quite ready to share that part.
Let me know ...

Bet - 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] Re: FS RISCV PCI

2022-03-14 Thread Νικόλαος Ταμπουρατζής via gem5-users

Dear Ayaz, all,

Is there any news about PCI implementation on RISCV FS?

Best regards,
Nikos


Quoting Ayaz Akram :


Hi Nikolaos,

Thanks for bringing this to our attention. We are looking at this problem
here at Davis and will try to respond soon.

-Ayaz

On Sat, Apr 10, 2021 at 4:42 AM Νικόλαος Ταμπουρατζής via gem5-users <
gem5-users@gem5.org> wrote:



Dear Gem5 community,

I try to add PCI interface in RISCV arch doing the following steps
(similar with ARM RealView - I use the gem5-v21):

1) Create a file gem5/src/dev/riscv/pci_host.cc with the following code:

#include "dev/riscv/pci_host.hh"
#include "params/GenericRiscvPciHost.hh"

GenericRiscvPciHost::GenericRiscvPciHost(const GenericRiscvPciHostParams
&p)
 : GenericPciHost(p), intBase(p.int_base), intCount(p.int_count)
{
}

uint32_t
GenericRiscvPciHost::mapPciInterrupt(
 const PciBusAddr &addr, PciIntPin pin) const
{

 fatal_if(pin == PciIntPin::NO_INT,
  "%02x:%02x.%i: Interrupt from a device without interrupts\n",
  addr.bus, addr.dev, addr.func);

 return intBase + (addr.dev % intCount);
}

2) Create a file gem5/src/dev/riscv/pci_host.hh with the following code:

#ifndef __DEV_RISCV_PCI_HOST_HH__
#define __DEV_RISCV_PCI_HOST_HH__

#include "dev/pci/host.hh"

struct GenericRiscvPciHostParams;

class GenericRiscvPciHost : public GenericPciHost
{
   private:
 const uint32_t intBase;
 const uint32_t intCount;

   public:
 GenericRiscvPciHost(const GenericRiscvPciHostParams &p);
 virtual ~GenericRiscvPciHost() {}

   protected:
 uint32_t mapPciInterrupt(const PciBusAddr &addr,
  PciIntPin pin) const override;
};

#endif // __DEV_RISCV_PCI_HOST_HH__

3) Add the "Source('pci_host.cc')" to gem5/src/dev/riscv/SConscript

4) Add the following code in gem5/src/dev/riscv/HiFive.py according to
RealView GenericArmPciHost:

from m5.objects.Ethernet import NSGigE, IGbE_igb, IGbE_e1000

from m5.objects.Device import BasicPioDevice
from m5.objects.PciHost import *
from m5.SimObject import SimObject

class GenericRiscvPciHost(GenericPciHost): #Add this class (PCI)
 type = 'GenericRiscvPciHost'
 cxx_header = "dev/riscv/pci_host.hh"
 int_base   = Param.Unsigned("PCI interrupt base")
 int_count  = Param.Unsigned("Maximum number of interrupts used by
this host")

 # This python parameter can be used in configuration scripts to turn
 # on/off the fdt dma-coherent flag when doing dtb autogeneration
 _dma_coherent = True

 def generateDeviceTree(self, state):
 local_state = FdtState(
 addr_cells=3, size_cells=2,
 cpu_cells=1, interrupt_cells=1)

 node = FdtNode("pci")

 if int(self.conf_device_bits) == 8:
 node.appendCompatible("pci-host-cam-generic")
 elif int(self.conf_device_bits) == 12:
 node.appendCompatible("pci-host-ecam-generic")
 else:
 m5.fatal("No compatibility string for the set
conf_device_width")

 node.append(FdtPropertyStrings("device_type", ["pci"]))

 # Cell sizes of child nodes/peripherals
 node.append(local_state.addrCellsProperty())
 node.append(local_state.sizeCellsProperty())
 node.append(local_state.interruptCellsProperty())
 # PCI address for CPU
 node.append(FdtPropertyWords("reg",
 state.addrCells(self.conf_base) +
 state.sizeCells(self.conf_size) ))

 # Ranges mapping
 # For now some of this is hard coded, because the PCI module does
not
 # have a proper full understanding of the memory map, but
adapting the
 # PCI module is beyond the scope of what I'm trying to do here.
 # Values are taken from the VExpress_GEM5_V1 platform.
 ranges = []
 # Pio address range
 ranges += self.pciFdtAddr(space=1, addr=0)
 ranges += state.addrCells(self.pci_pio_base)
 ranges += local_state.sizeCells(0x1)  # Fixed size

 # AXI memory address range
 ranges += self.pciFdtAddr(space=2, addr=0)
 ranges += state.addrCells(self.pci_mem_base)
 ranges += local_state.sizeCells(0x4000) # Fixed size
 node.append(FdtPropertyWords("ranges", ranges))

 if True:
   #Change this to True because Realview calls always
ARM_PCI_INT_DEV
 plic = self._parent.unproxy(self).plic
 int_phandle = state.phandle(plic)
 # Interrupt mapping
 interrupts = []

 # child interrupt specifier
 child_interrupt = local_state.interruptCells(0x0)

 # parent unit address
 parent_addr = 0x0
   #get this from /gem5/system/arm/dt/platforms file

 for i in range(int(self.int_count)):
 parent_interrupt = int(self.int_base) + i
   #RISCV uses only 1 interrupt_cell in plic

 interrupts += self.pciFdtAddr(device=i, addr=0) + \
  

[gem5-users] Re: riscv-ubuntu 20.04 FS mode

2022-03-14 Thread Νικόλαος Ταμπουρατζής via gem5-users

Dear all, Bobby and Hoa,

I add this command (self.workload.command_line += '  
init=/root/gem5_init.sh') in 169 line of  
gem5/src/python/gem5/components/boards/kernel_disk_workload.py and I  
build the gem5. Using this command, the gem5 is able to boot after 10  
minutes (without a large number of systemd services). However, when it  
boots and read the gem5_init.sh, I get the following:"cannot create  
/tmp/script: Read-only file system". And of course, nothing can be  
written in the filesystem. How can I resolve this?


Thank you in advance!!!

Best regards,
Nikos


Quoting Νικόλαος Ταμπουρατζής via gem5-users :


Dear Bobby and Hoa,

Thank you for your advice! It is working properly using the  
CustomDiskImageResource (including the following command: from  
gem5.resources.resource import Resource, CustomDiskImageResource).


Is there any news about booting faster of `riscv-ubuntu-20.04-img`?  
I am able to emulate the image using qemu  
(http://resources.gem5.org/resources/riscv-ubuntu), but I do not  
know what services I need to disable in order to boot faster the  
image!


Best regards,
Nikolaos Tampouratzis


Quoting Bobby Bruce via gem5-users :


Hey Nikos,

I'm not sure I know exactly how to remove all these annoying systemd
services. Currently Hoa is assigned this task:
https://gem5.atlassian.net/browse/GEM5-1177

@Hoa can you make this a top priority for you? I think 6+ hours for a boot
is a bit too much. I'm sure there must be a way to modify this disk image
to make it faster.

To answer your second question, this should work:

```

image = CustomDiskImageResource(
   local_path = "path/to/your/disk/image/here",
   disk_root_partition = "1", # This is the partition in the disk image to
use. 'None' if there is no disk image
)

board.set_kernel_disk_workload(
   kernel = Resource("riscv-bootloader-vmlinux-5.10"),
   disk_image = image,
)

```



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

web: https://www.bobbybruce.net


On Sat, Feb 12, 2022 at 7:19 AM Νικόλαος Ταμπουρατζής via gem5-users <
gem5-users@gem5.org> wrote:


Dear all,

I have successfully emulated the riscv-ubuntu.img through qemu! The
problem was that I use Ubuntu 20.04 and it requires the Hirsute’s
version of u-boot-qemu (wget

http://mirrors.kernel.org/ubuntu/pool/main/u/u-boot/u-boot-qemu_2021.01+dfsg-3ubuntu9_all.deb)
and not the standard through the apt
install.

Now I have two questions:

1) How can I disable the huge number of services in order to speedup
the gem5 boot process through qemu?

2) When I execute the following: "./build/RISCV/gem5.opt
configs/example/gem5_library/riscv-ubuntu-run.py", it downloads
automatically the riscv-ubuntu-20.04-img. How can I set another image?
The --disk-image option is not working.


Thank you in advance!!!
Best regards,
Nikos


Quoting Νικόλαος Ταμπουρατζής via gem5-users :


Dear Hoa,

Thank you very much for your information! I try to emulate the
ubuntu-image through qemu (following this tutorial:
http://resources.gem5.org/resources/riscv-ubuntu) and I get the
following TFTP error:

I appreciate any help!!

Best regards,
Nikos


cossim@cossim-virtual-machine:~/riscv-ubuntu$
./qemu/build/qemu-system-riscv64 -machine virt -nographic \

-m 16384 -smp 8 \
-bios /usr/lib/riscv64-linux-gnu/opensbi/generic/fw_jump.elf \
-kernel /usr/lib/u-boot/qemu-riscv64_smode/uboot.elf \
-device virtio-net-device,netdev=eth0 \
-netdev user,id=eth0,hostfwd=tcp::-:22 \
-drive file=ubuntu.img,format=raw,if=virtio


OpenSBI v0.9
   _  _
  / __ \  / |  _ \_   _|
 | |  | |_ __   ___ _ __ | (___ | |_) || |
 | |  | | '_ \ / _ \ '_ \ \___ \|  _ < | |
 | |__| | |_) |  __/ | | |) | |_) || |_
  \/| .__/ \___|_| |_|_/|/_|
| |
|_|

Platform Name : riscv-virtio,qemu
Platform Features : timer,mfdeleg
Platform HART Count   : 8
Firmware Base : 0x8000
Firmware Size : 156 KB
Runtime SBI Version   : 0.2

Domain0 Name  : root
Domain0 Boot HART : 5
Domain0 HARTs : 0*,1*,2*,3*,4*,5*,6*,7*
Domain0 Region00  : 0x8000-0x8003 ()
Domain0 Region01  : 0x-0x (R,W,X)
Domain0 Next Address  : 0x8020
Domain0 Next Arg1 : 0x8220
Domain0 Next Mode : S-mode
Domain0 SysReset  : yes

Boot HART ID  : 5
Boot HART Domain  : root
Boot HART ISA : rv64imafdcsu
Boot HART Features: scounteren,mcounteren,time
Boot HART PMP Count   : 16
Boot HART PMP Granularity : 4
Boot HART PMP Address Bits: 54
Boot HART MHPM Count  : 0
Boot HART MHPM Count  : 0
Boot HART MIDELEG : 0x0222
Boot HART MEDELEG : 0xb109


U-Boot 2021.01+dfsg-3ubuntu0~20.04.4 (Sep 21 2021 - 15:55:38 +)

CPU:   rv64imafdcsu
Model: riscv-virtio,

[gem5-users] Re: Modelling cache flushing on gem5 (RISC-V)

2022-03-14 Thread Ethan Bannister via gem5-users
Dear Eliot,

Sorry for the late reply.

As far as I can tell, fence.t is such an early proposal that its existence is 
purely in mailing list discussions and a research paper introducing it 
here. 
Despite being a fence, it's more of a "temporal state fence", so shared 
microarchitectural state is supposed to be flushed after it with the idea that 
prevents timing attacks across the fence.

As for x86 - I have seen the clflush implementation, but from what I can tell 
instructions like wbinvd are not implemented, and hence I was considering 
extending the protocol rather than issuing a large amount of line flushes.

Also - it seems RISC-V doesn't seem to have anything like x86's micro-op 
engine, but instead Load/Store templates which are provided with specific 
memory request flags. I was wondering if I could use this existing structure to 
implement a cache flush (like wbinvd), but am obviously unfamiliar with how 
everything is setup in gem5.

Thanks,

Ethan

From: Eliot Moss 
Sent: 28 February 2022 22:46
To: gem5 users mailing list 
Cc: Ethan Bannister 
Subject: Re: [gem5-users] Modelling cache flushing on gem5 (RISC-V)

On 2/28/2022 5:26 PM, Ethan Bannister via gem5-users wrote:
 > Hi all,
 >
 > I'm currently undertaking a research project where I am implementing 
 > fence.t, a proposed fence
 > instruction for RISC-V allowing ISA access to clearing microarchitectural 
 > state, and performing
 > relatively coarse assessments of performance impact. As a result, I'm trying 
 > to implement this
 > functionality in gem5.
 >
 > It would be greatly appreciated if someone more well-versed in gem5's memory 
 > model could double
 > check some of my implementation ideas below, so I don't get caught by any 
 > gotchas.
 >
 >  >From what I can tell, starting with the classic cache, the most sensible 
 > way to add this feature
 > is to extend the packet protocol to memory so it includes a new command, 
 > much like FlushReq, but
 > instead, for example, FullFlushReq. Then modify BaseCache::access to handle 
 > this new packet,
 > functionally handling the flush with BaseCache::memWriteback and then 
 > BaseCache::memInvalidate,
 > perhaps with some simulated latency added for the act of 'flushing' the 
 > cache. Since the instruction
 > would need to act like a memory fence (or at the very least, have no memory 
 > requests reordered past
 > it), the IsWriteBarrier and IsReadBarrier flags would be included in the ISA 
 > declaration of the
 > instruction.
 >
 > I may also need to extend Ruby to include a full cache flush instruction - 
 > I've seen other threads
 > on this list with respect to that, but if there are any recent changes or 
 > pertinent information then
 > it'd be greatly appreciated if you could let me know.
 >
 > Also - if there are any resources around on gem5's memory modelling that I 
 > might've missed, other
 > than those in the documentation, please let me know as more stuff to aid 
 > understanding is definitely
 > appreciated.

Dear Ethan - I was able to find fence.tso mentioned online, but not fence.t.

Anyway, from what I am familiar with in gem5 (and I added some custom cache
flushing behavior to an x86 model in the last 6 months), the cache hierarchy
itself is coherent.  Therefore fences need only to control the interaction
between the given cpu (hart in RIC-V terminology, I guess) and the L1 caches.
That functionality was already available in the x86 model, and since we're
talking about the micro-op engine, my guess is that it's there for RISC-V as
well.  A full fence wuold merely prevent issuing any ld/st ops until any ones
in progress are finished.  Again, AFAICT, it's cpu thing, not a cache thing.

Best wishes - 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