modifier

package
v1.17.8 Latest Latest
Warning

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

Go to latest
Published: May 30, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Merge

func Merge(modifiers ...oci.SpecModifier) oci.SpecModifier

Merge merges a set of OCI specification modifiers as a list. This can be used to compose modifiers.

func NewCDIModifier

func NewCDIModifier(logger logger.Interface, cfg *config.Config, ociSpec oci.Spec) (oci.SpecModifier, error)

NewCDIModifier creates an OCI spec modifier that determines the modifications to make based on the CDI specifications available on the system. The NVIDIA_VISIBLE_DEVICES environment variable is used to select the devices to include.

func NewCSVModifier

func NewCSVModifier(logger logger.Interface, cfg *config.Config, container image.CUDA) (oci.SpecModifier, error)

NewCSVModifier creates a modifier that applies modications to an OCI spec if required by the runtime wrapper. The modifications are defined by CSV MountSpecs.

func NewFeatureGatedModifier added in v1.15.0

func NewFeatureGatedModifier(logger logger.Interface, cfg *config.Config, image image.CUDA, driver *root.Driver) (oci.SpecModifier, error)

NewFeatureGatedModifier creates the modifiers for optional features. These include:

NVIDIA_GDS=enabled
NVIDIA_MOFED=enabled
NVIDIA_NVSWITCH=enabled
NVIDIA_GDRCOPY=enabled

If not devices are selected, no changes are made.

func NewGraphicsModifier added in v1.12.0

func NewGraphicsModifier(logger logger.Interface, cfg *config.Config, containerImage image.CUDA, driver *root.Driver) (oci.SpecModifier, error)

NewGraphicsModifier constructs a modifier that injects graphics-related modifications into an OCI runtime specification. The value of the NVIDIA_DRIVER_CAPABILITIES environment variable is checked to determine if this modification should be made.

func NewModifierFromDiscoverer

func NewModifierFromDiscoverer(logger logger.Interface, d discover.Discover) (oci.SpecModifier, error)

NewModifierFromDiscoverer creates a modifier that applies the discovered modifications to an OCI spec if required by the runtime wrapper.

func NewNvidiaContainerRuntimeHookRemover added in v1.17.5

func NewNvidiaContainerRuntimeHookRemover(logger logger.Interface) oci.SpecModifier

NewNvidiaContainerRuntimeHookRemover creates a modifier that removes any NVIDIA Container Runtime hooks from the provided spec.

func NewStableRuntimeModifier

func NewStableRuntimeModifier(logger logger.Interface, nvidiaContainerRuntimeHookPath string) oci.SpecModifier

NewStableRuntimeModifier creates an OCI spec modifier that inserts the NVIDIA Container Runtime Hook into an OCI spec. The specified logger is used to capture log output.

Types

type List added in v1.17.4

type List []oci.SpecModifier

func (List) Modify added in v1.17.4

func (m List) Modify(spec *specs.Spec) error

Modify applies a list of modifiers in sequence and returns on any errors encountered.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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