This is a fork of the official gem5 repo that implements the GPU architecture for PWS.
The instructions for setting up the docker container for running the GPU model are found here. This document assumes you already have docker installed on your machine. If using Windows, WSL2 and Docker tend to consume all available resources, so it may be worthwhile to limit the resources available to WSL2.
If it is the first time running the container, you need to first pull the image and create the container:
docker pull gcr.io/gem5-test/gcn-gpu:v21-2
docker run -it gcr.io/gem5-test/gcn-gpu:v21-2
The docker run
command will attach the user to the container instance.
To exit the container, enter the command exit
.
If you have already created the container instance, there is no need to create another with docker run
; instead, you can use docker start
:
- Find the container name using
docker container ls -a
. You can use either the value in theCONTAINER ID
or theNAMES
field. docker container start -ia <container_name>
.
To exit the container, enter the command exit
.
The guide to building gem5 is found here. The basic command to build the AMD APU system is:
scons -j8 build/GCN3_X86/gem5.opt --ignore-style
Where we assume the host machine can support 8 parallel threads of build execution.
Use command nproc
to see the number of available processors and for a good estimate of the number of threads to supply to the -j
flag.
The gem5 GPU model documentation gives the square benchmark as a good starting point. From there, we can deduce that the general command to run the simulator is:
build/GCN3_X86/gem5.opt configs/example/apu_se.py -n 3 -c <benchmark_path> [-o "<options>"]
To run example applications on the simulator, we recommend the HIP examples found here.