Merge pull request #774 from filecoin-project/feat/nogpu-worker

worker: nogpu flag
This commit is contained in:
Łukasz Magiera 2019-12-07 15:53:31 +01:00 committed by GitHub
commit 737fe365da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -39,6 +39,11 @@ func main() {
EnvVars: []string{"LOTUS_STORAGE_PATH"}, EnvVars: []string{"LOTUS_STORAGE_PATH"},
Value: "~/.lotusstorage", // TODO: Consider XDG_DATA_HOME Value: "~/.lotusstorage", // TODO: Consider XDG_DATA_HOME
}, },
&cli.BoolFlag{
Name: "enable-gpu-proving",
Usage: "enable use of GPU for mining operations",
Value: true,
},
}, },
Commands: local, Commands: local,
@ -54,6 +59,10 @@ var runCmd = &cli.Command{
Name: "run", Name: "run",
Usage: "Start lotus worker", Usage: "Start lotus worker",
Action: func(cctx *cli.Context) error { Action: func(cctx *cli.Context) error {
if !cctx.Bool("enable-gpu-proving") {
os.Setenv("BELLMAN_NO_GPU", "true")
}
nodeApi, closer, err := lcli.GetStorageMinerAPI(cctx) nodeApi, closer, err := lcli.GetStorageMinerAPI(cctx)
if err != nil { if err != nil {
return xerrors.Errorf("getting miner api: %w", err) return xerrors.Errorf("getting miner api: %w", err)