fix(xsysinfo): report system RAM in /api/resources when a GPU is present

Fixes #12834

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: berce <75228263+bercedev@users.noreply.github.com>
(cherry picked from commit 01fcd6ba54)
This commit is contained in:
berce authored and Ettore Di Giacinto committed 2026-10-25 08:43:05 +00:00
1 parent a1e0faa9f0
commit 31be935dd4
1 file changed
+6 -2
+6 -2
View File
@@ -1085,13 +1085,17 @@ func GetResourceInfo() ResourceInfo {
gpus := GetGPUMemoryUsage()
if len(gpus) > 0 {
// GPU available - return GPU info
// GPU available - return GPU info, plus system RAM for the UI and CPU offload (#12834)
aggregate := GetGPUAggregateInfo()
ramInfo, err := GetSystemRAMInfo()
if err != nil {
xlog.Debug("failed to get system RAM info", "error", err)
}
return ResourceInfo{
Type: "gpu",
Available: true,
GPUs: gpus,
RAM: nil,
RAM: ramInfo,
Aggregate: AggregateMemoryInfo{
TotalMemory: aggregate.TotalVRAM,
UsedMemory: aggregate.UsedVRAM,