354ad9254e
The GPU drivers take a while to update their free memory reporting, so we need to wait until the values converge with what we're expecting before proceeding to start another runner in order to get an accurate picture.
21 lines
306 B
Go
21 lines
306 B
Go
package gpu
|
|
|
|
import (
|
|
"log/slog"
|
|
|
|
"golang.org/x/sys/cpu"
|
|
)
|
|
|
|
func GetCPUVariant() string {
|
|
if cpu.X86.HasAVX2 {
|
|
slog.Debug("CPU has AVX2")
|
|
return "avx2"
|
|
}
|
|
if cpu.X86.HasAVX {
|
|
slog.Debug("CPU has AVX")
|
|
return "avx"
|
|
}
|
|
slog.Debug("CPU does not have vector extensions")
|
|
// else LCD
|
|
return ""
|
|
}
|