Documentation ¶
Index ¶
- Constants
- type Daemon
- func (d *Daemon) AssertHealthy() error
- func (d *Daemon) Devices() rm.Devices
- func (d *Daemon) EchoPipeToControl(command string) (string, error)
- func (d *Daemon) EnvVars() envvars
- func (d *Daemon) LogDir() string
- func (d *Daemon) PipeDir() string
- func (d *Daemon) ShmDir() string
- func (d *Daemon) Start() error
- func (d *Daemon) Stop() error
- type Manager
- type Option
- type Root
Constants ¶
const (
ContainerRoot = Root("/mps")
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Daemon ¶
type Daemon struct {
// contains filtered or unexported fields
}
Daemon represents an MPS daemon. It is associated with a specific kubernets resource and is responsible for starting and stopping the deamon as well as ensuring that the memory and thread limits are set for the devices that the resource makes available.
func NewDaemon ¶
func NewDaemon(rm rm.ResourceManager, root Root) *Daemon
NewDaemon creates an MPS daemon instance.
func NewDaemons ¶
func NewDaemons(infolib info.Interface, nvmllib nvml.Interface, devicelib device.Interface, opts ...Option) ([]*Daemon, error)
Daemons creates the required set of MPS daemons for the specified options.
func (*Daemon) AssertHealthy ¶
AssertHealthy checks that the MPS control daemon is healthy.
func (*Daemon) EchoPipeToControl ¶
EchoPipeToControl sends the specified command to the MPS control daemon.
func (*Daemon) EnvVars ¶ added in v0.17.0
func (d *Daemon) EnvVars() envvars
EnvVars returns the environment variables required for the daemon. These should be passed to clients consuming the device shared using MPS. TODO: Set CUDA_VISIBLE_DEVICES to include only the devices for this resource type.
type Option ¶
type Option func(*manager)
Option defines a functional option for configuring an MPS manager.
func WithConfig ¶
WithConfig sets the config associated with the MPS manager.
type Root ¶
type Root string
Root represents an MPS root. This is where per-resource pipe and log directories are created. For containerised applications the host root is typically mounted to /mps in the container.
func (Root) LogDir ¶
func (r Root) LogDir(resourceName spec.ResourceName) string
LogDir returns the per-resource pipe dir for the specified root.