Add more descriptive info about driver version detection failure #267

This commit is contained in:
Georgiy Ignatov 2020-05-14 09:38:27 +03:00
parent aed35c3902
commit 6a30fa54df

View File

@ -183,9 +183,15 @@ patch_common () {
exit 1 exit 1
fi fi
if ! driver_version=$("$NVIDIA_SMI" --query-gpu=driver_version --format=csv,noheader,nounits | head -n 1) ; then cmd="$NVIDIA_SMI --query-gpu=driver_version --format=csv,noheader,nounits"
echo 'Something went wrong. Check nvidia driver' driver_versions_list=$($cmd)
exit 1 ret_code=$?
driver_version=$(echo "$driver_versions_list" | head -n 1)
if [ $ret_code -ne 0 ] && [ -nz driver_version ] ; then
echo "Can not detect nvidia driver version."
echo "CMD: \"$cmd\""
echo "Result: \"$driver_versions_list\""
echo "nvidia-smi retcode: $ret_code"
fi fi
echo "Detected nvidia driver version: $driver_version" echo "Detected nvidia driver version: $driver_version"