[PR #2885] [MERGED] Revamp ROCm support #57692

Closed
opened 2026-04-29 12:23:17 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/2885
Author: @dhiltgen
Created: 3/3/2024
Status: Merged
Merged: 3/7/2024
Merged by: @dhiltgen

Base: mainHead: rocm_v6_only


📝 Commits (1)

📊 Changes

27 files changed (+1091 additions, -588 deletions)

View changed files

📝 .github/workflows/test.yaml (+17 -7)
📝 Dockerfile (+12 -15)
📝 app/ollama.iss (+8 -0)
📝 docs/development.md (+2 -2)
📝 docs/linux.md (+8 -0)
📝 docs/troubleshooting.md (+37 -0)
📝 docs/windows.md (+2 -1)
gpu/amd.go (+0 -101)
gpu/amd_common.go (+58 -0)
gpu/amd_hip_windows.go (+141 -0)
gpu/amd_linux.go (+411 -0)
gpu/amd_windows.go (+190 -0)
gpu/assets.go (+60 -0)
📝 gpu/gpu.go (+5 -105)
📝 gpu/gpu_info.h (+0 -1)
📝 gpu/gpu_info_cuda.c (+5 -5)
gpu/gpu_info_rocm.c (+0 -198)
gpu/gpu_info_rocm.h (+0 -59)
📝 llm/dyn_ext_server.c (+8 -11)
📝 llm/dyn_ext_server.go (+3 -24)

...and 7 more files

📄 Description

This refines where we extract the LLM libraries to by adding a new OLLAMA_HOME env var, that defaults to ~/.ollama The logic was already idempotenent, so this should speed up startups after the first time a new release is deployed. It also cleans up after itself.

We now build only a single ROCm version (latest major) on both windows and linux. Given the large size of ROCms tensor files, we split the dependency out. It's bundled into the installer on windows, and a separate download on windows. The linux install script is now smart and detects the presence of AMD GPUs and looks to see if rocm v6 is already present, and if not, then downloads our dependency tar file.

For Linux discovery, we now use sysfs and check each GPU against what ROCm supports so we can degrade to CPU gracefully instead of having llama.cpp+rocm assert/crash on us. For Windows, we now use go's windows dynamic library loading logic to access the amdhip64.dll APIs to query the GPU information.

Fixes #2598
Fixes #738


🔄 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/2885 **Author:** [@dhiltgen](https://github.com/dhiltgen) **Created:** 3/3/2024 **Status:** ✅ Merged **Merged:** 3/7/2024 **Merged by:** [@dhiltgen](https://github.com/dhiltgen) **Base:** `main` ← **Head:** `rocm_v6_only` --- ### 📝 Commits (1) - [`6c5ccb1`](https://github.com/ollama/ollama/commit/6c5ccb11f993ccc88c4761b8c31e0fefcbc1900f) Revamp ROCm support ### 📊 Changes **27 files changed** (+1091 additions, -588 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/test.yaml` (+17 -7) 📝 `Dockerfile` (+12 -15) 📝 `app/ollama.iss` (+8 -0) 📝 `docs/development.md` (+2 -2) 📝 `docs/linux.md` (+8 -0) 📝 `docs/troubleshooting.md` (+37 -0) 📝 `docs/windows.md` (+2 -1) ➖ `gpu/amd.go` (+0 -101) ➕ `gpu/amd_common.go` (+58 -0) ➕ `gpu/amd_hip_windows.go` (+141 -0) ➕ `gpu/amd_linux.go` (+411 -0) ➕ `gpu/amd_windows.go` (+190 -0) ➕ `gpu/assets.go` (+60 -0) 📝 `gpu/gpu.go` (+5 -105) 📝 `gpu/gpu_info.h` (+0 -1) 📝 `gpu/gpu_info_cuda.c` (+5 -5) ➖ `gpu/gpu_info_rocm.c` (+0 -198) ➖ `gpu/gpu_info_rocm.h` (+0 -59) 📝 `llm/dyn_ext_server.c` (+8 -11) 📝 `llm/dyn_ext_server.go` (+3 -24) _...and 7 more files_ </details> ### 📄 Description This refines where we extract the LLM libraries to by adding a new OLLAMA_HOME env var, that defaults to `~/.ollama` The logic was already idempotenent, so this should speed up startups after the first time a new release is deployed. It also cleans up after itself. We now build only a single ROCm version (latest major) on both windows and linux. Given the large size of ROCms tensor files, we split the dependency out. It's bundled into the installer on windows, and a separate download on windows. The linux install script is now smart and detects the presence of AMD GPUs and looks to see if rocm v6 is already present, and if not, then downloads our dependency tar file. For Linux discovery, we now use sysfs and check each GPU against what ROCm supports so we can degrade to CPU gracefully instead of having llama.cpp+rocm assert/crash on us. For Windows, we now use go's windows dynamic library loading logic to access the amdhip64.dll APIs to query the GPU information. Fixes #2598 Fixes #738 --- <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-29 12:23:17 -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#57692