Version: v1.3.4 Latest Latest

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

Go to latest
Published: Apr 16, 2020 License: Apache-2.0 Imports: 9 Imported by: 0




View Source
const NvidiaCLI = "nvidia-container-cli"

NvidiaCLI is the path to the Nvidia helper binary


This section is empty.


func WithAllCapabilities

func WithAllCapabilities(c *config) error

WithAllCapabilities adds all capabilities to the container for the gpus

func WithAllDevices

func WithAllDevices(c *config) error

WithAllDevices adds all gpus to the container

func WithGPUs

func WithGPUs(opts ...Opts) oci.SpecOpts

WithGPUs adds NVIDIA gpu support to a container


type Capability

type Capability string

Capability specifies capabilities for the gpu inside the container Detailed explanation of options can be found: https://github.com/nvidia/nvidia-container-runtime#supported-driver-capabilities

const (
	// Compute capability
	Compute Capability = "compute"
	// Compat32 capability
	Compat32 Capability = "compat32"
	// Graphics capability
	Graphics Capability = "graphics"
	// Utility capability
	Utility Capability = "utility"
	// Video capability
	Video Capability = "video"
	// Display capability
	Display Capability = "display"

func AllCaps added in v1.3.0

func AllCaps() []Capability

AllCaps returns the complete list of supported Nvidia capabilities.

type Opts

type Opts func(*config) error

Opts are options for configuring gpu support

func WithCapabilities

func WithCapabilities(caps ...Capability) Opts

WithCapabilities adds the specified capabilities to the container for the gpus

func WithDeviceUUIDs

func WithDeviceUUIDs(uuids ...string) Opts

WithDeviceUUIDs adds the specific device UUID to the container

func WithDevices

func WithDevices(ids ...int) Opts

WithDevices adds the provided device indexes to the container

func WithLookupOCIHookPath

func WithLookupOCIHookPath(name string) Opts

WithLookupOCIHookPath sets the hook path for the binary via a binary name

func WithOCIHookPath

func WithOCIHookPath(path string) Opts

WithOCIHookPath sets the hook path for the binary

func WithRequiredCUDAVersion

func WithRequiredCUDAVersion(major, minor int) Opts

WithRequiredCUDAVersion sets the required cuda version

Source Files

Jump to

Keyboard shortcuts

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