Installation CS5100 Advanced Computer Architecture Introduction of Gem5GPU It merges 2 popular simulators gem5 and gpgpu sim Simulates CPUs GPUs and the interactions between ID: 624120
Download Presentation The PPT/PDF document "Gem5-GPU" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
Slide1
Gem5-GPU Installation
CS5100 Advanced
Computer ArchitectureSlide2
Introduction of
Gem5-GPU
It
merges
2 popular simulators: gem5 and
gpgpu
-sim
Simulates
CPUs, GPUs, and the interactions between
them
Models
a flexible memory system with support for heterogeneous processors and
coherence
Supports
full-system simulation through GPU driver emulationSlide3
Set up gem5-gpu environment
Platform:
Ubuntu 14.04LTS
64bit
R
ecommended
RAM size:
4G
Recommended Hard Disk size: 80G
Download path: https
://mega.co.nz/#!
wVdgFJQL!EPwc4Q9tTmrJtiBrWbtSSvv74ah8ljIB0iX1EvyMAPE
gcc
4.7
& g++
4.7 installation
sudo
add-apt-repository
ppa:ubuntu-toolchain-r
/test
sudo
apt-get
update
sudo
apt-get install
gcc-4.7
sudo
apt-get install g++-
4.7
sudo
update-alternatives --install /usr/bin/gcc gcc /
usr/bin/gcc-4.7
3
0
sudo
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-
4.7
3
0
sudo
update-alternatives --
config
gcc
sudo
update-alternatives --
config
g
++Slide4
Set up gem5-gpu environment
Install essential packages
sudo apt-get install zlib1g-dev bison mercurial scons libprotobuf-dev python-dev swig protobuf-compiler
Install CUDA toolkit 3.2
wget http://developer.download.nvidia.com/compute/cuda/3_2_prod/toolkit/cudatoolkit_3.2.16_linux_64_ubuntu10.04.run
chmod +x ./cudatoolkit_3.2.16_linux_64_ubuntu10.04.run
sudo ./cudatoolkit_3.2.16_linux_64_ubuntu10.04.run
export CUDAHOME=/usr/local/cuda
export PATH=$PATH:/usr/local/cuda/bin
export LD_LIBRARY_PATH=/usr/local/cuda/lib64Slide5
Set up gem5-gpu environment
edit .
hgrc
vim .
hgrc
type the following in the document
[extensions]
mq
=
[
ui
]
username = <your username> ←fill in your own usernameSlide6
Set up gem5-gpu environment
Clone gem5 and gem5-patches
mkdir
gem5-gpu
cd gem5-gpu
hg
qclone
http://repo.gem5.org/gem5 -p http://gem5-gpu.cs.wisc.edu/repo/gem5-patches
cd gem5/
hg update -r 11060
hg
qpush
-a
cd ..Slide7
Set up gem5-gpu environment
Clone GPGPU-Sim and GPGPU-Sim patches
hg
qclone
http://gem5-gpu.cs.wisc.edu/repo/gpgpu-sim -p http://gem5-gpu.cs.wisc.edu/repo/gpgpu-sim-patches
cd
gpgpu
-sim
hg
qpush
-a
cd
..
Clone gem5-gpu glue code
hg clone http://
gem5-gpu.cs.wisc.edu/repo/gem5-gpu
Build
cd gem5
scons
build/X86_VI_hammer_GPU/gem5.opt --default=X86 EXTRAS=../gem5-gpu/
src
:../
gpgpu
-sim/ PROTOCOL=
VI_hammer
GPGPU_SIM=TrueSlide8
Set up gem5-gpu environment
Obtain CUDA SDK
wget
http://developer.download.nvidia.com/compute/cuda/3_2_prod/sdk/gpucomputingsdk_3.2.16_linux.run
chmod
+x ./gpucomputingsdk_3.2.16_linux.run
sudo
./gpucomputingsdk_3.2.16_linux.run
export NVIDIA_CUDA_SDK_LOCATION=/home/<username>/
NVIDIA_GPU_Computing_SDK
/C
Obtain Benchmarks
~/gem5-gpu $
hg clone https://
gem5-gpu.cs.wisc.edu/repo/benchmarks/
Do
this
under
your
root
directory
(gem5-gpu/
in
this
example)Slide9
Set up gem5-gpu environment
Compile
~/gem5-gpu$ cd
benchmarcks
/
libcuda
/
m
ake
If
you
encounter
make
error,
please
export
CUDA
path
in
page
4
again
cd /home/<username>/
NVIDIA_GPU_Computing_SDK
/C/common
makeSlide10
Example of Compiling benchmark
U
se
gcc
4.4 & g++ 4.4 to compile benchmarks
sudo
apt-get install gcc-4.4
sudo
apt-get install g++-4.4
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.4 40
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.4 40
sudo
update-alternatives --
config
gcc
sudo
update-alternatives --
config
g
++
Example
of Compiling a Benchmark
~/
gem5-gpu/benchmarks
$ cd
rodinia
/
backprop
make
gem5-fusionSlide11
Example of running benchmark
Example of Running a Benchmark
cd gem5/
build/X86_VI_hammer_GPU/gem5.opt ../gem5-gpu/
configs
/
se_fusion.py
-c ../benchmarks/
rodinia
/
backprop
/gem5_fusion_backprop -o "16“
Or type the commend under if you have
problem
/home/pads/gem5-gpu/gem5/build/X86_VI_hammer_GPU/gem5.opt /home/pads/gem5-gpu/gem5-gpu/
configs
/
se_fusion.py
-c /home/pads/gem5-gpu/benchmarks/
rodinia
/
backprop
/gem5_fusion_backprop -o "
16”
Run
other
benchmarks
16
is
the
parameter
that
backprop
benchmark
needed,
different
benchmark
will
need
different
type
of
input
Find
the command argument at README or run file in the benchmark
folderSlide12
Example of running benchmark with
input
data
Download
input data
https://drive.google.com/file/d/0B-xa6WK_zXMHaXc3SWtDNkd3bUE/view?usp=sharing
Compile
image
compression
benchmark
dwt
~/gem5-gpu/benchmarks$ cd
rodinia
/dwt
make
gem5-fusion
Run
dwt
build/X86_VI_hammer_GPU/gem5.opt
../gem5-gpu/configs/se_fusion.py -c ../
benchmarks/
rodinia
/dwt/gem5_fusion_dwt
-o
“
--
dimension 192x192
<
your input data folder>
/dwt2d/192.bmp
<your
input
data folder
>
/data/dwt2d/out”
Parameters
in
command
correspond
to
“--dimension
<
size
>
<
Input_path
]>
<
Output_path
>
”Slide13
Possible error
When
you
run
benchmark
with
input
data
you
may
encounter
following
error
Please
go to gem5/build/X86_VI_hammer_GPU/mem/packet_queue.cc and modify limit of transmitList.size() in line 117, then rebuild gem5 Slide14
Reference
Getting
Started
https://
gem5-gpu.cs.wisc.edu/wiki/start
Build Benchmarks
https://
gem5-gpu.cs.wisc.edu/wiki/benchmarks
Simulator
version
information
http
://
goo.gl/S1ts6