[PR #2465] [MERGED] Detect AMD GPU info via sysfs and block old cards #57594

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

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/2465
Author: @dhiltgen
Created: 2/12/2024
Status: Merged
Merged: 2/12/2024
Merged by: @dhiltgen

Base: mainHead: block_rocm_pre_9


📝 Commits (1)

  • 6d84f07 Detect AMD GPU info via sysfs and block old cards

📊 Changes

5 files changed (+151 additions, -34 deletions)

View changed files

gpu/amd.go (+91 -0)
📝 gpu/gpu.go (+53 -33)
📝 gpu/types.go (+6 -0)
📝 llm/generate/gen_linux.sh (+0 -1)
📝 llm/payload_common.go (+1 -0)

📄 Description

This wires up some new logic to start using sysfs to discover AMD GPU information and detects old cards we can't yet support so we can fallback to CPU mode.

This also serves as an initial foundation where I believe we'll be able to move away from the AMD management library and query the sysfs files to discover the details we need with less complexity.

This will mitigate some cases of #2165

Tested on a Radeon RX 580 and it correctly falls back to CPU.

time=2024-02-12T16:02:58.657Z level=INFO source=gpu.go:157 msg="AMD Driver: 6.2.4"
time=2024-02-12T16:02:58.657Z level=INFO source=gpu.go:162 msg="AMD GPU too old, falling back to CPU gfx803"
time=2024-02-12T16:02:58.657Z level=INFO source=cpu_common.go:11 msg="CPU has AVX2"

🔄 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/2465 **Author:** [@dhiltgen](https://github.com/dhiltgen) **Created:** 2/12/2024 **Status:** ✅ Merged **Merged:** 2/12/2024 **Merged by:** [@dhiltgen](https://github.com/dhiltgen) **Base:** `main` ← **Head:** `block_rocm_pre_9` --- ### 📝 Commits (1) - [`6d84f07`](https://github.com/ollama/ollama/commit/6d84f07505bdbd72696cbe249f2ae13fdb02a586) Detect AMD GPU info via sysfs and block old cards ### 📊 Changes **5 files changed** (+151 additions, -34 deletions) <details> <summary>View changed files</summary> ➕ `gpu/amd.go` (+91 -0) 📝 `gpu/gpu.go` (+53 -33) 📝 `gpu/types.go` (+6 -0) 📝 `llm/generate/gen_linux.sh` (+0 -1) 📝 `llm/payload_common.go` (+1 -0) </details> ### 📄 Description This wires up some new logic to start using sysfs to discover AMD GPU information and detects old cards we can't yet support so we can fallback to CPU mode. This also serves as an initial foundation where I believe we'll be able to move away from the AMD management library and query the sysfs files to discover the details we need with less complexity. This will mitigate some cases of #2165 Tested on a `Radeon RX 580` and it correctly falls back to CPU. ``` time=2024-02-12T16:02:58.657Z level=INFO source=gpu.go:157 msg="AMD Driver: 6.2.4" time=2024-02-12T16:02:58.657Z level=INFO source=gpu.go:162 msg="AMD GPU too old, falling back to CPU gfx803" time=2024-02-12T16:02:58.657Z level=INFO source=cpu_common.go:11 msg="CPU has AVX2" ``` --- <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:15:44 -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#57594