diff options
-rwxr-xr-x | bin/nvidia_nvlink_check | 18 | ||||
-rw-r--r-- | units/graphics/jobs.pxu | 13 |
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 01ec380..d5344e3 100644 --- a/units/graphics/jobs.pxu +++ b/units/graphics/jobs.pxu @@ -539,3 +539,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. |