install_NEO_OCL_driver.sh: Added auto_mode option (#5864)

This commit is contained in:
Artyom Anokhov 2021-05-31 16:31:50 +03:00 committed by GitHub
parent 442bb4e23a
commit 315c8d4eec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 18 additions and 8 deletions

View File

@ -32,6 +32,7 @@ Download and installs the Intel® Graphics Compute Runtime for OpenCL™ Driver
Available options: Available options:
-y Replace the currently installed driver with the newer version. -y Replace the currently installed driver with the newer version.
-a, --auto Auto-mode for detecting best driver for current OS and hardware.
-d, --install_driver Manually select driver version to one of available to install drivers. -d, --install_driver Manually select driver version to one of available to install drivers.
Default value: $INSTALL_DRIVER_VERSION Default value: $INSTALL_DRIVER_VERSION
Available to install drivers: ${AVAILABLE_DRIVERS[*]} Available to install drivers: ${AVAILABLE_DRIVERS[*]}
@ -59,6 +60,10 @@ do
-y) -y)
agreement=true agreement=true
shift shift
;;
-a|--auto)
auto_mode=true
shift
;; ;;
--no_numa) --no_numa)
no_numa=true no_numa=true
@ -523,14 +528,19 @@ check_specific_generation()
if [[ ! -z "$specific_generation" && "$INSTALL_DRIVER_VERSION" != '20.35.17767' ]]; then if [[ ! -z "$specific_generation" && "$INSTALL_DRIVER_VERSION" != '20.35.17767' ]]; then
echo "$(basename "$0"): Detected 10th generation Intel® Core™ processor (formerly Ice Lake) or 11th generation Intel® Core™ processor (formerly Tiger Lake)." echo "$(basename "$0"): Detected 10th generation Intel® Core™ processor (formerly Ice Lake) or 11th generation Intel® Core™ processor (formerly Tiger Lake)."
echo "Driver version 20.35.17767 is going to be installed to fully utilize hardware features and performance." echo "Driver version 20.35.17767 is going to be installed to fully utilize hardware features and performance."
while true; do if [ "$auto_mode" == true ]; then
read -p "You are still able to use the older version 19.41.14441. Use the older driver? (y/n) [n] " yn INSTALL_DRIVER_VERSION='20.35.17767'
yn=${yn:=n} return 0
case $yn in else
[Yy]*) return 0 ;; while true; do
[Nn]*) INSTALL_DRIVER_VERSION='20.35.17767' && return 0 ;; read -p "You are still able to use the older version 19.41.14441. Use the older driver? (y/n) [n] " yn
esac yn=${yn:=n}
done case $yn in
[Yy]*) return 0 ;;
[Nn]*) INSTALL_DRIVER_VERSION='20.35.17767' && return 0 ;;
esac
done
fi
fi fi
} }