Documentation ¶
Overview ¶
Package NVSANDBOXUTILS bindings
Index ¶
- Constants
- Variables
- func SetLibraryOptions(opts ...LibraryOption) error
- type FileFlag
- type FileModule
- type FileSystemSubType
- type FileType
- type GpuFileInfo
- type GpuFileInfo_v1
- type GpuInputType
- type GpuRes
- type GpuRes_v1
- type GpuResource
- type InitInput
- type InitInput_v1
- type Interface
- type LibraryOption
- type LogLevel
- type Ret
- type RootfsInputType
Constants ¶
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 )
const VERSION_LENGTH = 100
TODO: Is this length specified in the header file?
Variables ¶
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 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 GpuFileInfo ¶
type GpuFileInfo struct { Path string Type FileType SubType FileSystemSubType Module FileModule Flags FileFlag }
type GpuFileInfo_v1 ¶
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_v1 ¶
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 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
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