mirror of
https://github.com/ollama/ollama.git
synced 2025-11-10 15:07:46 +01:00
log: instrument CPU discovery timing (#12960)
This commit is contained in:
@@ -7,7 +7,9 @@ import (
|
|||||||
"runtime"
|
"runtime"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/ollama/ollama/logutil"
|
||||||
"github.com/ollama/ollama/ml"
|
"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
|
// GetSystemInfo returns the last cached state of the GPUs on the system
|
||||||
func GetSystemInfo() ml.SystemInfo {
|
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()
|
memInfo, err := GetCPUMem()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
slog.Warn("error looking up system memory", "error", err)
|
slog.Warn("error looking up system memory", "error", err)
|
||||||
|
|||||||
Reference in New Issue
Block a user