Allow to pass --no-cgroup option to nvidia-container-cli
Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
This commit is contained in:
parent
fdfe01d7d3
commit
9c01fe20d3
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user