device

package
v1.0.0-beta.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 30, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

func RegisterInKubelet(socket string) error

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

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

GetDevicePluginOptions returns options to be communicated with Device Manager.

func (*SingularityDevicePlugin) ListAndWatch

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

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL