package nvproxy
import "gvisor.dev/gvisor/pkg/sentry/devices/nvproxy"
Package nvproxy implements proxying for the Nvidia GPU Linux kernel driver: https://github.com/NVIDIA/open-gpu-kernel-modules.
Supported Nvidia GPUs: T4, L4, A100, A10G and H100.
Lock ordering:
- nvproxy.fdsMu - rootClient.objsMu
- nvproxy.clientsMu
Index ¶
- func ExpectedDriverChecksum(version nvconf.DriverVersion) (string, bool)
- func Filters(enabledCaps nvconf.DriverCaps) seccomp.SyscallRules
- func ForEachSupportDriver(f func(version nvconf.DriverVersion, checksum string))
- func HostDriverVersion() (string, error)
- func Init()
- func LatestDriver() nvconf.DriverVersion
- func Register(vfsObj *vfs.VirtualFilesystem, version nvconf.DriverVersion, driverCaps nvconf.DriverCaps, uvmDevMajor uint32, useDevGofer bool) error
- func SupportedDrivers() []nvconf.DriverVersion
- func SupportedIoctls(version nvconf.DriverVersion) (frontendIoctls map[uint32]struct{}, uvmIoctls map[uint32]struct{}, controlCmds map[uint32]struct{}, allocClasses map[uint32]struct{}, ok bool)
- type DriverStruct
- type DriverStructName
- type NvidiaDeviceFD
Functions ¶
func ExpectedDriverChecksum ¶
func ExpectedDriverChecksum(version nvconf.DriverVersion) (string, bool)
ExpectedDriverChecksum returns the expected checksum for a given version. Precondition: Init() must have been called.
func Filters ¶
func Filters(enabledCaps nvconf.DriverCaps) seccomp.SyscallRules
Filters returns seccomp-bpf filters for this package when using the given set of capabilities.
func ForEachSupportDriver ¶
func ForEachSupportDriver(f func(version nvconf.DriverVersion, checksum string))
ForEachSupportDriver calls f on all supported drivers. Precondition: Init() must have been called.
func HostDriverVersion ¶
HostDriverVersion returns the version of the host Nvidia driver.
func Init ¶
func Init()
Init initializes abis global map.
func LatestDriver ¶
func LatestDriver() nvconf.DriverVersion
LatestDriver returns the latest supported driver. Precondition: Init() must have been called.
func Register ¶
func Register(vfsObj *vfs.VirtualFilesystem, version nvconf.DriverVersion, driverCaps nvconf.DriverCaps, uvmDevMajor uint32, useDevGofer bool) error
Register registers all devices implemented by this package in vfsObj.
func SupportedDrivers ¶
func SupportedDrivers() []nvconf.DriverVersion
SupportedDrivers returns a list of all supported drivers. Precondition: Init() must have been called.
func SupportedIoctls ¶
func SupportedIoctls(version nvconf.DriverVersion) (frontendIoctls map[uint32]struct{}, uvmIoctls map[uint32]struct{}, controlCmds map[uint32]struct{}, allocClasses map[uint32]struct{}, ok bool)
SupportedIoctls returns the ioctl numbers that are supported by nvproxy at a given version.
Types ¶
type DriverStruct ¶
type DriverStruct struct { Name DriverStructName Type reflect.Type }
DriverStruct ties an nvproxy struct type to its corresponding driver struct name.
func SupportedStructTypes ¶
func SupportedStructTypes(version nvconf.DriverVersion) ([]DriverStruct, bool)
SupportedStructTypes returns the list of struct types supported by the given driver version. It merges the frontend, uvm, control, and allocation names into one slice.
type DriverStructName ¶
type DriverStructName = string
DriverStructName is the name of a struct used by the Nvidia driver.
func SupportedStructNames ¶
func SupportedStructNames(version nvconf.DriverVersion) ([]DriverStructName, bool)
SupportedStructNames returns the list of struct names supported by the given driver version. It merges the frontend, uvm, control, and allocation names into one slice.
type NvidiaDeviceFD ¶
type NvidiaDeviceFD interface {
IsNvidiaDeviceFD()
}
NvidiaDeviceFD is an interface that should be implemented by all vfs.FileDescriptionImpl of Nvidia devices.
Source Files ¶
frontend.go frontend_mmap.go frontend_mmap_unsafe.go frontend_unsafe.go handlers.go nvproxy.go nvproxy_unsafe.go object.go save_restore.go save_restore_impl.go seccomp_filters.go uvm.go uvm_mmap.go uvm_unsafe.go version.go
Directories ¶
Path | Synopsis |
---|---|
pkg/sentry/devices/nvproxy/nvconf | Package nvconf provides configuration structures and utilities for nvproxy. |
- Version
- v0.0.0-20250605235530-a6711d1e1dc6 (latest)
- Published
- Jun 5, 2025
- Platform
- linux/amd64
- Imports
- 33 packages
- Last checked
- 4 hours ago –
Tools for package owners.