From 79ccc8ed6b63f400e15897ff7556e33e56027c6f Mon Sep 17 00:00:00 2001 From: Nick B Date: Fri, 5 Jun 2026 06:40:26 -0400 Subject: [PATCH] AMD IGPU support (#14944) --- install/ollama-install.sh | 11 +++++++++++ misc/build.func | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/install/ollama-install.sh b/install/ollama-install.sh index df8fc82cc..52f69856b 100644 --- a/install/ollama-install.sh +++ b/install/ollama-install.sh @@ -69,6 +69,13 @@ if ! fetch_and_deploy_gh_release "ollama-com" "ollama/ollama" "prebuild" "latest msg_error "Failed to download or deploy Ollama – check network connectivity and GitHub API availability" exit 250 fi +# If /dev/kfd exists assume an AMD GPU is installed, and install ROCM support for ollama +if [[ -e /dev/kfd ]]; then + if ! fetch_and_deploy_gh_release "ollama-rocm-com" "ollama/ollama" "prebuild" "latest" "$OLLAMA_INSTALL_DIR/lib" "ollama-linux-amd64-rocm.tar.zst"; then + msg_error "Failed to download or deploy Ollama AMD ROCM suport – check network connectivity and GitHub API availability" + exit 250 + fi +fi ln -sf "$OLLAMA_INSTALL_DIR/bin/ollama" "$BINDIR/ollama" msg_ok "Installed Ollama" @@ -102,6 +109,10 @@ RestartSec=3 [Install] WantedBy=multi-user.target EOF +if [[ -e /dev/kfd ]]; then + sed -i '/Environment=OLLAMA_INTEL_GPU=true/a Environment=OLLAMA_IGPU_ENABLE=1' \ + /etc/systemd/system/ollama.service +fi systemctl enable -q --now ollama msg_ok "Created Service" diff --git a/misc/build.func b/misc/build.func index 39e41ef89..78233a28f 100644 --- a/misc/build.func +++ b/misc/build.func @@ -3982,7 +3982,7 @@ $PCT_OPTIONS_STRING" if [[ -d /dev/dri ]]; then # Only add if not already claimed by Intel if [[ ${#INTEL_DEVICES[@]} -eq 0 ]]; then - for d in /dev/dri/renderD* /dev/dri/card*; do + for d in /dev/dri/renderD* /dev/dri/card* /dev/kfd; do [[ -e "$d" ]] && AMD_DEVICES+=("$d") done fi