harmony: Dev env var to override gpu count
This commit is contained in:
parent
6b361443ba
commit
ad37cf5ead
@ -4,12 +4,23 @@
|
||||
package resources
|
||||
|
||||
import (
|
||||
"os"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
ffi "github.com/filecoin-project/filecoin-ffi"
|
||||
)
|
||||
|
||||
func getGPUDevices() float64 { // GPU boolean
|
||||
if nstr := os.Getenv("HARMONY_OVERRIDE_GPUS"); nstr != "" {
|
||||
n, err := strconv.ParseFloat(nstr, 64)
|
||||
if err != nil {
|
||||
logger.Errorf("parsing HARMONY_OVERRIDE_GPUS failed: %+v", err)
|
||||
} else {
|
||||
return n
|
||||
}
|
||||
}
|
||||
|
||||
gpus, err := ffi.GetGPUDevices()
|
||||
logger.Infow("GPUs", "list", gpus)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user