nvsandboxutils

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: 7 Imported by: 0

Documentation

Overview

Package NVSANDBOXUTILS bindings

Index

Constants

View Source
const (
	// INPUT_LENGTH as defined in nvsandboxutils/nvsandboxutils.h
	INPUT_LENGTH = 256
	// MAX_FILE_PATH as defined in nvsandboxutils/nvsandboxutils.h
	MAX_FILE_PATH = 256
	// MAX_NAME_LENGTH as defined in nvsandboxutils/nvsandboxutils.h
	MAX_NAME_LENGTH = 256
)
View Source
const VERSION_LENGTH = 100

TODO: Is this length specified in the header file?

Variables

View Source
var (
	ErrorString      = libnvsandboxutils.ErrorString
	GetDriverVersion = libnvsandboxutils.GetDriverVersion
	GetFileContent   = libnvsandboxutils.GetFileContent
	GetGpuResource   = libnvsandboxutils.GetGpuResource
	Init             = libnvsandboxutils.Init
	LookupSymbol     = libnvsandboxutils.LookupSymbol
	Shutdown         = libnvsandboxutils.Shutdown
)

The variables below represent package level methods from the library type.

Functions

func SetLibraryOptions

func SetLibraryOptions(opts ...LibraryOption) error

SetLibraryOptions applies the specified options to the nvsandboxutils library. If this is called when a library is already loaded, an error is raised.

Types

type FileFlag

type FileFlag int32

FileFlag as declared in nvsandboxutils/nvsandboxutils.h

const (
	NV_FILE_FLAG_HINT        FileFlag = 1
	NV_FILE_FLAG_MASKOUT     FileFlag = 2
	NV_FILE_FLAG_CONTENT     FileFlag = 4
	NV_FILE_FLAG_DEPRECTATED FileFlag = 8
	NV_FILE_FLAG_CANDIDATES  FileFlag = 16
)

FileFlag enumeration from nvsandboxutils/nvsandboxutils.h

type FileModule

type FileModule int32

FileModule as declared in nvsandboxutils/nvsandboxutils.h

const (
	NV_GPU                   FileModule = iota
	NV_MIG                   FileModule = 1
	NV_DRIVER_NVIDIA         FileModule = 2
	NV_DRIVER_NVIDIA_UVM     FileModule = 3
	NV_DRIVER_NVIDIA_MODESET FileModule = 4
	NV_DRIVER_GDRDRV         FileModule = 5
	NV_SYSTEM                FileModule = 6
)

FileModule enumeration from nvsandboxutils/nvsandboxutils.h

type FileSystemSubType

type FileSystemSubType int32

FileSystemSubType as declared in nvsandboxutils/nvsandboxutils.h

const (
	NV_DEV_NVIDIA                                         FileSystemSubType = iota
	NV_DEV_DRI_CARD                                       FileSystemSubType = 1
	NV_DEV_DRI_RENDERD                                    FileSystemSubType = 2
	NV_DEV_DRI_CARD_SYMLINK                               FileSystemSubType = 3
	NV_DEV_DRI_RENDERD_SYMLINK                            FileSystemSubType = 4
	NV_DEV_NVIDIA_UVM                                     FileSystemSubType = 5
	NV_DEV_NVIDIA_UVM_TOOLS                               FileSystemSubType = 6
	NV_DEV_NVIDIA_MODESET                                 FileSystemSubType = 7
	NV_DEV_NVIDIA_CTL                                     FileSystemSubType = 8
	NV_DEV_GDRDRV                                         FileSystemSubType = 9
	NV_DEV_NVIDIA_CAPS_NVIDIA_CAP                         FileSystemSubType = 10
	NV_PROC_DRIVER_NVIDIA_GPUS_PCIBUSID                   FileSystemSubType = 11
	NV_PROC_DRIVER_NVIDIA_GPUS                            FileSystemSubType = 12
	NV_PROC_NVIDIA_PARAMS                                 FileSystemSubType = 13
	NV_PROC_NVIDIA_CAPS_MIG_MINORS                        FileSystemSubType = 14
	NV_PROC_DRIVER_NVIDIA_CAPABILITIES_GPU                FileSystemSubType = 15
	NV_PROC_DRIVER_NVIDIA_CAPABILITIES                    FileSystemSubType = 16
	NV_PROC_DRIVER_NVIDIA_CAPABILITIIES_GPU_MIG_CI_ACCESS FileSystemSubType = 17
	NV_SYS_MODULE_NVIDIA_DRIVER_PCIBUSID                  FileSystemSubType = 18
	NV_SYS_MODULE_NVIDIA_DRIVER                           FileSystemSubType = 19
	NV_NUM_SUBTYPE                                        FileSystemSubType = 20
)

FileSystemSubType enumeration from nvsandboxutils/nvsandboxutils.h

