summaryrefslogtreecommitdiff
path: root/bin
diff options
authorPMR <pmr@pmr-lander>2019-10-18 08:25:25 +0000
committerPMR <pmr@pmr-lander>2019-10-18 08:25:25 +0000
commit0e58ff12af843b8290471536f302a004cfe47453 (patch)
treee8bcbbe7b4a045e3d4a26f3a711f1f7db6dfacba /bin
parent08f8a1bd8f59515e18b1a690cfb9d534fc14c36a (diff)
parenta3d3f950fa9fad4641c4cdcc8cb9e9c9e0d2569b (diff)
Merge #373544 from ~ray.chen/plainbox-provider-checkbox:add-nvlink-test
Diffstat (limited to 'bin')
-rwxr-xr-xbin/nvidia_nvlink_check18
1 files changed, 18 insertions, 0 deletions
diff --git a/bin/nvidia_nvlink_check b/bin/nvidia_nvlink_check
new file mode 100755
index 0000000..cb58079
--- /dev/null
+++ b/bin/nvidia_nvlink_check
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+set -e
+
+O=$(nvidia-smi nvlink -s)
+#Check NVLINK are avaliable first, if only 1 NVIDIA Graphic card, output will be empty.
+if [ -z "$O" ];then
+ echo "System does not support NVLINK or Only 1 NVIDIA graphic card installed";
+ exit 1
+#If any inactive in output that means NVLINK not connected porpery or malfunction, -n use for verify output
+elif echo "$O" | grep -q inactive; then
+ echo "NVLINK either the bridge is missing/defective or not configured correctly";
+ exit 1
+else
+ #"-e" use for new line character in string"
+ echo -e "NVLINK are Supported!\nStatus as below:\n\n""$O"
+ exit 0
+fi