-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup_environment_backup
59 lines (50 loc) · 2.28 KB
/
setup_environment_backup
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# see README before running this
# change the following to point to your installation of CUDA Toolkit
if [ ! -n "$CUDA_INSTALL_PATH" ]; then
export CUDA_INSTALL_PATH=$HOME/nvcuda/4.0/cuda
fi
# to run the debug build of GPGPU-Sim run:
# source setup_environment debug
if [ $# == '1' ] ;
then
export GPGPUSIM_CONFIG=$1
else
export GPGPUSIM_CONFIG=release
fi
export GPGPUSIM_ROOT="$( cd "$( dirname "$BASH_SOURCE" )" && pwd )"
export QTINC=/usr/include
# change NVOPENCL_LIBDIR to point to your opencl library directory, usually
# /usr/lib or /usr/lib64. Not setting this variable will cause gpgpu-sim to
# build without opencl support.
if [ -f /usr/lib64/libOpenCL.so ]; then
export NVOPENCL_LIBDIR=/usr/lib64;
# change NVOPENCL_INCDIR to point to your opencl include directory.
if [ -f /usr/include/CL/cl.h ]; then
export NVOPENCL_INCDIR=/usr/include/;
elif [ -f $CUDA_INSTALL_PATH/include/CL/cl.h ]; then
export NVOPENCL_INCDIR=$CUDA_INSTALL_PATH/include/;
fi
fi
# setting LD_LIBRARY_PATH as follows enables GPGPU-Sim to be invoked by
# native CUDA and OpenCL applications. GPGPU-Sim is dynamically linked
# against instead of the CUDA toolkit. This replaces this cumbersome
# static link setup in prior GPGPU-Sim releases.
export LD_LIBRARY_PATH=`echo $LD_LIBRARY_PATH | sed -re 's/.*gpgpu_sim.*(release|debug)://'`
export LD_LIBRARY_PATH=$GPGPUSIM_ROOT/lib/$GPGPUSIM_CONFIG:$LD_LIBRARY_PATH
export PATH=`echo $PATH | sed "s#$GPGPUSIM_ROOT/decuda/:$GPGPUSIM_ROOT/bin:$CUDA_INSTALL_PATH/bin:##"`
export PATH=$GPGPUSIM_ROOT/decuda/:$GPGPUSIM_ROOT/bin:$CUDA_INSTALL_PATH/bin:$PATH
# The following sets OPENCL_REMOTE_GPU_HOST which is used by GPGPU-Sim to
# SSH to remote node to generate PTX for OpenCL kernels when running on
# a node that does not have an NVIDIA driver installed.
# The remote node should have GPGPU-Sim installed at the same path
HOSTNAME_DOMAIN=`hostname -d`
if [ "x$HOSTNAME_DOMAIN" == "xece.ubc.ca" -a "$OPENCL_REMOTE_GPU_HOST" == "" ]; then
export OPENCL_REMOTE_GPU_HOST=aamodt-pc05.ece.ubc.ca
fi
HOSTNAME_F=`hostname -f`
if [ "x$HOSTNAME_F" == "x$OPENCL_REMOTE_GPU_HOST" ]; then
unset OPENCL_REMOTE_GPU_HOST
fi
# the following are required to use native SASS via decuda
export DECUDA_INSTALL_PATH=$GPGPUSIM_ROOT/decuda/
export D2PP_INSTALL_PATH=$GPGPUSIM_ROOT/decuda_to_ptxplus/