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

3
package gpu
4

5
import "C"
6
7
8
9
10
11
12
import (
	"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?
13
	return 0, nil
14
15
16

}

17
18
19
20
21
22
23
24
25
26
func GetGPUInfo() GpuInfo {
	// TODO - Metal vs. x86 macs...

	return GpuInfo{
		Driver:      "METAL",
		TotalMemory: 0,
		FreeMemory:  0,
	}
}

27
28
29
30
func NumGPU(numLayer, fileSizeBytes int64, opts api.Options) int {
	// default to enable metal on macOS
	return 1
}
31
32
33
34

func nativeInit() error {
	return nil
}