envd icon indicating copy to clipboard operation
envd copied to clipboard

feat(CLI): envd up a GPU image without GPUs

Open gaocegege opened this issue 2 years ago • 4 comments

Description

Now we consider the user wants a GPU if cuda is called in build.envd. But we may need to support envd up --no-gpu.

gaocegege avatar Jun 08 '22 10:06 gaocegege

mean ignore cuda command?

kenwoodjw avatar Jun 17 '22 08:06 kenwoodjw

No, users build.envd may look like:

def build():
  cuda(xxx)

When the user run envd up, we will use nvidia-container-runtime to launch a GPU container.

This feature is to launch a CPU container with the same build.envd when user run envd up --no-gpu

gaocegege avatar Jun 17 '22 08:06 gaocegege

maybe like this? https://github.com/tensorchord/envd/blob/main/pkg/app/up.go#L146

var CommandUp = &cli.Command{
+		&cli.BoolFlag{
+			Name: "no-gpu",
+			Usage: "launch same cpu container without gpu",
+			Value: false,
		},
	},

	Action: up,
}
gpu_enable := clicontext.Bool("no-gpu")
var gpu bool
if gpu_enable {
gpu = false
}else {
gpu = builder.GPUEnabled()
}
}

kenwoodjw avatar Jun 20 '22 12:06 kenwoodjw

LGTM.

gaocegege avatar Jun 20 '22 13:06 gaocegege