[PR #12156] [MERGED] llm: Avoid underflow in free memory logging #13722

Closed
opened 2026-04-13 00:33:56 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/12156
Author: @jessegross
Created: 9/2/2025
Status: Merged
Merged: 9/2/2025
Merged by: @jessegross

Base: mainHead: jessegross/underflow


📝 Commits (1)

  • e45abe5 llm: Avoid underflow in free memory logging

📊 Changes

1 file changed (+5 additions, -1 deletions)

View changed files

📝 llm/server.go (+5 -1)

📄 Description

If a GPU's free memory is less than the reserved amount, we might get an underflow. Since it is an unsigned uint64, we print this as a large number rather than the more correct 0. This only affects logging, the actual layout code already handles this correctly.

Bug #12138


🔄 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/12156 **Author:** [@jessegross](https://github.com/jessegross) **Created:** 9/2/2025 **Status:** ✅ Merged **Merged:** 9/2/2025 **Merged by:** [@jessegross](https://github.com/jessegross) **Base:** `main` ← **Head:** `jessegross/underflow` --- ### 📝 Commits (1) - [`e45abe5`](https://github.com/ollama/ollama/commit/e45abe5411628a127facb40ab524e6290257ea74) llm: Avoid underflow in free memory logging ### 📊 Changes **1 file changed** (+5 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `llm/server.go` (+5 -1) </details> ### 📄 Description If a GPU's free memory is less than the reserved amount, we might get an underflow. Since it is an unsigned uint64, we print this as a large number rather than the more correct 0. This only affects logging, the actual layout code already handles this correctly. Bug #12138 --- <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:33:56 -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#13722