summaryrefslogtreecommitdiff
path: root/bin
diff options
authorray.chen <ray.chen@canonical.com>2019-10-02 10:42:25 +0800
committerray.chen <ray.chen@canonical.com>2019-10-08 17:57:39 +0800
commita3d3f950fa9fad4641c4cdcc8cb9e9c9e0d2569b (patch)
treeff77357664df1b03a4d5154886f8fae6366b0996 /bin
parent26cc8a96b718ffde13d57965279f6869a3adf710 (diff)
graphics: add job and script for nvlink link status check
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