Get up and running with Kimi, GLM, MiniMax, DeepSeek, gpt-oss, Qwen, Gemma and other models.
win: revert CPU discovery logic to 0.12.3 (#12969)
Daniel Hiltgen97e05d2a6be5
diff --git a/discover/cpu_windows.go b/discover/cpu_windows.goindex 5f516b5d1..9a1028c94 100644--- a/discover/cpu_windows.go+++ b/discover/cpu_windows.go@@ -5,6 +5,8 @@ import ("log/slog""syscall""unsafe"++ "github.com/ollama/ollama/logutil")type MEMORYSTATUSEX struct {@@ -99,22 +101,29 @@ func (pkg *winPackage) IsMember(target *GROUP_AFFINITY) bool {}func getLogicalProcessorInformationEx() ([]byte, error) {- buf := make([]byte, 1024)+ buf := make([]byte, 1)bufSize := len(buf)- var err error- for range 3 {- var ret uintptr- ret, _, err = GetLogicalProcessorInformationEx.Call(- uintptr(RelationAll),- uintptr(unsafe.Pointer(&buf[0])),- uintptr(unsafe.Pointer(&bufSize)),- )- if ret == 1 && bufSize <= len(buf) {- return buf, nil- }- buf = make([]byte, bufSize)+ ret, _, err := GetLogicalProcessorInformationEx.Call(+ uintptr(RelationAll),+ uintptr(unsafe.Pointer(&buf[0])),+ uintptr(unsafe.Pointer(&bufSize)),+ )+ if ret != 0 {+ logutil.Trace("failed to retrieve CPU payload size", "ret", ret, "size", bufSize, "error", err)+ return nil, fmt.Errorf("failed to determine size info ret:%d %w", ret, err)+ }++ buf = make([]byte, bufSize)+ ret, _, err = GetLogicalProcessorInformationEx.Call(+ uintptr(RelationAll),+ uintptr(unsafe.Pointer(&buf[0])),+ uintptr(unsafe.Pointer(&bufSize)),+ )+ if ret == 0 {+ logutil.Trace("failed to retrieve CPU information", "ret", ret, "size", len(buf), "new_size", bufSize, "error", err)+ return nil, fmt.Errorf("failed to gather processor information ret:%d buflen:%d %w", ret, bufSize, err)}- return nil, fmt.Errorf("unable to determine CPU details: %w", err)+ return buf, nil}func processSystemLogicalProcessorInforationList(buf []byte) []*winPackage {