GPGPU-Sim Setup
Overview
The objective of this tool is for students to gain an understanding of how to use GPGPU-sim for analysis of microarchitectural characteristics.
Installation/Setup
The simplest way to install GPGPU-sim is to use the docker image provided on https://socal-ucr.github.io/GPGPU-sim-container.
Useful Docker Command
$ docker images # lists all locally available images
$ docker ps # list all up and running containers.
$ docker ps -a # list all exited, errored and running containers.
$ docker run IMAGE_NAME # Start a new container of IMAGE_NAME
$ docker start CONTAINER_ID # Command to start the container when exited accidentally.
$ docker attach CONTAINER_ID # Reattach to running (detached) container.
Compiling GPGPU-sim
- After you use
docker run -w /root -it socalucr/gpgpu-sim /bin/bashyou will be in the terminal session of the docker imageYou only need to use
docker runonce to create your container image. Subsequent calls would result in multiple GPGPU-Sim images on your system. - Run the following to compile GPGPU-sim
cd ~/gpgpu-sim_distribution
source setup_environment(You only need to do this once per terminal session)
make clean
make
How to run a program
- We will make a test directory in your home
mkdir ~/test - Go into the test directory.
cd ~/test - Copy configuration files to test directory:
cp -a ~/gpgpu-sim_distribution/configs/GTX480/* ~/test/ - Now run a binary. For example, we can run the CP binary in ISPASS2009.
~/ispass2009-benchmarks/bin/release/RAY 4 4
How to run your own program
- Let's make another directory for your lab 2 reduction:
mkdir ~/lab2 - Go into your lab 2 directory.
cd ~/lab2 - Move your reduction code to this directory. If you have modified code in Bender, then you can potentially push to Github and then clone the repo in the Docker container.
- You can compile your CUDA code as you do on Bender using
make - If you get the following error, you simply need to do
source ~/gpgpu-sim_distribution/setup_enviromentagain in the gpgpu-sim_distribution folder
root@f9cf5ab00628:~# nvcc
nvcc fatal : No input files specified; use option --help for more information - Once compiled, you run the program as detailed in the previous section