How does gem5-gpu mange shared memory between cpu and gpu?

137 views
Skip to first unread message

li...@umich.edu

unread,
Jun 5, 2015, 1:32:40 PM6/5/15
to gem5-g...@googlegroups.com
Hi, 

I am trying to use the default gem5-gpu configuration (w/o --split) to do se simulation. Which file contains the scheduler for the shared memory between cpu and gpu? 
And is there a way to know what's inside the shared memory / cache?

Thanks,
Sihang

Jason Power

unread,
Jun 5, 2015, 9:28:22 PM6/5/15
to li...@umich.edu, gem5-g...@googlegroups.com
Hi Sihang,

If you use --access-host-pagetable there is no "scheduler" that coordinates shared memory. The GPU can access the DRAM exactly the same way as the CPU, with loads and stores to virtual addresses. Without --access-host-pagetable, the GPU uses a separate virtual address, but accesses the same physical addresses.

If you want to investigate the data within the caches, you will need to look into the Ruby subsystem and Ruby caches of gem5. For the GPU shared memory (GPU scratchpad) you need to look into its implementation in GPGPU-Sim.

Let us know if you have more questions,

Jason

li...@umich.edu

unread,
Jun 6, 2015, 12:25:01 AM6/6/15
to gem5-g...@googlegroups.com, li...@umich.edu
Hi Jason,

I might clicked reply privately by mistake. Sorry about that.
If the memory shared by cpu and gpu is modified, how will the caches be affected? Do cpu and gpu follow the same protocol or there is a specific way to invalidate the caches?

Thanks,
Sihang

Jason Power

unread,
Jun 8, 2015, 10:23:20 AM6/8/15
to li...@umich.edu, gem5-g...@googlegroups.com
Hi Sihang,

You can specify the coherence protocol explicitly in gem5-gpu. There are several different protocols that are included in the source, and you can write your own as well.

Most of the included protocols are the same as the gem5 Ruby protocols and are homogeneous (i.e. the same for the CPU and GPU). However, VI_Hammer is a heterogeneous protocol where the GPU L1s are "incoherent" write-through and only the GPU L2 is coherent with the CPU caches.

There is no specific way to invalidate the caches in the current codebase.

Jason
Reply all
Reply to author
Forward
0 new messages