photoprism/scripts/dist/tensorflow-driver.sh
2022-03-23 08:16:01 +01:00

10 lines
No EOL
349 B
Bash
Executable file

#!/bin/bash
PATH="/usr/local/sbin/:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/scripts"
CPU_DETECTED=$(/usr/bin/lshw -c processor -json 2>/dev/null)
if [[ $(echo "${CPU_DETECTED}" | jq -r '.[].capabilities.avx2') == "true" ]]; then
echo "avx2"
elif [[ $(echo "${CPU_DETECTED}" | jq -r '.[].capabilities.avx') == "true" ]]; then
echo "avx"
fi