Unverified Commit 110ae89a authored by Michael Yang's avatar Michael Yang Committed by GitHub
Browse files

Merge pull request #596 from jmorganca/mxyng/install.sh

update install.sh
parents 5306b026 5e388f93
......@@ -82,6 +82,7 @@ Group=ollama
Restart=always
RestartSec=3
Environment="HOME=/usr/share/ollama"
Environment="PATH=$PATH"
[Install]
WantedBy=default.target
......@@ -92,7 +93,9 @@ EOF
status "Enabling and starting ollama service..."
$SUDO systemctl daemon-reload
$SUDO systemctl enable ollama
$SUDO systemctl restart ollama
start_service() { $SUDO systemctl restart ollama; }
trap start_service EXIT
;;
esac
}
......@@ -114,6 +117,11 @@ check_gpu() {
esac
}
if check_gpu nvidia-smi; then
status "NVIDIA GPU installed."
exit 0
fi
if ! check_gpu lspci && ! check_gpu lshw; then
warning "No NVIDIA GPU detected. Ollama will run in CPU-only mode."
exit 0
......@@ -225,3 +233,6 @@ if ! lsmod | grep -q nvidia; then
$SUDO modprobe nvidia
fi
status "NVIDIA GPU installed."
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment