Documentation
¶
Index ¶
- Variables
- func RegisterInKubelet(socket string) error
- type SingularityDevicePlugin
- func (dp *SingularityDevicePlugin) Allocate(ctx context.Context, req *k8sDP.AllocateRequest) (*k8sDP.AllocateResponse, error)
- func (*SingularityDevicePlugin) GetDevicePluginOptions(context.Context, *k8sDP.Empty) (*k8sDP.DevicePluginOptions, error)
- func (dp *SingularityDevicePlugin) ListAndWatch(_ *k8sDP.Empty, srv k8sDP.DevicePlugin_ListAndWatchServer) error
- func (*SingularityDevicePlugin) PreStartContainer(context.Context, *k8sDP.PreStartContainerRequest) (*k8sDP.PreStartContainerResponse, error)
- func (dp *SingularityDevicePlugin) Shutdown() error
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNoGPUs is returned when device plugin is unable to // detect any GPU device on the host. ErrNoGPUs = fmt.Errorf("GPUs are not found on this host") // ErrUnableToLoad is returned when device plugin is unable to // detect loaded graphic driver on the host or unable to load // NVML shared library. ErrUnableToLoad = fmt.Errorf("unable to load: check libnvidia-ml.so.1 library and graphic drivers") )
Functions ¶
func RegisterInKubelet ¶
RegisterInKubelet registers Singularity device plugin that is listening on socket in kubelet.
Types ¶
type SingularityDevicePlugin ¶
type SingularityDevicePlugin struct {
// contains filtered or unexported fields
}
SingularityDevicePlugin is Singularity implementation of a DevicePluginServer interface that allows containers to request nvidia GPUs.
func NewSingularityDevicePlugin ¶
func NewSingularityDevicePlugin() (*SingularityDevicePlugin, error)
NewSingularityDevicePlugin initializes and returns Singularity device plugin that allows us to access nvidia GPUs on host. It fails if there is no graphic driver installed on host or if Nvidia Management Library (NVML) fails to load.
func (*SingularityDevicePlugin) Allocate ¶
func (dp *SingularityDevicePlugin) Allocate(ctx context.Context, req *k8sDP.AllocateRequest) (*k8sDP.AllocateResponse, error)
Allocate is called during container creation so that the Device Plugin can run device specific operations and instruct Kubelet of the steps to make the Device available in the container.
func (*SingularityDevicePlugin) GetDevicePluginOptions ¶
func (*SingularityDevicePlugin) GetDevicePluginOptions(context.Context, *k8sDP.Empty) (*k8sDP.DevicePluginOptions, error)
GetDevicePluginOptions returns options to be communicated with Device Manager.
func (*SingularityDevicePlugin) ListAndWatch ¶
func (dp *SingularityDevicePlugin) ListAndWatch(_ *k8sDP.Empty, srv k8sDP.DevicePlugin_ListAndWatchServer) error
ListAndWatch returns a stream of List of Devices. Whenever a Device state changes or a Device disappears, ListAndWatch returns the new list.
func (*SingularityDevicePlugin) PreStartContainer ¶
func (*SingularityDevicePlugin) PreStartContainer(context.Context, *k8sDP.PreStartContainerRequest) (*k8sDP.PreStartContainerResponse, error)
PreStartContainer is called, if indicated by Device Plugin during registration phase, before each container start. Device plugin can run device specific operations such as resetting the device before making devices available to the container.
func (*SingularityDevicePlugin) Shutdown ¶
func (dp *SingularityDevicePlugin) Shutdown() error
Shutdown shuts down device plugin and any GPU monitoring activity.