Minor fixes in .jenkins/caffe2/bench.sh
authorJunjie Bai <bai@in.tum.de>
Mon, 17 Dec 2018 21:45:26 +0000 (13:45 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Mon, 17 Dec 2018 21:53:55 +0000 (13:53 -0800)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/15304

Differential Revision: D13493876

Pulled By: bddppq

fbshipit-source-id: 7146eb2587e526af65b4b0290c25bd55653a3088

.jenkins/caffe2/bench.sh [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 2f8caad..f4f5f2a
@@ -2,10 +2,13 @@
 
 source "$(dirname "${BASH_SOURCE[0]}")/common.sh"
 
+# Anywhere except $ROOT_DIR should work
+cd "$INSTALL_PREFIX"
+
 if [[ $BUILD_ENVIRONMENT == *-cuda* ]]; then
     num_gpus=$(nvidia-smi -L | wc -l)
 elif [[ $BUILD_ENVIRONMENT == *-rocm* ]]; then
-    num_gpus=$(rocm-smi -i | grep 'GPU ID' | wc -l)
+    num_gpus=$(rocminfo | grep 'Device Type.*GPU' | wc -l)
 else
     num_gpus=0
 fi
@@ -17,4 +20,4 @@ else
     cmd="$cmd --num_gpus 1"
 fi
 
-"$cmd"
+eval "$cmd"