ram is always null in /api/resources ("My Machine" panel) whenever a GPU is present
维护者通常 1 天内回复
评估
调研方向
从pkg/xsysinfo/gpu.go开始,检查GetResourceInfo()以及无GPU分支中现有的GetSystemRAMInfo()调用。返回GPU详细信息时,确保主机RAM仍有值,并与Aggregate中的VRAM同时保留;检查资源端点或相关测试,确认存在GPU时/api/resources返回非null的ram。
由索引模型根据 Issue 内容生成。
描述
LocalAI version
v4.12.0 (15e37df9a468c798a5a511624f054057da4380a1), image localai/localai:latest-gpu-nvidia-cuda-13
Environment, CPU architecture, OS, and Version
- Docker on Linux (Ubuntu), host: Intel i9-14900KF (32 threads), 188GB RAM, NVIDIA RTX 4060 Ti (16GB VRAM)
nvidia-container-toolkit1.20.1,--gpus all- Confirmed the container has full, correct visibility into host RAM (
free -hand/proc/meminfoboth report the real 188GB inside the container, cgroupmemory.maxismax/unlimited)
Describe the bug
The "My Machine" panel in the web UI shows GPU, CPU, and disk info correctly, but RAM shows no data. Hitting the backend endpoint directly confirms it:
$ curl -s http://localhost:8080/api/resources
{"aggregate":{"total_memory":17175674880,...},"cpu":{...},"disk":{...},"gpus":[{...}],"ram":null,...}
ram is always null whenever a GPU is present. Tracing this through the source, it looks intentional rather than a detection failure: in pkg/xsysinfo/gpu.go, GetResourceInfo() takes a GPU-present branch that returns RAM: nil and instead reports VRAM totals under Aggregate, and only calls GetSystemRAMInfo() to populate RAM in the no-GPU fallback branch:
if <GPU detected> {
return &Resources{
RAM: nil,
Aggregate: AggregateMemoryInfo{
TotalMemory: aggregate.TotalVRAM,
...
},
}
}
// No GPU - fall back to system RAM
ramInfo, _ := GetSystemRAMInfo()
return &Resources{RAM: ramInfo, ...}
This means any machine with a GPU can never see host RAM info in /api/resources or the "My Machine" panel, even though the data is trivially available (GetSystemRAMInfo() already works correctly, as shown by the no-GPU branch using it).
To reproduce
- Run LocalAI with
--gpus allon any machine with an NVIDIA GPU. - Open the web UI → "My Machine" (or
curl localhost:8080/api/resources). - Observe GPU/CPU/disk are populated but
ramisnull.
Expected behavior
RAM should be populated alongside VRAM when a GPU is present — both are useful for sizing models (e.g. offloaded layers running on CPU RAM, or deciding how many models to keep warm), not just VRAM.
Additional context
Happy to test a fix — my setup bind-mounts /models, /backends, /configuration, /data onto a RAID0 NVMe array if that's a useful data point, though it doesn't seem related to this particular issue.
- 主要语言
- Go
- 星标
- 49.8k
- 派生
- 4.5k
- 平均合并
- 20 小时 11 分钟
- 30 天内合并 PR
- 350
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
mudler/LocalAI 的其他 Issue
-
[Bug] Qwen3.8-27b Uncensored Fails to Download due to 404可能已有人在做 @localai-org-maint-bot 于 1 天前认领。 未关闭bug unconfirmed
难度 1/5 1 小时以内 新手友好度 70/100
维护者通常 1 天内回复
-
Realtime: ASR EOU language tags leak into the LLM conversation (unintended reply-language switching)可能已有人在做 @nexxtmobile 于 6 天前认领。 未关闭area/api bug unconfirmed
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复
-
Open Responses API doesn't accept "output_text" as an input Item可能已有人在做 @localai-org-maint-bot 于 25 天前认领。 未关闭bug unconfirmed
难度 2/5 1-3 小时 新手友好度 78/100
mudler/LocalAI#12337 · 1 条评论 ·
维护者通常 1 天内回复
-
Gallery model audio-cpp-sortformer-diarization fails to install: SHA mismatch, reproducible across retries可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
mudler/LocalAI#11995 · 1 条评论 ·
维护者通常 1 天内回复
-
Agent pool Postgres DSN is logged in cleartext, including the password, while the auth DSN is redacted可能已有人在做 @localai-org-maint-bot 于 41 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
mudler/LocalAI#11991 · 1 条评论 ·
维护者通常 1 天内回复
相似的 Issue
-
status:needs-review type:bug
难度 2/5 1-3 小时 新手友好度 78/100
Gentleman-Programming/engram#2079 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 77/100
limitlessprojects/Go-Hybrid#1377 ·
维护者通常 1 天内回复
-
bug report
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
-
难度 2/5 1-3 小时 新手友好度 67/100
维护者通常 1 天内回复