Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ollama
Commits
b7d316d9
"docs/vscode:/vscode.git/clone" did not exist on "4db08045baa250148b1e176e9ac1d5797affcd75"
Unverified
Commit
b7d316d9
authored
May 28, 2024
by
Jeffrey Morgan
Committed by
GitHub
May 28, 2024
Browse files
fix nvidia detection in install script (#4683)
parent
d7339fad
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
9 deletions
+14
-9
scripts/install.sh
scripts/install.sh
+14
-9
No files found.
scripts/install.sh
View file @
b7d316d9
...
@@ -153,6 +153,11 @@ check_gpu() {
...
@@ -153,6 +153,11 @@ check_gpu() {
esac
esac
}
}
if
check_gpu nvidia-smi
;
then
status
"NVIDIA GPU installed."
exit
0
fi
if
!
check_gpu lspci nvidia
&&
!
check_gpu lshw nvidia
&&
!
check_gpu lspci amdgpu
&&
!
check_gpu lshw amdgpu
;
then
if
!
check_gpu lspci nvidia
&&
!
check_gpu lshw nvidia
&&
!
check_gpu lspci amdgpu
&&
!
check_gpu lshw amdgpu
;
then
install_success
install_success
warning
"No NVIDIA/AMD GPU detected. Ollama will run in CPU-only mode."
warning
"No NVIDIA/AMD GPU detected. Ollama will run in CPU-only mode."
...
@@ -269,7 +274,7 @@ if ! check_gpu nvidia-smi || [ -z "$(nvidia-smi | grep -o "CUDA Version: [0-9]*\
...
@@ -269,7 +274,7 @@ if ! check_gpu nvidia-smi || [ -z "$(nvidia-smi | grep -o "CUDA Version: [0-9]*\
esac
esac
fi
fi
if
!
lsmod |
grep
-q
nvidia
;
then
if
!
lsmod |
grep
-q
nvidia
||
!
lsmod |
grep
-q
nvidia_uvm
;
then
KERNEL_RELEASE
=
"
$(
uname
-r
)
"
KERNEL_RELEASE
=
"
$(
uname
-r
)
"
case
$OS_NAME
in
case
$OS_NAME
in
rocky
)
$SUDO
$PACKAGE_MANAGER
-y
install
kernel-devel kernel-headers
;;
rocky
)
$SUDO
$PACKAGE_MANAGER
-y
install
kernel-devel kernel-headers
;;
...
@@ -283,10 +288,15 @@ if ! lsmod | grep -q nvidia; then
...
@@ -283,10 +288,15 @@ if ! lsmod | grep -q nvidia; then
if
[
-n
"
$NVIDIA_CUDA_VERSION
"
]
;
then
if
[
-n
"
$NVIDIA_CUDA_VERSION
"
]
;
then
$SUDO
dkms
install
$NVIDIA_CUDA_VERSION
$SUDO
dkms
install
$NVIDIA_CUDA_VERSION
fi
fi
fi
$SUDO
modprobe nvidia
if
lsmod |
grep
-q
nouveau
;
then
$SUDO
modprobe nvidia_uvm
status
'Reboot to complete NVIDIA CUDA driver install.'
exit
0
fi
$SUDO
modprobe nvidia
$SUDO
modprobe nvidia_uvm
fi
# make sure the NVIDIA modules are loaded on boot with nvidia-persistenced
# make sure the NVIDIA modules are loaded on boot with nvidia-persistenced
if
command
-v
nvidia-persistenced
>
/dev/null 2>&1
;
then
if
command
-v
nvidia-persistenced
>
/dev/null 2>&1
;
then
...
@@ -299,9 +309,4 @@ if command -v nvidia-persistenced > /dev/null 2>&1; then
...
@@ -299,9 +309,4 @@ if command -v nvidia-persistenced > /dev/null 2>&1; then
done
done
fi
fi
if
lsmod |
grep
-q
nouveau
;
then
status
'Reboot to complete NVIDIA CUDA driver install.'
exit
0
fi
status
"NVIDIA GPU ready."
status
"NVIDIA GPU ready."
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment