
Gem5-GPU Installation Guide for Advanced Computer Architecture
This comprehensive guide provides step-by-step instructions on setting up the Gem5-GPU environment on Ubuntu 14.04 LTS 64-bit platform. It covers essential packages installations, CUDA toolkit setup, gem5 and GPGPU-Sim cloning, and building the gem5-gpu code. By following these instructions, users can simulate CPUs, GPUs, and their interactions to support full-system simulation through GPU driver emulation.
Download Presentation

Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.
E N D
Presentation Transcript
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_pro d/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_C omputing_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_SD K/C/common make
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 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