gpu_darwin.go 655 Bytes
Newer Older
1
2
//go:build darwin

3
package gpu
4

5
import "C"
6
import (
Daniel Hiltgen's avatar
Daniel Hiltgen committed
7
8
	"runtime"

9
10
11
12
13
14
	"github.com/jmorganca/ollama/api"
)

// CheckVRAM returns the free VRAM in bytes on Linux machines with NVIDIA GPUs
func CheckVRAM() (int64, error) {
	// TODO - assume metal, and return free memory?
15
	return 0, nil
16
17
18

}

19
20
21
22
23
func GetGPUInfo() GpuInfo {
	// TODO - Metal vs. x86 macs...

	return GpuInfo{
		Driver:      "METAL",
24
		Library:     "default",
25
26
27
28
29
		TotalMemory: 0,
		FreeMemory:  0,
	}
}

30
func NumGPU(numLayer, fileSizeBytes int64, opts api.Options) int {
Daniel Hiltgen's avatar
Daniel Hiltgen committed
31
32
33
34
35
36
	if runtime.GOARCH == "arm64" {
		return 1
	}

	// metal only supported on arm64
	return 0
37
}
38
39
40
41

func nativeInit() error {
	return nil
}