Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Abierto Apto para principiantes
#12,834 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
72/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
go
Área
api, backend

Línea de trabajo

Empieza por pkg/xsysinfo/gpu.go e inspecciona GetResourceInfo() y la llamada existente a GetSystemRAMInfo() en la rama sin GPU. Mantén la RAM del host informada cuando se devuelvan los detalles de la GPU, junto con la VRAM en Aggregate; comprueba el endpoint de recursos o las pruebas pertinentes para confirmar que /api/resources devuelve ram distinto de null cuando hay una GPU presente.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Go
Estrellas
49.8k
Forks
4.5k
Merge medio
20 h 11 min
PR fusionados (30 d)
350

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de mudler/LocalAI

Todos los issues de mudler/LocalAI

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.