Update patch.sh

This commit is contained in:
DTJW92 2024-12-14 03:57:28 +00:00 committed by GitHub
parent 5db577ccef
commit d9e713648a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -285,16 +285,18 @@ get_supported_versions () {
} }
patch_common () { patch_common () {
if [[ "$manual_driver_version" ]]; then
driver_version="$manual_driver_version"
echo "Using manually entered Nvidia driver version: $driver_version"
else
NVIDIA_SMI="$(command -v nvidia-smi || true)" NVIDIA_SMI="$(command -v nvidia-smi || true)"
if [[ ! "$NVIDIA_SMI" ]] ; then if [[ ! "$NVIDIA_SMI" ]] ; then
echo 'nvidia-smi utility not found. Probably driver is not installed.' echo 'nvidia-smi utility not found. Probably driver is not installed.'
exit 1 exit 1
fi
if [[ "$manual_driver_version" ]]; then
driver_version="$manual_driver_version"
echo "Using manually entered nvidia driver version: $driver_version"
else else
cmd="$NVIDIA_SMI --query-gpu=driver_version --format=csv,noheader,nounits" cmd="$NVIDIA_SMI --query-gpu=driver_version --format=csv,noheader,nounits"
driver_versions_list=$($cmd) || ( driver_versions_list=$($cmd) || (
@ -308,7 +310,8 @@ patch_common () {
driver_version=$(echo "$driver_versions_list" | head -n 1) driver_version=$(echo "$driver_versions_list" | head -n 1)
echo "Detected nvidia driver version: $driver_version" echo "Detected nvidia driver version: $driver_version"
fi
fi
if ! check_version_supported "$driver_version" ; then if ! check_version_supported "$driver_version" ; then
echo "Patch for this ($driver_version) nvidia driver not found." echo "Patch for this ($driver_version) nvidia driver not found."