Child pages
  • gpgpu-sim
Skip to end of metadata
Go to start of metadata

Table of Contents

Introduction

This page is for additional notes and discussion regarding GPGPU-Sim and AerialVision.

Installation GPGPU-Sim

  • get the software at the GPGPU-Sim Google Group
  • unpack it
  • read the manuals in gpgpu-sim_v2.1.1b/doc (remarkably good (smile) )
  • some highlights from the GPGPU-Sim Manual

    Software Dependencies

    GPGPU-Sim requires the following software modules:

    • An installation of CUDA which you need to download from NVIDIA's website.
    • To use OpenCL: An installation of NVIDIA OpenCL drivers from NVIDIA's OpenCL Page.
    • GNU Compiler Collection (i.e. gcc) 4.0 or newer
      o gcc 4.3 recommended for CUDA 2.x
      o gcc 4.1 recommended for CUDA 1.1
    • bison (version 2.3 recommended)
    • flex (version 2.5.33 recommended)
    • zlib
    • The benchmarks from the ISPASS 2009 paper (distributed separately) have additional dependencies.

    Step 4: Set environment variables (e.g., your .bashrc file if you use bash as your shell).

    • (a) Set GPGPUSIM_ROOT to point to the directory containing this README file. (i.e. the root dir of gpgpu-sim)
    • (b) Set CUDAHOME to point to your CUDA installation directory
    • (c) Set NVIDIA_CUDA_SDK_LOCATION to point to the location of the CUDA SDK
    • (d) Add $CUDAHOME/bin and $GPGPUSIM_ROOT/bin to your PATH
    • (e) Add $GPGPUSIM_ROOT/lib/ to your LD_LIBRARY_PATH and remove $CUDAHOME/lib or $CUDAHOME/lib64 from LD_LIBRARY_PATH
    • (f) If using OpenCL, set NVOPENCL_LIBDIR to the installation directory of libOpenCL.so distributed with the NVIDIA OpenCL driver. On SuSe 11.1 64-bit NVIDIA's libOpenCL.so is installed in /usr/lib64/.

    In the 2.1.1b release, we provide configuration files for modeling the following GPUs:

    • Quadro FX 5800
  • install CUDA, if you haven't already
  • compile cutil (run 'make' from CUDADIR/C/common), if you haven't already
  • set all the environment variables (see above, and manual)
  • run 'make' from the GPGPU-Sim directory
  • done (smile)

Installation AerialVision

  • First install GPGPU-Sim, as described above
  • according to the manual: run python installscript.py from the 'aerialvision' subdirectory

    note the requirements mentioned in installscript.py

    1. make sure you have the following installed before running this script
    2. (a) python-dev|python-devel
    3. (b) Tkinter
    4. (c) tcl-dev|tcl-devel
    5. (d) tk-dev|tk-devel
    • but, unfortunately links are broken (sad)
    • but, dependencies of build packages might be missing (sad)
  • alternative 1: install packages through e.g. Synaptic (requires root privileges)
  • alternative 2: fix installscript.py (wink)
    • TODO
  • as mentioned in manual, add GPGPUSIM_ROOT/bin to your PATH, in order to be able to start aerialvision.py from any directory

Running your program on GPGPU-Sim

  • As mentioned in the manual you can either statically link (i.e. at compile time) to GPGPU-Sim, or dynamically link (i.e. at run time) to GPGPU-Sim.
  • The samples in the 'benchmark' directory statically link to GPGPU-Sim (i think...should check that)
  • Easiest is to dynamically link to GPGPU-Sim, by removing the CUDA libs from your LD_LIBRARY_PATH, and adding the GPGPU-Sim libs instead.
  • Using something like the following scripts will allow you to switch between both with minimal effort (place these somewhere in your path, and call with '. gpgpusim_on' and '. gpgpusim_off' in order to affect current environment):
    ###########################################################################
    # GPGPUSIM_ON script to enable gpgpusim 
    # NOTE: call as '. gpgpusim_on' to let it affect current environment)
    #       probably there's a better way, but this is only way I know
    ###########################################################################
    
    ### remove gpgpusim and cuda from LD_LIBRARY_PATH [1]
    LD_LIBRARY_PATH=$(echo $LD_LIBRARY_PATH | sed -e 's;:\?/home/heeswijk/gpgpu-sim/gpgpu-sim_v2.1.1b/lib;;' -e 's;/home/heeswijk/gpgpu-sim/gpgpu-sim_v2.1.1b/lib:\?;;')
    LD_LIBRARY_PATH=$(echo $LD_LIBRARY_PATH | sed -e 's;:\?/home/heeswijk/cuda/lib;;' -e 's;/home/heeswijk/cuda/lib:\?;;')
    
    ### add gpgpusim to LD_LIBRARY_PATH
    export LD_LIBRARY_PATH=$HOME/gpgpu-sim/gpgpu-sim_v2.1.1b/lib:$LD_LIBRARY_PATH
    
    ### bibliography ;)
    # [1] http://www.linuxjournal.com/content/remove-path-your-path-variable-0
    
    ###########################################################################
    # GPGPUSIM_OFF script to disable gpgpusim 
    # NOTE: call as '. gpgpusim_off' to let it affect current environment)
    #       probably there's a better way, but this is only way I know
    ###########################################################################
    
    ### remove gpgpusim and cuda from LD_LIBRARY_PATH
    LD_LIBRARY_PATH=$(echo $LD_LIBRARY_PATH | sed -e 's;:\?/home/heeswijk/gpgpu-sim/gpgpu-sim_v2.1.1b/lib;;' -e 's;/home/heeswijk/gpgpu-sim/gpgpu-sim_v2.1.1b/lib:\?;;')
    LD_LIBRARY_PATH=$(echo $LD_LIBRARY_PATH | sed -e 's;:\?/home/heeswijk/cuda/lib;;' -e 's;/home/heeswijk/cuda/lib:\?;;')
    
    ### add cuda back to LD_LIBRARY_PATH
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/heeswijk/cuda/lib
    
    ### bibliography ;)
    # [1] http://www.linuxjournal.com/content/remove-path-your-path-variable-0
    
  • if you need the PTX, add '-keep' to the NVCC compiler flags. Adding '-keep -clean' cleans up the mess again. (see NVCC manual for details)
  • now, after replacing CUDA lib by GPGPU-Sim lib (i.e. by running above script), run you program and it will run on the simulator and generate files with all the statistics
  • start aerialvision.py, and load the result files as described in AerialVision manual
  • enjoy!

