From 55de0ad144c9d8eb7ecf9b4fd366c99bf0df2775 Mon Sep 17 00:00:00 2001 From: John Doe Date: Wed, 4 Mar 2026 00:14:13 -0500 Subject: [PATCH] feat: improve backend detection summary in LocalAGI installation scripts --- ct/localagi.sh | 9 +++++---- install/localagi-install.sh | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/ct/localagi.sh b/ct/localagi.sh index 0505cea7b..24bbf3e3b 100644 --- a/ct/localagi.sh +++ b/ct/localagi.sh @@ -62,9 +62,8 @@ resolve_backend() { ;; esac - msg_info "Backend detection: requested=${requested}, var_gpu=${var_gpu:-no}, GPU_TYPE=${gpu_type}, nvidia=${has_nvidia}, kfd=${has_kfd}, amd_pci=${has_amd_pci}, amd_vendor=${has_amd_vendor}, selected=${backend}" - - echo "$backend" + RESOLVED_BACKEND="$backend" + BACKEND_DETECTION_SUMMARY="requested=${requested}, var_gpu=${var_gpu:-no}, GPU_TYPE=${gpu_type}, nvidia=${has_nvidia}, kfd=${has_kfd}, amd_pci=${has_amd_pci}, amd_vendor=${has_amd_vendor}, selected=${backend}" } # Update or append a key=value pair inside LocalAGI environment file. @@ -212,7 +211,9 @@ function update_script() { fi # Re-evaluate backend each update in case hardware/override changed. - BACKEND="$(resolve_backend)" + resolve_backend + BACKEND="${RESOLVED_BACKEND:-cpu}" + msg_info "Backend detection: ${BACKEND_DETECTION_SUMMARY:-unavailable}" if [[ ! -f /opt/localagi/.env ]]; then msg_warn "Missing /opt/localagi/.env. Recreate by running install script again." exit diff --git a/install/localagi-install.sh b/install/localagi-install.sh index ef9aba0b8..343d93063 100644 --- a/install/localagi-install.sh +++ b/install/localagi-install.sh @@ -59,9 +59,8 @@ resolve_backend() { ;; esac - msg_info "Backend detection: requested=${requested}, var_gpu=${var_gpu:-no}, GPU_TYPE=${gpu_type}, nvidia=${has_nvidia}, kfd=${has_kfd}, amd_pci=${has_amd_pci}, amd_vendor=${has_amd_vendor}, selected=${backend}" - - echo "$backend" + RESOLVED_BACKEND="$backend" + BACKEND_DETECTION_SUMMARY="requested=${requested}, var_gpu=${var_gpu:-no}, GPU_TYPE=${gpu_type}, nvidia=${has_nvidia}, kfd=${has_kfd}, amd_pci=${has_amd_pci}, amd_vendor=${has_amd_vendor}, selected=${backend}" } # Build LocalAGI from source using upstream workflow: @@ -214,7 +213,9 @@ CLEAN_INSTALL=1 fetch_and_deploy_gh_release "localagi" "mudler/LocalAGI" "tarbal msg_ok "Fetched LocalAGI Source" # Resolve backend and prepare persistent state directory. -BACKEND="$(resolve_backend)" +resolve_backend +BACKEND="${RESOLVED_BACKEND:-cpu}" +msg_info "Backend detection: ${BACKEND_DETECTION_SUMMARY:-unavailable}" mkdir -p /opt/localagi/pool # Only attempt ROCm runtime provisioning when AMD backend is selected.