Merge pull request #356 from Snawoot/fix_353

Fix #353
This commit is contained in:
Snawoot 2021-01-02 03:50:00 +02:00 committed by GitHub
commit c5f08495b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 10 deletions

View File

@ -173,16 +173,15 @@ patch_common () {
echo "Using manually entered nvidia driver version: $driver_version"
else
cmd="$NVIDIA_SMI --query-gpu=driver_version --format=csv,noheader,nounits"
driver_versions_list=$($cmd)
ret_code=$?
driver_version=$(echo "$driver_versions_list" | head -n 1)
if [[ $ret_code -ne 0 ]] ; then
driver_versions_list=$($cmd) || (
ret_code=$?
echo "Can not detect nvidia driver version."
echo "CMD: \"$cmd\""
echo "Result: \"$driver_versions_list\""
echo "nvidia-smi retcode: $ret_code"
exit 1
fi
)
driver_version=$(echo "$driver_versions_list" | head -n 1)
echo "Detected nvidia driver version: $driver_version"
fi

View File

@ -246,16 +246,15 @@ patch_common () {
echo "Using manually entered nvidia driver version: $driver_version"
else
cmd="$NVIDIA_SMI --query-gpu=driver_version --format=csv,noheader,nounits"
driver_versions_list=$($cmd)
ret_code=$?
driver_version=$(echo "$driver_versions_list" | head -n 1)
if [[ $ret_code -ne 0 ]] ; then
driver_versions_list=$($cmd) || (
ret_code=$?
echo "Can not detect nvidia driver version."
echo "CMD: \"$cmd\""
echo "Result: \"$driver_versions_list\""
echo "nvidia-smi retcode: $ret_code"
exit 1
fi
)
driver_version=$(echo "$driver_versions_list" | head -n 1)
echo "Detected nvidia driver version: $driver_version"
fi