root

package
v1.18.2 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

type Driver struct {
	sync.Mutex

	// Root represents the root from the perspective of the driver libraries and binaries.
	Root string
	// contains filtered or unexported fields
}

Driver represents a filesystem in which a set of drivers or devices is defined.

func New

func New(opts ...Option) *Driver

New creates a new Driver root using the specified options.

func (*Driver) Configs

func (r *Driver) Configs() lookup.Locator

Configs returns a locator for driver configs. If configSearchPaths is specified, these paths are used as absolute paths, otherwise, /etc and /usr/share are searched.

func (*Driver) DriverLibraryLocator added in v1.18.0

func (r *Driver) DriverLibraryLocator(additionalDirs ...string) (lookup.Locator, error)

func (*Driver) Files added in v1.16.0

func (r *Driver) Files(opts ...lookup.Option) lookup.Locator

Files returns a Locator for arbitrary driver files.

func (*Driver) GetLibcudaParentDir added in v1.18.0

func (r *Driver) GetLibcudaParentDir() (string, error)

func (*Driver) GetLibcudasoPath added in v1.18.0

func (r *Driver) GetLibcudasoPath() (string, error)

GetLibcudaParentDir returns the cached libcuda.so path if possible. If this has not yet been initialized, the path is first detected and then returned.

func (*Driver) Libraries

func (r *Driver) Libraries() lookup.Locator

Libraries returns a Locator for driver libraries.

func (*Driver) RelativeToRoot added in v1.16.0

func (r *Driver) RelativeToRoot(path string) string

RelativeToRoot returns the specified path relative to the driver root.

func (*Driver) Version added in v1.18.0

func (r *Driver) Version() (string, error)

Version returns the cached driver version if possible. If this has not yet been initialised, the version is first updated and then returned.

type Option

type Option func(*options)

func WithConfigSearchPaths

func WithConfigSearchPaths(paths ...string) Option

func WithDriverRoot

func WithDriverRoot(root string) Option

func WithLibrarySearchPaths

func WithLibrarySearchPaths(paths ...string) Option

func WithLogger

func WithLogger(logger logger.Interface) Option

func WithVersioner added in v1.18.0

func WithVersioner(versioner Versioner) Option

type Versioner added in v1.18.0

type Versioner interface {
	Version() (string, error)
}

func FirstOf added in v1.18.0

func FirstOf(v ...Versioner) Versioner

Jump to

Keyboard shortcuts

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