AerialVision GUI Tweak

On 'low-resolution' displays, like my laptop's 1280x800 display, the most important button 'GraphMe!' might not be visible. This can easily be fixed by tweaking the layout.

In GPGPUSIM_ROOT/aerialvision/guiclasses.py, change the following:

    #Frame that will have the textbox that lists everything the user has chosen to do
    ChosenVarsTitle = Tk.Label(chosenVars, text = 'Options Chosen', font = ("Gills Sans MT", 12), bg = "white")
    ChosenVarsTitle.pack(side = Tk.TOP)
    innerChosenVarsFrame = Tk.Frame(chosenVars, bg= 'white')
    innerChosenVarsFrame.pack(side = Tk.TOP, pady = 10)
    ChosenVarsTextboxScrollbar = Tk.Scrollbar(innerChosenVarsFrame, orient = Tk.VERTICAL)
    ChosenVarsTextboxScrollbar.pack(side = Tk.RIGHT, fill = 'y')
    self.ChosenVarsTextbox = Tk.Text(innerChosenVarsFrame, height = 41, width = 45, yscrollcommand = ChosenVarsTextboxScrollbar.set)
    self.ChosenVarsTextbox.pack()
    ChosenVarsTextboxScrollbar.config(command = self.ChosenVarsTextbox.yview)
    
    #Button for graphing  
    graphButton = Tk.Frame(chosenVars, bg = "white")
    graphButton.pack(side = Tk.RIGHT)
    bGraphButton = Tk.Button(graphButton,borderwidth = 5, bg = 'green', text = "GraphMe!",font = ("Gills Sans MT", 14), command = (lambda: self.setupPlotData()))
    bGraphButton.pack()

becomes (reverse order, and align button to TOP instead of RIGHT)

    #Button for graphing  
    graphButton = Tk.Frame(chosenVars, bg = "white")
    graphButton.pack(side = Tk.TOP)
    bGraphButton = Tk.Button(graphButton,borderwidth = 5, bg = 'green', text = "GraphMe!",font = ("Gills Sans MT", 14), command = (lambda: self.setupPlotData()))
    bGraphButton.pack()
        
    #Frame that will have the textbox that lists everything the user has chosen to do
    ChosenVarsTitle = Tk.Label(chosenVars, text = 'Options Chosen', font = ("Gills Sans MT", 12), bg = "white")
    ChosenVarsTitle.pack(side = Tk.TOP)
    innerChosenVarsFrame = Tk.Frame(chosenVars, bg= 'white')
    innerChosenVarsFrame.pack(side = Tk.TOP, pady = 10)
    ChosenVarsTextboxScrollbar = Tk.Scrollbar(innerChosenVarsFrame, orient = Tk.VERTICAL)
    ChosenVarsTextboxScrollbar.pack(side = Tk.RIGHT, fill = 'y')
    self.ChosenVarsTextbox = Tk.Text(innerChosenVarsFrame, height = 41, width = 45, yscrollcommand = ChosenVarsTextboxScrollbar.set)
    self.ChosenVarsTextbox.pack()
    ChosenVarsTextboxScrollbar.config(command = self.ChosenVarsTextbox.yview)    

AerialVision - Encountered Problems

This section is for gathering a list of bugs/problems (and possible solutions). Problems listed here could either be bugs or user error (wink)

  • File Input
    • Adding file using 'Recent Files' appends the filename in the edit field, rather than replacing it. This leads to unexpected errors when trying to add the file.
  • Visualizer
    • GraphMe! button is not visible in some resolutions
    • Double-clicking CFLOG does not seem to work
      Exception in Tkinter callback
      Traceback (most recent call last):
        File "/usr/lib/python2.6/lib-tk/Tkinter.py", line 1413, in __call__
          return self.func(*args)
        File "/home/heeswijk/gpgpu-sim/gpgpu-sim_v2.1.1b/aerialvision/guiclasses.py", line 291, in chooseDataY
          if self.data[self.fileChosen][self.dataChosenY].type == 1 or self.data[self.fileChosen][self.dataChosenY].type == 2 or self.data[self.fileChosen][self.dataChosenY].type == 4:
      AttributeError: 'dict' object has no attribute 'type'
      
    • Clicking -->? button does not do anything
      Exception in Tkinter callback
      Traceback (most recent call last):
        File "/usr/lib/python2.6/lib-tk/Tkinter.py", line 1413, in __call__
          return self.func(*args)
        File "/home/heeswijk/gpgpu-sim/gpgpu-sim_v2.1.1b/aerialvision/guiclasses.py", line 185, in <lambda>
          bQTypeGraphHelp = Tk.Button(typeGraph, text = " ? -->", command = (lambda: helpMSG(3)))
      NameError: global name 'helpMSG' is not defined
      
  • Source Code View
  • No labels