type FileType

type FileType int32

FileType as declared in nvsandboxutils/nvsandboxutils.h

const (
	NV_DEV  FileType = iota
	NV_PROC FileType = 1
	NV_SYS  FileType = 2
)

FileType enumeration from nvsandboxutils/nvsandboxutils.h

type GpuFileInfo

type GpuFileInfo struct {
	Path    string
	Type    FileType
	SubType FileSystemSubType
	Module  FileModule
	Flags   FileFlag
}

type GpuFileInfo_v1

type GpuFileInfo_v1 struct {
	Next        *GpuFileInfo_v1
	FileType    uint32
	FileSubType uint32
	Module      uint32
	Flags       uint32
	FilePath    *int8
}

type GpuInputType

type GpuInputType int32

GpuInputType as declared in nvsandboxutils/nvsandboxutils.h

const (
	NV_GPU_INPUT_GPU_UUID  GpuInputType = iota
	NV_GPU_INPUT_MIG_UUID  GpuInputType = 1
	NV_GPU_INPUT_PCI_ID    GpuInputType = 2
	NV_GPU_INPUT_PCI_INDEX GpuInputType = 3
)

GpuInputType enumeration from nvsandboxutils/nvsandboxutils.h

type GpuRes

type GpuRes struct {
	Version   uint32
	InputType uint32
	Input     [256]int8
	Files     *GpuFileInfo_v1
}

type GpuRes_v1

type GpuRes_v1 struct {
	Version   uint32
	InputType uint32
	Input     [256]int8
	Files     *GpuFileInfo_v1
}

type GpuResource

type GpuResource struct {
	Version uint32
}

type InitInput

type InitInput struct {
	Version uint32
	Type    uint32
	Value   [256]int8
}

type InitInput_v1

type InitInput_v1 struct {
	Version uint32
	Type    uint32
	Value   [256]int8
}

type Interface

type Interface interface {
	ErrorString(Ret) string
	GetDriverVersion() (string, Ret)
	GetFileContent(string) (string, Ret)
	GetGpuResource(string) ([]GpuFileInfo, Ret)
	Init(string) Ret
	LookupSymbol(string) error
	Shutdown() Ret
}

Interface represents the interface for the library type.

func New

func New(opts ...LibraryOption) Interface

type LibraryOption

type LibraryOption func(*libraryOptions)

LibraryOption represents a functional option to configure the underlying nvsandboxutils library

func WithLibraryPath

func WithLibraryPath(path string) LibraryOption

WithLibraryPath provides an option to set the library name to be used by the nvsandboxutils library.

type LogLevel

type LogLevel int32

LogLevel as declared in nvsandboxutils/nvsandboxutils.h

const (
	LOG_LEVEL_FATAL LogLevel = iota
	LOG_LEVEL_ERROR LogLevel = 1
	LOG_LEVEL_WARN  LogLevel = 2
	LOG_LEVEL_DEBUG LogLevel = 3
	LOG_LEVEL_INFO  LogLevel = 4
	LOG_LEVEL_NONE  LogLevel = 65535
)

LogLevel enumeration from nvsandboxutils/nvsandboxutils.h

type Ret

type Ret int32

Ret as declared in nvsandboxutils/nvsandboxutils.h

const (
	SUCCESS                     Ret = iota
	ERROR_UNINITIALIZED         Ret = 1
	ERROR_NOT_SUPPORTED         Ret = 2
	ERROR_INVALID_ARG           Ret = 3
	ERROR_INSUFFICIENT_SIZE     Ret = 4
	ERROR_VERSION_NOT_SUPPORTED Ret = 5
	ERROR_LIBRARY_LOAD          Ret = 6
	ERROR_FUNCTION_NOT_FOUND    Ret = 7
	ERROR_DEVICE_NOT_FOUND      Ret = 8
	ERROR_NVML_LIB_CALL         Ret = 9
	ERROR_OUT_OF_MEMORY         Ret = 10
	ERROR_FILEPATH_NOT_FOUND    Ret = 11
	ERROR_UNKNOWN               Ret = 65535
)

Ret enumeration from nvsandboxutils/nvsandboxutils.h

func (Ret) Error

func (r Ret) Error() string

Error returns the string representation of a Ret.

func (Ret) String

func (r Ret) String() string

String returns the string representation of a Ret.

type RootfsInputType

type RootfsInputType int32

RootfsInputType as declared in nvsandboxutils/nvsandboxutils.h

const (
	NV_ROOTFS_DEFAULT RootfsInputType = iota
	NV_ROOTFS_PATH    RootfsInputType = 1
	NV_ROOTFS_PID     RootfsInputType = 2
)

RootfsInputType enumeration from nvsandboxutils/nvsandboxutils.h

Directories

Path Synopsis
gen

Jump to

Keyboard shortcuts

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