[PR #12871] [MERGED] bring back sysfs based VRAM information for AMD #13989

Closed
opened 2026-04-13 00:42:01 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/12871
Author: @dhiltgen
Created: 10/30/2025
Status: Merged
Merged: 11/17/2025
Merged by: @dhiltgen

Base: mainHead: amd_linux


📝 Commits (2)

  • f192336 build: optimize dockerfile context for iterating
  • 315fc8f amd: implement linux sysfs based VRAM lookup

📊 Changes

5 files changed (+186 additions, -22 deletions)

View changed files

📝 Dockerfile (+12 -2)
📝 llama/patches/0024-GPU-discovery-enhancements.patch (+91 -14)
📝 ml/backend/ggml/ggml/src/ggml-cuda/ggml-cuda.cu (+1 -1)
📝 ml/backend/ggml/ggml/src/ggml-vulkan/ggml-vulkan.cpp (+1 -1)
📝 ml/backend/ggml/ggml/src/mem_hip.cpp (+81 -4)

📄 Description

Users are reporting invalid VRAM data on linux which may originate from the switch to relying on ROCm APIs. This brings back the old sysfs DRM based VRAM detection approach, implemented in the VRAM lookup patch.

While developing this, I noticed our Dockerfile build was causing a re-install of CUDA every time I touched the native backend file, so I've switched the ordering around to speed up incremental builds.

Related to #12564 for the Linux users


🔄 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/12871 **Author:** [@dhiltgen](https://github.com/dhiltgen) **Created:** 10/30/2025 **Status:** ✅ Merged **Merged:** 11/17/2025 **Merged by:** [@dhiltgen](https://github.com/dhiltgen) **Base:** `main` ← **Head:** `amd_linux` --- ### 📝 Commits (2) - [`f192336`](https://github.com/ollama/ollama/commit/f192336e27b8c429545e22ab49c2cd9e9104a19a) build: optimize dockerfile context for iterating - [`315fc8f`](https://github.com/ollama/ollama/commit/315fc8f5285e27a9e6edaef367ebfef3ae7b3512) amd: implement linux sysfs based VRAM lookup ### 📊 Changes **5 files changed** (+186 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `Dockerfile` (+12 -2) 📝 `llama/patches/0024-GPU-discovery-enhancements.patch` (+91 -14) 📝 `ml/backend/ggml/ggml/src/ggml-cuda/ggml-cuda.cu` (+1 -1) 📝 `ml/backend/ggml/ggml/src/ggml-vulkan/ggml-vulkan.cpp` (+1 -1) 📝 `ml/backend/ggml/ggml/src/mem_hip.cpp` (+81 -4) </details> ### 📄 Description Users are reporting invalid VRAM data on linux which may originate from the switch to relying on ROCm APIs. This brings back the old sysfs DRM based VRAM detection approach, implemented in the VRAM lookup patch. While developing this, I noticed our Dockerfile build was causing a re-install of CUDA every time I touched the native backend file, so I've switched the ordering around to speed up incremental builds. Related to #12564 for the Linux users --- <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-13 00:42:01 -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#13989