Skip to content

Commit f45ac2b

Browse files
committed
hack: install.sh detects aibook (#5)
* Hack: install.sh detects aibook Signed-off-by: Xiaodong Ye <[email protected]> * Address review comments Signed-off-by: Xiaodong Ye <[email protected]> --------- Signed-off-by: Xiaodong Ye <[email protected]>
1 parent d19915f commit f45ac2b

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

scripts/install.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,12 @@ check_gpu() {
246246
amdgpu) available lshw && $SUDO lshw -c display -numeric -disable network | grep -q 'vendor: .* \[1002\]' || return 1 ;;
247247
mtgpu) available lshw && $SUDO lshw -c display -numeric -disable network | grep -q 'vendor: .* \[1ED5\]' || return 1 ;;
248248
esac ;;
249+
dmidecode)
250+
case $2 in
251+
mtgpu) available dmidecode && $SUDO dmidecode | grep -iE 'AB100|M1000' || return 1 ;;
252+
esac ;;
249253
nvidia-smi) available nvidia-smi || return 1 ;;
250-
mthreads-gmi) available mthreads-gmi || return 1 ;;
254+
mthreads-*) available $1 || return 1 ;;
251255
esac
252256
}
253257

@@ -256,12 +260,14 @@ if check_gpu nvidia-smi; then
256260
exit 0
257261
fi
258262

259-
if check_gpu mthreads-gmi; then
263+
if check_gpu mthreads-gmi || check_gpu mthreads-smi; then
260264
status "MTHREADS GPU installed."
261265
exit 0
262266
fi
263267

264-
if ! check_gpu lspci nvidia && ! check_gpu lshw nvidia && ! check_gpu lspci amdgpu && ! check_gpu lshw amdgpu && ! check_gpu lshw mtgpu; then
268+
if ! check_gpu lspci nvidia && ! check_gpu lshw nvidia && \
269+
! check_gpu lspci amdgpu && ! check_gpu lshw amdgpu && \
270+
! check_gpu lshw mtgpu && ! check_gpu dmidecode mtgpu; then
265271
install_success
266272
warning "No NVIDIA/AMD/MTHREADS GPU detected. Ollama will run in CPU-only mode."
267273
exit 0

0 commit comments

Comments
 (0)