mirror of
https://github.com/mudler/LocalAI.git
synced 2026-10-28 00:59:28 -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>
(cherry picked from commit 01fcd6ba54)
This commit is contained in:
1 parent
a1e0faa9f0
commit
31be935dd4
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