Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

ram is always null in /api/resources ("My Machine" panel) whenever a GPU is present

Aperta Adatta ai principianti
#12,834 0 commenti 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@bercedev ci sta già lavorando.

Dal 23/10/2026.

  • #12861 di @bercedev — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
go
Ambito
api, backend

Direzione di ricerca

Inizia da pkg/xsysinfo/gpu.go ed esamina GetResourceInfo() e la chiamata esistente a GetSystemRAMInfo() nel ramo senza GPU. Mantieni valorizzata la RAM dell’host quando vengono restituiti i dettagli della GPU, insieme alla VRAM in Aggregate; controlla l’endpoint delle risorse o i test pertinenti per confermare che /api/resources restituisca ram non nullo quando è presente una GPU.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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-toolkit 1.20.1, --gpus all
  • Confirmed the container has full, correct visibility into host RAM (free -h and /proc/meminfo both report the real 188GB inside the container, cgroup memory.max is max/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
  1. Run LocalAI with --gpus all on any machine with an NVIDIA GPU.
  2. Open the web UI → "My Machine" (or curl localhost:8080/api/resources).
  3. Observe GPU/CPU/disk are populated but ram is null.
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.

Lingua principale
Go
Stelle
49.8k
Fork
4.5k
Merge medio
19h 22m
PR unite (30g)
352

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di mudler/LocalAI

Tutte le issue di mudler/LocalAI

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.