Difference between revisions of "GPU621/DPS921 Student Resources"

From CDOT Wiki
Jump to: navigation, search
(TBB)
 
(19 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{GPU621/DPS921 Index | 20141}}
+
{{GPU621/DPS921 Index | 20177}}
  
 
The purpose of this page is to share useful information that can help groups with their projects.
 
The purpose of this page is to share useful information that can help groups with their projects.
Line 6: Line 6:
 
== Cilk Plus ==
 
== Cilk Plus ==
 
* [http://groups.csail.mit.edu/sct/wiki/index.php?title=Cilk_Plus_Installation_Guide MIT Installation Guide]
 
* [http://groups.csail.mit.edu/sct/wiki/index.php?title=Cilk_Plus_Installation_Guide MIT Installation Guide]
 +
* [https://www.cilkplus.org/build-gcc-cilkplus Cilk Plus Installation Guide]
 +
* Cilk Plus is installed on matrix.senecac.on.ca server and on the matrix partition of the workstations in T2108
 +
** /usr/local/gcc/gcc-cilk/bin/g++
 +
 +
====Tips for building from source (tested on Fedora 19)====
 +
Works but gets a "Segmentation fault (core dumped)" when testing out w1.cilk.cpp when cilk_for loops > 3 times.
 +
* download snapshot gcc-2427776 (2013-05-20) (current version on matrix as of 2014-01-17)
 +
* configure using:
 +
** /path/to/configure --prefix=/path/to/installation --enable-languages="c,c++" --disable-multilib
 +
 +
=== Configuration ===
 +
==== Linux ====
 +
* add to .bash_profile
 +
** alias gc++="/usr/local/gcc/gcc-cilk/bin/g++ -fcilkplus -ldl -lcilkrts"
 +
** export LD_LIBRARY_PATH=/path/to/cilkplus-installation/lib:$LD_LIBRARY_PATH
 +
** source /path/to/tbbvars.sh ia32 -ltbb
 +
 
== TBB ==
 
== TBB ==
 
* [https://www.threadingbuildingblocks.org/download TBB Download Page]
 
* [https://www.threadingbuildingblocks.org/download TBB Download Page]
Line 11: Line 28:
 
=== Configuration ===
 
=== Configuration ===
 
==== Linux ====
 
==== Linux ====
* add to LD_LIBRARY_PATH /usr/local/gcc/tbb41_20130613oss/lib/ia32/gcc4.1
+
* copy source script to your home directory
* needed for dynamic loaded libraries
+
** cp /usr/local/gcc/tbb/bin/tbbvars.sh
* use ldd <binary> to check
+
** change permissions chmod u+x tbbvars.sh
* -v option sends intermediate commands to cerr
+
* long hand notes
 +
** add to LD_LIBRARY_PATH /usr/local/gcc/tbb41_20130613oss/lib/ia32/gcc4.1
 +
** needed for dynamic loaded libraries
 +
** use ldd <binary> to check
 +
** -v option sends intermediate commands to cerr
  
 
== OpenMP ==
 
== OpenMP ==
 
* [http://openmp.org/wp/ OpenMP Home Page]
 
* [http://openmp.org/wp/ OpenMP Home Page]
*
+
* [https://www.youtube.com/watch?v=nE-xN4Bf8XI&list=SPLX-Q6B8xqZ8n8bwjGdzBJ25X2utwnoEG&index=1 Tim Mattson's Tutorial]
 +
=== Configuration ===
 +
==== Linux ====
 +
* add to gcc compile command -fopenmp
 +
 
 
== OpenCL ==
 
== OpenCL ==
 
* [http://www.khronos.org/opencl/ Khronos Group Home Page]
 
* [http://www.khronos.org/opencl/ Khronos Group Home Page]
Line 43: Line 68:
 
= Compilation Notes =
 
= Compilation Notes =
 
== Cilk Plus ==
 
== Cilk Plus ==
*
+
=== Linux ===
 +
* gc++ -o xxx xxx.cpp
 +
 
 
== TBB ==
 
== TBB ==
*
+
=== Linux ===
 +
* source tbbvars.sh ia32
 +
* gc++ -o xxx xxx.cpp -ltbb
 +
* long hand
 +
** gc++ -I /usr/local/gcc/tbb41_20130613oss/include/ -o xxx -L/usr/local/gcc/tbb41_20130613oss/lib/ia32/gcc4.1/ -ltbb xxx.cpp
 +
* poor error messages on lambda expressions
 +
 
 
== OpenCL ==
 
== OpenCL ==
 
* AMD
 
* AMD
Line 56: Line 89:
 
** Fermi cards - nvcc -code=sm_20 _arch=compute_20
 
** Fermi cards - nvcc -code=sm_20 _arch=compute_20
 
** nvcc opencl.cpp -lOpenCL
 
** nvcc opencl.cpp -lOpenCL
 
+
==OpenMP==
 +
===Visual Studio===
 +
Compiling OpenMP programs in visual studio 2012
 +
====enabling openmp====
 +
# Right-click on "Project Solution" under "Solution Explorer" and select "Properties"
 +
# On the properties pane, select "Configuration Properties" -> "C/C++" -> "Language"
 +
# On the details page, make sure "Open MP Support" is set to "Yes (/openmp)"
 +
====setting environemnt variables====
 +
# Right-click on "Project Solution" under "Solution Explorer" and select "Properties"
 +
# On the properties pane, select "Configuration Properties" -> "Debugging"
 +
# On the details page, make sure "Environment" has "OMP_NUM_THREADS=4;" in it
 
= Workshop Notes =
 
= Workshop Notes =
==BLAS Documentation==
+
==Platforms==
* [http://zenit.senecac.on.ca/wiki/index.php/GPU610/DPS915_BLAS_Documentation GPU610/DPS915_BLAS Documentation Page]
+
* executing an alias when creating a typescript
 +
** add . ~/.bash_profile inside the script before invoking the alias
 +
** [http://stackoverflow.com/questions/15968053/using-alias-in-shell-script using alias in a shell script]
  
= Assignment Notes =
+
==OpenMP==
==Shared Memory==
+
*
==Message Passing==
 

Latest revision as of 06:36, 13 September 2017


GPU621/DPS921 | Participants | Groups and Projects | Resources | Glossary

The purpose of this page is to share useful information that can help groups with their projects.

Installation Notes

Cilk Plus

Tips for building from source (tested on Fedora 19)

Works but gets a "Segmentation fault (core dumped)" when testing out w1.cilk.cpp when cilk_for loops > 3 times.

  • download snapshot gcc-2427776 (2013-05-20) (current version on matrix as of 2014-01-17)
  • configure using:
    • /path/to/configure --prefix=/path/to/installation --enable-languages="c,c++" --disable-multilib

Configuration

Linux

  • add to .bash_profile
    • alias gc++="/usr/local/gcc/gcc-cilk/bin/g++ -fcilkplus -ldl -lcilkrts"
    • export LD_LIBRARY_PATH=/path/to/cilkplus-installation/lib:$LD_LIBRARY_PATH
    • source /path/to/tbbvars.sh ia32 -ltbb

TBB

Configuration

Linux

  • copy source script to your home directory
    • cp /usr/local/gcc/tbb/bin/tbbvars.sh
    • change permissions chmod u+x tbbvars.sh
  • long hand notes
    • add to LD_LIBRARY_PATH /usr/local/gcc/tbb41_20130613oss/lib/ia32/gcc4.1
    • needed for dynamic loaded libraries
    • use ldd <binary> to check
    • -v option sends intermediate commands to cerr

OpenMP

Configuration

Linux

  • add to gcc compile command -fopenmp

OpenCL

CUDA

  • Visual Studio 2012 Ultimate | Select Software Downloads | Go To Visual Studio 2012 Ultimate 1.49GB | Download iso | Burn, if error burn again | Finally, install
  • CUDA Downloads
  • Installation add the following environment variables
    • CUDA_PATH - points to the default version
    • CUDA_PATH_INC
    • CUDA_PATH_LIB
  • Visual Studio IDE Settings for .cu files
    • Project -> Build Customizations -> Select CUDA 5.5
    • Source file -> Properites -> Item Type -> CUDA C/C++
    • Project -> Properties -> Configuration -> VC++ Directories -> $(CUDA_PATH_INC); $(CUDA_PATH_LIB);
    • Project -> Properties -> Configuration -> Linker -> Input -> cudart.lib

MPI

Compilation Notes

Cilk Plus

Linux

  • gc++ -o xxx xxx.cpp

TBB

Linux

  • source tbbvars.sh ia32
  • gc++ -o xxx xxx.cpp -ltbb
  • long hand
    • gc++ -I /usr/local/gcc/tbb41_20130613oss/include/ -o xxx -L/usr/local/gcc/tbb41_20130613oss/lib/ia32/gcc4.1/ -ltbb xxx.cpp
  • poor error messages on lambda expressions

OpenCL

  • AMD
    • cl opencl.cpp "%AMDAPPSDKROOT%"lib/x86/OpenCL.lib
    • Environmental Variables
      • INCLUDE add "C:\Program Files\AMD_APP_SDK\2.9\include";
      • LIB add "C:\Program Files\AMD APP SDK\2.9\lib\x86";

CUDA

  • compiling with nvcc
    • Fermi cards - nvcc -code=sm_20 _arch=compute_20
    • nvcc opencl.cpp -lOpenCL

OpenMP

Visual Studio

Compiling OpenMP programs in visual studio 2012

enabling openmp

  1. Right-click on "Project Solution" under "Solution Explorer" and select "Properties"
  2. On the properties pane, select "Configuration Properties" -> "C/C++" -> "Language"
  3. On the details page, make sure "Open MP Support" is set to "Yes (/openmp)"

setting environemnt variables

  1. Right-click on "Project Solution" under "Solution Explorer" and select "Properties"
  2. On the properties pane, select "Configuration Properties" -> "Debugging"
  3. On the details page, make sure "Environment" has "OMP_NUM_THREADS=4;" in it

Workshop Notes

Platforms

OpenMP