[PR #15325] feat(amd): add experimental override for unsupported GPUs #20385

Open
opened 2026-04-16 07:34:57 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/15325
Author: @sachithamh
Created: 4/4/2026
Status: 🔄 Open

Base: mainHead: amd-unsafe-experiment


📝 Commits (1)

  • ef9b158 feat(amd): add experimental override for unsupported GPUs

📊 Changes

4 files changed (+17 additions, -3 deletions)

View changed files

📝 CMakeLists.txt (+1 -1)
📝 docs/gpu.mdx (+5 -0)
📝 envconfig/config.go (+3 -0)
📝 ml/device.go (+8 -2)

📄 Description

Summary

This change introduces a small, opt-in path for experimenting with unsupported AMD GPUs while keeping the default behavior unchanged for regular users.

Changes

  • add OLLAMA_AMD_UNSAFE=1 to explicitly skip ROCm deep-init filtering for unsupported AMD devices
  • extend the default AMD HIP target list to include gfx90c and gfx1103
  • document the unsupported AMD workflow in docs/gpu.mdx

Why

On Renoir/Cezanne-class AMD iGPUs, stock ROCm discovery can crash during deep init and Ollama falls back to CPU-only execution. This patch keeps the default safe behavior, but gives advanced users and maintainers an explicit way to test unsupported AMD hardware.

Scope

  • default behavior remains unchanged
  • the override is opt-in only via OLLAMA_AMD_UNSAFE=1
  • intended as an experimental path for testing and debugging unsupported AMD GPUs

Local evidence gathered

On the test machine used for this patch:

  • stock ROCm discovery failed with failure during GPU discovery ... error="runner crashed"
  • a Vulkan-backed run with AMD override settings successfully used the GPU
  • ollama ps showed tinyllama:latest ... 100% GPU
  • runtime logs showed load_tensors: offloaded 23/23 layers to GPU

Notes for reviewers

  • This is best opened as a draft PR
  • I could verify runtime behavior on the target machine, but I could not perform a full local rebuild in this environment because go, cmake, and ninja were not installed

Example test settings

OLLAMA_AMD_UNSAFE=1 \
OLLAMA_VULKAN=1 \
HSA_OVERRIDE_GFX_VERSION=10.3.0 \
ollama serve

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/15325 **Author:** [@sachithamh](https://github.com/sachithamh) **Created:** 4/4/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `amd-unsafe-experiment` --- ### 📝 Commits (1) - [`ef9b158`](https://github.com/ollama/ollama/commit/ef9b1581bf9b397a81845da6df5e74fc376bd39a) feat(amd): add experimental override for unsupported GPUs ### 📊 Changes **4 files changed** (+17 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+1 -1) 📝 `docs/gpu.mdx` (+5 -0) 📝 `envconfig/config.go` (+3 -0) 📝 `ml/device.go` (+8 -2) </details> ### 📄 Description ## Summary This change introduces a small, opt-in path for experimenting with unsupported AMD GPUs while keeping the default behavior unchanged for regular users. ### Changes - add `OLLAMA_AMD_UNSAFE=1` to explicitly skip ROCm deep-init filtering for unsupported AMD devices - extend the default AMD HIP target list to include `gfx90c` and `gfx1103` - document the unsupported AMD workflow in `docs/gpu.mdx` ## Why On Renoir/Cezanne-class AMD iGPUs, stock ROCm discovery can crash during deep init and Ollama falls back to CPU-only execution. This patch keeps the default safe behavior, but gives advanced users and maintainers an explicit way to test unsupported AMD hardware. ## Scope - **default behavior remains unchanged** - the override is **opt-in only** via `OLLAMA_AMD_UNSAFE=1` - intended as an experimental path for testing and debugging unsupported AMD GPUs ## Local evidence gathered On the test machine used for this patch: - stock ROCm discovery failed with `failure during GPU discovery ... error="runner crashed"` - a Vulkan-backed run with AMD override settings successfully used the GPU - `ollama ps` showed `tinyllama:latest ... 100% GPU` - runtime logs showed `load_tensors: offloaded 23/23 layers to GPU` ## Notes for reviewers - This is best opened as a **draft PR** - I could verify runtime behavior on the target machine, but I could not perform a full local rebuild in this environment because `go`, `cmake`, and `ninja` were not installed ## Example test settings ```bash OLLAMA_AMD_UNSAFE=1 \ OLLAMA_VULKAN=1 \ HSA_OVERRIDE_GFX_VERSION=10.3.0 \ ollama serve ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-16 07:34:57 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#20385