set num_gpu
to 1 only by default on darwin arm64 (#1771)
This commit is contained in:
parent
0b3118e0af
commit
c7ea8f237e
1 changed files with 5 additions and 1 deletions
|
@ -33,11 +33,15 @@ func getCPUMem() (memInfo, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func NumGPU(numLayer, fileSizeBytes int64, opts api.Options) int {
|
func NumGPU(numLayer, fileSizeBytes int64, opts api.Options) int {
|
||||||
|
if opts.NumGPU != -1 {
|
||||||
|
return opts.NumGPU
|
||||||
|
}
|
||||||
|
|
||||||
|
// metal only supported on arm64
|
||||||
if runtime.GOARCH == "arm64" {
|
if runtime.GOARCH == "arm64" {
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
// metal only supported on arm64
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue