Skip to content

Commit 79ccc8e

Browse files
authored
AMD IGPU support (#14944)
1 parent 416717e commit 79ccc8e

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

install/ollama-install.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff 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
7171
fi
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
7279
ln -sf "$OLLAMA_INSTALL_DIR/bin/ollama" "$BINDIR/ollama"
7380
msg_ok "Installed Ollama"
7481

@@ -102,6 +109,10 @@ RestartSec=3
102109
[Install]
103110
WantedBy=multi-user.target
104111
EOF
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
105116
systemctl enable -q --now ollama
106117
msg_ok "Created Service"
107118

misc/build.func

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)