File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -69,6 +69,13 @@ if ! fetch_and_deploy_gh_release "ollama-com" "ollama/ollama" "prebuild" "latest
6969 msg_error " Failed to download or deploy Ollama – check network connectivity and GitHub API availability"
7070 exit 250
7171fi
72+ # If /dev/kfd exists assume an AMD GPU is installed, and install ROCM support for ollama
73+ if [[ -e /dev/kfd ]]; then
74+ if ! fetch_and_deploy_gh_release " ollama-rocm-com" " ollama/ollama" " prebuild" " latest" " $OLLAMA_INSTALL_DIR /lib" " ollama-linux-amd64-rocm.tar.zst" ; then
75+ msg_error " Failed to download or deploy Ollama AMD ROCM suport – check network connectivity and GitHub API availability"
76+ exit 250
77+ fi
78+ fi
7279ln -sf " $OLLAMA_INSTALL_DIR /bin/ollama" " $BINDIR /ollama"
7380msg_ok " Installed Ollama"
7481
@@ -102,6 +109,10 @@ RestartSec=3
102109[Install]
103110WantedBy=multi-user.target
104111EOF
112+ if [[ -e /dev/kfd ]]; then
113+ sed -i ' /Environment=OLLAMA_INTEL_GPU=true/a Environment=OLLAMA_IGPU_ENABLE=1' \
114+ /etc/systemd/system/ollama.service
115+ fi
105116systemctl enable -q --now ollama
106117msg_ok " Created Service"
107118
Original file line number Diff line number Diff line change @@ -3982,7 +3982,7 @@ $PCT_OPTIONS_STRING"
39823982 if [[ -d /dev/dri ]]; then
39833983 # Only add if not already claimed by Intel
39843984 if [[ ${# INTEL_DEVICES[@]} -eq 0 ]]; then
3985- for d in /dev/dri/renderD* /dev/dri/card* ; do
3985+ for d in /dev/dri/renderD* /dev/dri/card* /dev/kfd ; do
39863986 [[ -e " $d " ]] && AMD_DEVICES+=(" $d " )
39873987 done
39883988 fi
You can’t perform that action at this time.
0 commit comments