From ba8c035846c1548d384e3129aa72a2338f031991 Mon Sep 17 00:00:00 2001 From: Daniel Hiltgen Date: Tue, 4 Nov 2025 16:23:37 -0800 Subject: [PATCH] log: instrument CPU discovery timing (#12960) --- discover/gpu.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/discover/gpu.go b/discover/gpu.go index 927aed2a..4a7d552d 100644 --- a/discover/gpu.go +++ b/discover/gpu.go @@ -7,7 +7,9 @@ import ( "runtime" "strconv" "strings" + "time" + "github.com/ollama/ollama/logutil" "github.com/ollama/ollama/ml" ) @@ -17,6 +19,12 @@ var CudaTegra string = os.Getenv("JETSON_JETPACK") // GetSystemInfo returns the last cached state of the GPUs on the system func GetSystemInfo() ml.SystemInfo { + logutil.Trace("performing CPU discovery") + startDiscovery := time.Now() + defer func() { + logutil.Trace("CPU discovery completed", "duration", time.Since(startDiscovery)) + }() + memInfo, err := GetCPUMem() if err != nil { slog.Warn("error looking up system memory", "error", err)