envd
envd copied to clipboard
feat(CLI): envd up a GPU image without GPUs
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
.
mean ignore cuda command?
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
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()
}
}
LGTM.