summaryrefslogtreecommitdiff
path: root/setup_environment
diff options
context:
space:
mode:
authorTor Aamodt <[email protected]>2020-07-15 14:42:42 -0700
committerTor Aamodt <[email protected]>2020-07-15 14:42:42 -0700
commit5e8e84976b63186ce4682e3dbb1bea84542558a9 (patch)
tree2610cd196eba67032ff664c3bae192eb0b434d79 /setup_environment
parent089446c9898b050f36e854eebff5dbd33332dce8 (diff)
parent53e63b9b5684388ad102848275efe524d68aab01 (diff)
Merge branch 'dev'
Diffstat (limited to 'setup_environment')
-rw-r--r--setup_environment42
1 files changed, 37 insertions, 5 deletions
diff --git a/setup_environment b/setup_environment
index f1a63f2..07d0788 100644
--- a/setup_environment
+++ b/setup_environment
@@ -1,12 +1,17 @@
# see README before running this
-ps -p $$ | awk '/bash/ || / sh/ || /zsh/ {exit 1;}' && echo "ERROR ** source setup_environment must be run in a bash, zsh or sh shell; see README" && exit
+ps -p $$ | awk '/bash/ || / sh/ || /zsh/ {exit 1;}' && echo "WARNING ** source setup_environment must be run in a bash, zsh or sh shell; see README"
export GPGPUSIM_SETUP_ENVIRONMENT_WAS_RUN=
export GPGPUSIM_ROOT="$( cd "$( dirname "$BASH_SOURCE" )" && pwd )"
GPGPUSIM_VERSION_STRING=`cat $GPGPUSIM_ROOT/version | awk '/Version/ {print $8}'`
-GPGPUSIM_BUILD_STRING=`cat $GPGPUSIM_ROOT/version | awk '/Change/ {print $6}'`
+#Detect Git branch and commit #
+GIT_COMMIT=`git --git-dir=$GPGPUSIM_ROOT/.git log -n 1 | head -1 | sed -re 's/commit (.*)/\1/'`
+GIT_FILES_CHANGED=`git --git-dir=$GPGPUSIM_ROOT/.git diff --numstat | wc | sed -re 's/^\s+([0-9]+).*/\1./'`
+GIT_FILES_CHANGED+=`git --git-dir=$GPGPUSIM_ROOT/.git diff --numstat --cached | wc | sed -re 's/^\s+([0-9]+).*/\1/'`
+GPGPUSIM_BUILD_STRING="gpgpu-sim_git-commit-$GIT_COMMIT-modified_$GIT_FILES_CHANGED"
+
echo -n "GPGPU-Sim version $GPGPUSIM_VERSION_STRING (build $GPGPUSIM_BUILD_STRING) ";
if [ ! -n "$CUDA_INSTALL_PATH" ]; then
@@ -42,12 +47,20 @@ fi
CC_VERSION=`gcc --version | head -1 | awk '{for(i=1;i<=NF;i++){ if(match($i,/^[0-9]\.[0-9]\.[0-9]$/)) {print $i; exit 0}}}'`
CUDA_VERSION_STRING=`$CUDA_INSTALL_PATH/bin/nvcc --version | awk '/release/ {print $5;}' | sed 's/,//'`;
-CUDA_VERSION_NUMBER=`echo $CUDA_VERSION_STRING | sed 's/\./ /' | awk '{printf("%02u%02u", 10*int($1), 10*$2);}'`
-if [ $CUDA_VERSION_NUMBER -gt 4020 -o $CUDA_VERSION_NUMBER -lt 2030 ]; then
+export CUDA_VERSION_NUMBER=`echo $CUDA_VERSION_STRING | sed 's/\./ /' | awk '{printf("%02u%02u", 10*int($1), 10*$2);}'`
+if [ $CUDA_VERSION_NUMBER -gt 11100 -o $CUDA_VERSION_NUMBER -lt 2030 ]; then
echo "ERROR ** GPGPU-Sim version $GPGPUSIM_VERSION_STRING not tested with CUDA version $CUDA_VERSION_STRING (please see README)";
- return;
+ echo $CUDA_VERSION_NUMBER
+ return
+fi
+
+if [ $CUDA_VERSION_NUMBER -ge 6000 ]; then
+ export PTX_SIM_USE_PTX_FILE=1.ptx
+ export PTX_SIM_KERNELFILE=_1.ptx
+ export CUOBJDUMP_SIM_FILE=jj
fi
+
if [ $# = '1' ] ;
then
export GPGPUSIM_CONFIG=gcc-$CC_VERSION/cuda-$CUDA_VERSION_NUMBER/$1
@@ -127,6 +140,25 @@ else
echo "configured without a power model.";
fi
+if [ -z "$PTXAS_CUDA_INSTALL_PATH" ]; then
+ export PTXAS_CUDA_INSTALL_PATH=$CUDA_INSTALL_PATH;
+fi
+echo "";
+echo "----------------------------------------------------------------------------";
+echo "INFO - If you only care about PTX execution, ignore this message. GPGPU-Sim supports PTX execution in modern CUDA."
+echo "If you want to run PTXPLUS (sm_1x SASS) with a modern card configuration - set the envronment variable"
+echo "\$PTXAS_CUDA_INSTALL_PATH to point a CUDA version compabible with your card configurations (i.e. 8+ for PASCAL, 9+ for VOLTA etc..)"
+echo "For example: \"export \$PTXAS_CUDA_INSTALL_PATH=/usr/local/cuda-9.1\""
+echo ""
+echo "The following text describes why:";
+echo "If you are using PTXPLUS, only sm_1x is supported and it requires that the app and simulator binaries are compiled in CUDA 4.2 or less.";
+echo "The simulator requires it since CUDA headers desribe struct sizes in the exec which change from gen to gen.";
+echo "The apps require 4.2 because new versions of CUDA tools have dropped parsing support for generating sm_1x";
+echo "When running using modern config (i.e. volta) and PTXPLUS with CUDA 4.2, the \$PTXAS_CUDA_INSTALL_PATH env variable is required to get proper register usage"
+echo "(and hence occupancy) using a version of CUDA that knows the register usage on the real card."
+echo "";
+echo "----------------------------------------------------------------------------";
+
echo "setup_environment succeeded";
export GPGPUSIM_SETUP_ENVIRONMENT_WAS_RUN=1