nvdevices

package
v1.17.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interface

type Interface struct {
	devices.Devices
	// contains filtered or unexported fields
}

Interface provides a set of utilities for interacting with NVIDIA devices on the system.

func New

func New(opts ...Option) (*Interface, error)

New constructs a new Interface struct with the specified options.

func (*Interface) CreateNVIDIAControlDevices

func (m *Interface) CreateNVIDIAControlDevices() error

CreateNVIDIAControlDevices creates the NVIDIA control device nodes at the configured devRoot.

func (*Interface) CreateNVIDIADevice

func (m *Interface) CreateNVIDIADevice(node string) error

CreateNVIDIADevice creates the specified NVIDIA device node at the configured devRoot.

func (*Interface) Major

func (m *Interface) Major(node string) (int64, error)

Major returns the major number for the specified NVIDIA device node. If the device node is not supported, an error is returned.

func (*Interface) Minor

func (m *Interface) Minor(node string) (int64, error)

Minor returns the minor number for the specified NVIDIA device node. If the device node is not supported, an error is returned.

type Option

type Option func(*Interface)

Option is a function that sets an option on the Interface struct.

func WithDevRoot

func WithDevRoot(devRoot string) Option

WithDevRoot sets the root directory for the NVIDIA device nodes.

func WithDevices

func WithDevices(devices devices.Devices) Option

WithDevices sets the devices for the Interface struct.

func WithDryRun

func WithDryRun(dryRun bool) Option

WithDryRun sets the dry run option for the Interface struct.

func WithLogger

func WithLogger(logger logger.Interface) Option

WithLogger sets the logger for the Interface struct.

Jump to

Keyboard shortcuts

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