mirror of
https://github.com/mudler/LocalAI.git
synced 2026-10-28 09:08:54 -04:00
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>
This commit is contained in:
1 file changed
+6
-2
+6
-2
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user