CS5100 Advanced Computer Architecture Gem5-GPU Installation CS5100 Advanced Computer Architecture
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 emulation
Set up gem5-gpu environment Platform: Ubuntu 14.04LTS 64bit Recommended 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 30 sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.7 30 sudo update-alternatives --config gcc sudo update-alternatives --config g++
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/lib64
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 username
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 ..
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=True
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)
Set up gem5-gpu environment Compile ~/gem5-gpu$ cd benchmarcks/libcuda/ make If you encounter make error, please export CUDA path in page 4 again cd /home/<username>/NVIDIA_GPU_Computing_SDK/C/common
Example of Compiling benchmark Use 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-fusion
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 folder
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>”
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
Reference Getting Started Build Benchmarks 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