From a3456637cddfc0f7ee2299bef9048aaa9e2df441 Mon Sep 17 00:00:00 2001 From: Michael Mayer Date: Sun, 6 Apr 2025 10:01:22 +0200 Subject: [PATCH] AI: Detect AMX-AVX512 instructions in install-tensorflow.sh #222 #4922 Signed-off-by: Michael Mayer --- scripts/dist/install-tensorflow.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/dist/install-tensorflow.sh b/scripts/dist/install-tensorflow.sh index a458cd121..126724bd9 100755 --- a/scripts/dist/install-tensorflow.sh +++ b/scripts/dist/install-tensorflow.sh @@ -66,9 +66,15 @@ if [[ $TF_DRIVER == "auto" ]]; then CPU_DETECTED=$(lshw -c processor -json 2>/dev/null) - if [[ $(echo "${CPU_DETECTED}" | jq -r '.[0].capabilities.avx_vnni') == "true" ]]; then + if [[ $(echo "${CPU_DETECTED}" | jq -r '.[0].capabilities.amx_tile') == "true" ]]; then + TF_DRIVER="avx512" + echo "✅ Your CPU supports AMX-AVX512 Advanced Matrix Extensions" + if [[ $(lshw -c display -json 2>/dev/null | jq -r '.[0].configuration.driver') == "nvidia" ]]; then + echo "✅ You can optionally install the tensorflow-gpu version as an Nvidia GPU was detected" + fi + elif [[ $(echo "${CPU_DETECTED}" | jq -r '.[0].capabilities.avx_vnni') == "true" ]]; then TF_DRIVER="vnni" - echo "✅ Your CPU supports AVX-VNNI vector neural network instructions" + echo "✅ Your CPU supports AVX-VNNI Vector Neural Network Instructions" if [[ $(lshw -c display -json 2>/dev/null | jq -r '.[0].configuration.driver') == "nvidia" ]]; then echo "✅ You can optionally install the tensorflow-gpu version as an Nvidia GPU was detected" fi