Allow to pass --no-cgroup option to nvidia-container-cli
@@ -111,6 +111,7 @@ type config struct {
LDConfig string
Requirements []string
OCIHookPath string
+ NoCgroups bool
}
func (c *config) args() []string {
@@ -137,6 +138,9 @@ func (c *config) args() []string {
for _, r := range c.Requirements {
args = append(args, fmt.Sprintf("--require=%s", r))
}
+ if c.NoCgroups {
+ args = append(args, "--no-cgroups")
+ }
args = append(args, "--pid={{pid}}", "{{rootfs}}")
return args
}
@@ -209,3 +213,9 @@ func WithLookupOCIHookPath(name string) Opts {
return nil
}
}
+
+// WithNoCgroups passes --no-cgroups option to nvidia-container-cli.
+func WithNoCgroups(c *config) error {
+ c.NoCgroups = true
+ return nil
+}
