From a3d3f950fa9fad4641c4cdcc8cb9e9c9e0d2569b Mon Sep 17 00:00:00 2001 From: "ray.chen" Date: Wed, 2 Oct 2019 10:42:25 +0800 Subject: graphics: add job and script for nvlink link status check --- bin/nvidia_nvlink_check | 18 ++++++++++++++++++ units/graphics/jobs.pxu | 13 +++++++++++++ 2 files changed, 31 insertions(+) create mode 100755 bin/nvidia_nvlink_check diff --git a/bin/nvidia_nvlink_check b/bin/nvidia_nvlink_check new file mode 100755 index 00000000..cb58079a --- /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 01ec380c..d5344e30 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. -- cgit v1.2.3