From b84115f777cca887023a3e2014c939b0bd0ad2cb Mon Sep 17 00:00:00 2001 From: Michael Yang Date: Tue, 21 Nov 2023 17:07:41 -0800 Subject: [PATCH] check nvidia-smi before anything else --- scripts/install.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/install.sh b/scripts/install.sh index f3186390..cf259e86 100644 --- a/scripts/install.sh +++ b/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."