summaryrefslogtreecommitdiff
diff options
-rwxr-xr-xbin/nvidia_nvlink_check18
-rw-r--r--units/graphics/jobs.pxu13
2 files changed, 31 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
diff --git a/units/graphics/jobs.pxu b/units/graphics/jobs.pxu
index 89b5a00..56f4158 100644
--- a/units/graphics/jobs.pxu
+++ b/units/graphics/jobs.pxu
@@ -525,3 +525,16 @@ command:
{switch_to_cmd}
pm_test --silent --checkbox-respawn-cmd $PLAINBOX_SESSION_SHARE/__respawn_checkbox reboot --log-level=debug --log-dir=$PLAINBOX_SESSION_SHARE
flags: noreturn preserve-locale also-after-suspend
+
+plugin: shell
+category_id: com.canonical.plainbox::graphics
+id: graphics/nvlink-status-check
+requires:
+ dmi.product in ['Desktop','Low Profile Desktop','Tower','Mini Tower', 'Space-saving']
+ graphics_card.driver == 'nvidia'
+ package.name == 'nvidia-smi'
+command: nvidia_nvlink_check
+_summary: Check NVIDIA NVLINK status
+_description: Check NVLINK are supported and NVLINK are connected properly on system, please make sure below items before testing:
+ 1. More than one NVIDIA Graphic card are installed.
+ 2. Each graphic card are connected by NVLINK.