Documentation
¶
Index ¶
- Constants
- func NewDriverBinariesDiscoverer(logger logger.Interface, driverRoot string) discover.Discover
- func NewDriverFirmwareDiscoverer(logger logger.Interface, driverRoot string, version string) (discover.Discover, error)
- type DeviceNamer
- type DeviceNamers
- type HookName
- type Interface
- type Option
- func WithCSVFiles(csvFiles []string) Option
- func WithCSVIgnorePatterns(csvIgnorePatterns []string) Option
- func WithClass(class string) Option
- func WithConfigSearchPaths(paths []string) Option
- func WithDevRoot(root string) Option
- func WithDeviceLib(devicelib device.Interface) Option
- func WithDeviceNamers(namers ...DeviceNamer) Option
- func WithDisabledHook(hook HookName) Option
- func WithDriverRoot(root string) Option
- func WithInfoLib(infolib info.Interface) Option
- func WithLdconfigPath(path string) Option
- func WithLibrarySearchPaths(paths []string) Option
- func WithLogger(logger logger.Interface) Option
- func WithMergedDeviceOptions(opts ...transform.MergedDeviceOption) Option
- func WithMode(mode string) Option
- func WithNVIDIACDIHookPath(path string) Option
- func WithNVIDIACTKPath(path string) Optiondeprecated
- func WithNvmlLib(nvmllib nvml.Interface) Option
- func WithVendor(vendor string) Option
- type UUIDer
Constants ¶
const ( // ModeAuto configures the CDI spec generator to automatically detect the system configuration ModeAuto = "auto" // ModeNvml configures the CDI spec generator to use the NVML library. ModeNvml = "nvml" // ModeWsl configures the CDI spec generator to generate a WSL spec. ModeWsl = "wsl" // ModeManagement configures the CDI spec generator to generate a management spec. ModeManagement = "management" // ModeGds configures the CDI spec generator to generate a GDS spec. ModeGds = "gds" // ModeMofed configures the CDI spec generator to generate a MOFED spec. ModeMofed = "mofed" // ModeCSV configures the CDI spec generator to generate a spec based on the contents of CSV // mountspec files. ModeCSV = "csv" )
const ( // DeviceNameStrategyIndex generates devices names such as 0 or 1:0 DeviceNameStrategyIndex = "index" // DeviceNameStrategyTypeIndex generates devices names such as gpu0 or mig1:0 DeviceNameStrategyTypeIndex = "type-index" // DeviceNameStrategyUUID uses the device UUID as the name DeviceNameStrategyUUID = "uuid" )
Supported device naming strategies
const ( // HookEnableCudaCompat refers to the hook used to enable CUDA Forward Compatibility. // This was added with v1.17.5 of the NVIDIA Container Toolkit. HookEnableCudaCompat = HookName("enable-cuda-compat") )
Variables ¶
This section is empty.
Functions ¶
func NewDriverBinariesDiscoverer ¶
NewDriverBinariesDiscoverer creates a discoverer for GSP firmware associated with the GPU driver.
Types ¶
type DeviceNamer ¶
type DeviceNamer interface { GetDeviceName(int, UUIDer) (string, error) GetMigDeviceName(int, UUIDer, int, UUIDer) (string, error) }
DeviceNamer is an interface for getting device names
func NewDeviceNamer ¶
func NewDeviceNamer(strategy string) (DeviceNamer, error)
NewDeviceNamer creates a Device Namer based on the supplied strategy. This namer can be used to construct the names for MIG and GPU devices when generating the CDI spec.
type DeviceNamers ¶ added in v1.15.0
type DeviceNamers []DeviceNamer
DeviceNamers represents a list of device namers
func (DeviceNamers) GetDeviceNames ¶ added in v1.15.0
func (l DeviceNamers) GetDeviceNames(i int, d UUIDer) ([]string, error)
func (DeviceNamers) GetMigDeviceNames ¶ added in v1.15.0
type HookName ¶ added in v1.17.5
type HookName string
A HookName refers to one of the predefined set of CDI hooks that may be included in the generated CDI specification.
type Interface ¶
type Interface interface { GetSpec() (spec.Interface, error) GetCommonEdits() (*cdi.ContainerEdits, error) GetAllDeviceSpecs() ([]specs.Device, error) GetGPUDeviceEdits(device.Device) (*cdi.ContainerEdits, error) GetGPUDeviceSpecs(int, device.Device) ([]specs.Device, error) GetMIGDeviceEdits(device.Device, device.MigDevice) (*cdi.ContainerEdits, error) GetMIGDeviceSpecs(int, device.Device, int, device.MigDevice) ([]specs.Device, error) GetDeviceSpecsByID(...string) ([]specs.Device, error) }
Interface defines the API for the nvcdi package
type Option ¶
type Option func(*nvcdilib)
Option is a function that configures the nvcdilib
func WithCSVFiles ¶ added in v1.14.0
WithCSVFiles sets the CSV files for the library
func WithCSVIgnorePatterns ¶ added in v1.14.2
WithCSVIgnorePatterns sets the ignore patterns for entries in the CSV files.
func WithConfigSearchPaths ¶ added in v1.15.0
WithConfigSearchPaths sets the search paths for config files.
func WithDevRoot ¶ added in v1.15.0
WithDevRoot sets the root where /dev is located.
func WithDeviceLib ¶
WithDeviceLib sets the device library for the library
func WithDeviceNamers ¶ added in v1.15.0
func WithDeviceNamers(namers ...DeviceNamer) Option
WithDeviceNamers sets the device namer for the library
func WithDisabledHook ¶ added in v1.17.5
WithDisabledHook allows specific hooks to the disabled. This option can be specified multiple times for each hook.
func WithDriverRoot ¶
WithDriverRoot sets the driver root for the library
func WithInfoLib ¶ added in v1.16.0
WithInfoLib sets the info library for CDI spec generation.
func WithLdconfigPath ¶ added in v1.15.0
WithLdconfigPath sets the path to the ldconfig program
func WithLibrarySearchPaths ¶ added in v1.14.0
WithLibrarySearchPaths sets the library search paths. This is currently only used for CSV-mode.
func WithLogger ¶
WithLogger sets the logger for the library
func WithMergedDeviceOptions ¶ added in v1.14.0
func WithMergedDeviceOptions(opts ...transform.MergedDeviceOption) Option
WithMergedDeviceOptions sets the merged device options for the library If these are not set, no merged device will be generated.
func WithNVIDIACDIHookPath ¶ added in v1.16.0
WithNVIDIACDIHookPath sets the path to the NVIDIA Container Toolkit CLI path for the library
func WithNVIDIACTKPath
deprecated
func WithNvmlLib ¶
WithNvmlLib sets the nvml library for the library