nvconf

package
v0.0.0-...-0fb4cc7 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0, MIT Imports: 4 Imported by: 0

Documentation

Overview

Package nvconf provides configuration structures and utilities for nvproxy.

This package is separate from the main nvproxy package to allow reading and working with nvproxy configuration without importing the full nvproxy package and its dependencies. This is useful for tools and applications that only need to interact with the configuration.

Index

Constants

View Source
const (
	// AllCapabilitiesName is a special capability name
	// that can be used to represent all capabilities.
	AllCapabilitiesName = "all"

	// ValidCapabilities is the set of all valid capabilities.
	ValidCapabilities = DriverCaps(1<<numValidCaps - 1)

	// SupportedDriverCaps is the set of driver capabilities that are supported by
	// nvproxy. Similar to
	// nvidia-container-toolkit/internal/config/image/capabilities.go:SupportedDriverCapabilities.
	SupportedDriverCaps = DriverCaps(CapCompute | CapUtility | CapGraphics)

	// DefaultDriverCaps is the set of driver capabilities that are enabled by
	// default in the absence of any other configuration. See
	// nvidia-container-toolkit/internal/config/image/capabilities.go:DefaultDriverCapabilities.
	DefaultDriverCaps = DriverCaps(CapCompute | CapUtility)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DriverCaps

type DriverCaps uint8

DriverCaps is a set of NVIDIA driver capabilities as a bitmask.

const (
	CapCompute DriverCaps = 1 << iota
	CapDisplay
	CapGraphics
	CapNGX
	CapUtility
	CapVideo
	CapCompat32
)

Individual NVIDIA driver capabilities.

func DriverCapsFromString

func DriverCapsFromString(commaSeparatedCaps string) (DriverCaps, bool, error)

DriverCapsFromString creates a new capability set from the given comma-separated list of capability names. The returned boolean represents whether the "all" keyword was used. Note that the "all" keyword is not actually expanded into the set of capabilities returned here; it is up to the caller to decide how to handle it.

func PopularCapabilitySets

func PopularCapabilitySets() []DriverCaps

PopularCapabilitySets returns the most commonly used capability sets.

func (DriverCaps) NVIDIAFlags

func (c DriverCaps) NVIDIAFlags() []string

NVIDIAFlags returns the nvidia-container-cli flags that can be passed to enable the capabilities in the set.

func (DriverCaps) String

func (c DriverCaps) String() string

String returns the string representation of the capability set.

Jump to

Keyboard shortcuts

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