Browse Source

check nvidia-smi before anything else

Michael Yang 1 năm trước cách đây
mục cha
commit
b84115f777
1 tập tin đã thay đổi với 5 bổ sung5 xóa
  1. 5 5
      scripts/install.sh

+ 5 - 5
scripts/install.sh

@@ -125,11 +125,6 @@ if available systemctl; then
     configure_systemd
 fi
 
-if ! available lspci && ! available lshw; then
-    warning "Unable to detect NVIDIA GPU. Install lspci or lshw to automatically detect and install NVIDIA CUDA drivers."
-    exit
-fi
-
 check_gpu() {
     case $1 in
         lspci) available lspci && lspci -d '10de:' | grep -q 'NVIDIA' || return 1 ;;
@@ -143,6 +138,11 @@ if check_gpu nvidia-smi; then
     exit
 fi
 
+if ! available lspci && ! available lshw; then
+    warning "Unable to detect NVIDIA GPU. Install lspci or lshw to automatically detect and install NVIDIA CUDA drivers."
+    exit
+fi
+
 if ! check_gpu lspci && ! check_gpu lshw; then
     install_success
     warning "No NVIDIA GPU detected. Ollama will run with CPU."