Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions pkg/abi/nvgpu/classes.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,15 @@ const (
NVCEB7_VIDEO_ENCODER = 0x0000ceb7
NVCFB7_VIDEO_ENCODER = 0x0000cfb7
NVD1B7_VIDEO_ENCODER = 0x0000d1b7
NVB8D1_VIDEO_NVJPG = 0x0000b8d1 // Hopper
NVC4D1_VIDEO_NVJPG = 0x0000c4d1 // Turing
NVC9D1_VIDEO_NVJPG = 0x0000c9d1 // Ada
NVCDD1_VIDEO_NVJPG = 0x0000cdd1 // Blackwell
NVB8FA_VIDEO_OFA = 0x0000b8fa // Hopper
NVC6FA_VIDEO_OFA = 0x0000c6fa // Ampere
NVC7FA_VIDEO_OFA = 0x0000c7fa // Ampere
NVC9FA_VIDEO_OFA = 0x0000c9fa // Ada
NVCDFA_VIDEO_OFA = 0x0000cdfa // Blackwell
AMPERE_CHANNEL_GPFIFO_A = 0x0000c56f
TURING_A = 0x0000c597
TURING_DMA_COPY_A = 0x0000c5b5
Expand Down Expand Up @@ -721,3 +730,25 @@ type NVA0BC_ALLOC_PARAMETERS struct {
Version uint32
HMem Handle
}

// NV_NVJPG_ALLOCATION_PARAMETERS is the alloc params type for
// NVxxD1_VIDEO_NVJPG classes, from src/common/sdk/nvidia/inc/nvos.h.
//
// +marshal
type NV_NVJPG_ALLOCATION_PARAMETERS struct {
_ structs.HostLayout
Size uint32
ProhibitMultipleInstances uint32
EngineInstance uint32
}

// NV_OFA_ALLOCATION_PARAMETERS is the alloc params type for
// NVxxFA_VIDEO_OFA classes, from src/common/sdk/nvidia/inc/nvos.h.
//
// +marshal
type NV_OFA_ALLOCATION_PARAMETERS struct {
_ structs.HostLayout
Size uint32
ProhibitMultipleInstances uint32
EngineInstance uint32
}
18 changes: 18 additions & 0 deletions pkg/sentry/devices/nvproxy/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,13 @@ func Init() {
nvgpu.NVC4B7_VIDEO_ENCODER: allocHandler(rmAllocSimple[nvgpu.NV_MSENC_ALLOCATION_PARAMETERS], nvconf.CapVideo),
nvgpu.NVC7B7_VIDEO_ENCODER: allocHandler(rmAllocSimple[nvgpu.NV_MSENC_ALLOCATION_PARAMETERS], nvconf.CapVideo),
nvgpu.NVC9B7_VIDEO_ENCODER: allocHandler(rmAllocSimple[nvgpu.NV_MSENC_ALLOCATION_PARAMETERS], nvconf.CapVideo),
nvgpu.NVB8D1_VIDEO_NVJPG: allocHandler(rmAllocSimple[nvgpu.NV_NVJPG_ALLOCATION_PARAMETERS], nvconf.CapVideo),
nvgpu.NVC4D1_VIDEO_NVJPG: allocHandler(rmAllocSimple[nvgpu.NV_NVJPG_ALLOCATION_PARAMETERS], nvconf.CapVideo),
nvgpu.NVC9D1_VIDEO_NVJPG: allocHandler(rmAllocSimple[nvgpu.NV_NVJPG_ALLOCATION_PARAMETERS], nvconf.CapVideo),
nvgpu.NVB8FA_VIDEO_OFA: allocHandler(rmAllocSimple[nvgpu.NV_OFA_ALLOCATION_PARAMETERS], nvconf.CapVideo),
nvgpu.NVC6FA_VIDEO_OFA: allocHandler(rmAllocSimple[nvgpu.NV_OFA_ALLOCATION_PARAMETERS], nvconf.CapVideo),
nvgpu.NVC7FA_VIDEO_OFA: allocHandler(rmAllocSimple[nvgpu.NV_OFA_ALLOCATION_PARAMETERS], nvconf.CapVideo),
nvgpu.NVC9FA_VIDEO_OFA: allocHandler(rmAllocSimple[nvgpu.NV_OFA_ALLOCATION_PARAMETERS], nvconf.CapVideo),
nvgpu.AMPERE_CHANNEL_GPFIFO_A: allocHandler(rmAllocChannel, compUtil),
nvgpu.HOPPER_CHANNEL_GPFIFO_A: allocHandler(rmAllocChannel, compUtil),
nvgpu.TURING_A: allocHandler(rmAllocSimple[nvgpu.NV_GR_ALLOCATION_PARAMETERS], nvconf.CapGraphics),
Expand Down Expand Up @@ -699,6 +706,13 @@ func Init() {
nvgpu.NVC4B7_VIDEO_ENCODER: ioctlInfo("NVC4B7_VIDEO_ENCODER", nvgpu.NV_MSENC_ALLOCATION_PARAMETERS{}),
nvgpu.NVC7B7_VIDEO_ENCODER: ioctlInfo("NVC7B7_VIDEO_ENCODER", nvgpu.NV_MSENC_ALLOCATION_PARAMETERS{}),
nvgpu.NVC9B7_VIDEO_ENCODER: ioctlInfo("NVC9B7_VIDEO_ENCODER", nvgpu.NV_MSENC_ALLOCATION_PARAMETERS{}),
nvgpu.NVB8D1_VIDEO_NVJPG: ioctlInfo("NVB8D1_VIDEO_NVJPG", nvgpu.NV_NVJPG_ALLOCATION_PARAMETERS{}),
nvgpu.NVC4D1_VIDEO_NVJPG: ioctlInfo("NVC4D1_VIDEO_NVJPG", nvgpu.NV_NVJPG_ALLOCATION_PARAMETERS{}),
nvgpu.NVC9D1_VIDEO_NVJPG: ioctlInfo("NVC9D1_VIDEO_NVJPG", nvgpu.NV_NVJPG_ALLOCATION_PARAMETERS{}),
nvgpu.NVB8FA_VIDEO_OFA: ioctlInfo("NVB8FA_VIDEO_OFA", nvgpu.NV_OFA_ALLOCATION_PARAMETERS{}),
nvgpu.NVC6FA_VIDEO_OFA: ioctlInfo("NVC6FA_VIDEO_OFA", nvgpu.NV_OFA_ALLOCATION_PARAMETERS{}),
nvgpu.NVC7FA_VIDEO_OFA: ioctlInfo("NVC7FA_VIDEO_OFA", nvgpu.NV_OFA_ALLOCATION_PARAMETERS{}),
nvgpu.NVC9FA_VIDEO_OFA: ioctlInfo("NVC9FA_VIDEO_OFA", nvgpu.NV_OFA_ALLOCATION_PARAMETERS{}),
nvgpu.AMPERE_CHANNEL_GPFIFO_A: ioctlInfo("AMPERE_CHANNEL_GPFIFO_A", nvgpu.NV_CHANNEL_ALLOC_PARAMS{}),
nvgpu.HOPPER_CHANNEL_GPFIFO_A: ioctlInfo("HOPPER_CHANNEL_GPFIFO_A", nvgpu.NV_CHANNEL_ALLOC_PARAMS{}),
nvgpu.TURING_A: ioctlInfo("TURING_A", nvgpu.NV_GR_ALLOCATION_PARAMETERS{}),
Expand Down Expand Up @@ -876,6 +890,8 @@ func Init() {
v560_28_03 := func() *driverABI {
abi := v555_42_02()
abi.allocationClass[nvgpu.NVCDB0_VIDEO_DECODER] = allocHandler(rmAllocSimple[nvgpu.NV_BSP_ALLOCATION_PARAMETERS], nvconf.CapVideo)
abi.allocationClass[nvgpu.NVCDD1_VIDEO_NVJPG] = allocHandler(rmAllocSimple[nvgpu.NV_NVJPG_ALLOCATION_PARAMETERS], nvconf.CapVideo)
abi.allocationClass[nvgpu.NVCDFA_VIDEO_OFA] = allocHandler(rmAllocSimple[nvgpu.NV_OFA_ALLOCATION_PARAMETERS], nvconf.CapVideo)
abi.allocationClass[nvgpu.BLACKWELL_CHANNEL_GPFIFO_A] = allocHandler(rmAllocChannel, compUtil)
abi.allocationClass[nvgpu.BLACKWELL_DMA_COPY_A] = allocHandler(rmAllocSimple[nvgpu.NVB0B5_ALLOCATION_PARAMETERS], compUtil)
abi.allocationClass[nvgpu.BLACKWELL_A] = allocHandler(rmAllocSimple[nvgpu.NV_GR_ALLOCATION_PARAMETERS], nvconf.CapGraphics)
Expand All @@ -888,6 +904,8 @@ func Init() {
abi.getInfo = func() *DriverABIInfo {
info := prevGetInfo()
info.AllocationInfos[nvgpu.NVCDB0_VIDEO_DECODER] = ioctlInfo("NVCDB0_VIDEO_DECODER", nvgpu.NV_BSP_ALLOCATION_PARAMETERS{})
info.AllocationInfos[nvgpu.NVCDD1_VIDEO_NVJPG] = ioctlInfo("NVCDD1_VIDEO_NVJPG", nvgpu.NV_NVJPG_ALLOCATION_PARAMETERS{})
info.AllocationInfos[nvgpu.NVCDFA_VIDEO_OFA] = ioctlInfo("NVCDFA_VIDEO_OFA", nvgpu.NV_OFA_ALLOCATION_PARAMETERS{})
info.AllocationInfos[nvgpu.BLACKWELL_CHANNEL_GPFIFO_A] = ioctlInfo("BLACKWELL_CHANNEL_GPFIFO_A", nvgpu.NV_CHANNEL_ALLOC_PARAMS{})
info.AllocationInfos[nvgpu.BLACKWELL_DMA_COPY_A] = ioctlInfo("BLACKWELL_DMA_COPY_A", nvgpu.NVB0B5_ALLOCATION_PARAMETERS{})
info.AllocationInfos[nvgpu.BLACKWELL_A] = ioctlInfo("BLACKWELL_A", nvgpu.NV_GR_ALLOCATION_PARAMETERS{})
Expand Down
Loading