Skip to content

Commit 1a9abee

Browse files
ayushr2zkoopmans
authored andcommitted
nvproxy: Add support for 570.86.15 driver.
Co-authored-by: Zach Koopmans <[email protected]> PiperOrigin-RevId: 721910920
1 parent 0f88965 commit 1a9abee

File tree

3 files changed

+35
-1
lines changed

3 files changed

+35
-1
lines changed

pkg/abi/nvgpu/classes.go

+10
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,16 @@ type NV_CHANNEL_ALLOC_PARAMS struct {
361361
HmacNonce [CC_CHAN_ALLOC_NONCE_SIZE_DWORD]uint32
362362
}
363363

364+
// NV_CHANNEL_ALLOC_PARAMS_V570 is the updated version of
365+
// NV_CHANNEL_ALLOC_PARAMS since 570.86.15.
366+
//
367+
// +marshal
368+
type NV_CHANNEL_ALLOC_PARAMS_V570 struct {
369+
NV_CHANNEL_ALLOC_PARAMS
370+
TPCConfigID uint32
371+
_ uint32
372+
}
373+
364374
// NVB0B5_ALLOCATION_PARAMETERS is the alloc param type for TURING_DMA_COPY_A,
365375
// AMPERE_DMA_COPY_A, and AMPERE_DMA_COPY_B from
366376
// src/common/sdk/nvidia/inc/class/clb0b5sw.h.

pkg/sentry/devices/nvproxy/frontend.go

+7
Original file line numberDiff line numberDiff line change
@@ -1221,6 +1221,13 @@ func rmAllocChannel(fi *frontendIoctlState, ioctlParams *nvgpu.NVOS64_PARAMETERS
12211221
})
12221222
}
12231223

1224+
// rmAllocChannelV570 is the same as rmAllocChannel, but for 570.86.15.
1225+
func rmAllocChannelV570(fi *frontendIoctlState, ioctlParams *nvgpu.NVOS64_PARAMETERS, isNVOS64 bool) (uintptr, error) {
1226+
return rmAllocSimpleParams(fi, ioctlParams, isNVOS64, func(fi *frontendIoctlState, ioctlParams *nvgpu.NVOS64_PARAMETERS, rightsRequested nvgpu.RS_ACCESS_MASK, allocParams *nvgpu.NV_CHANNEL_ALLOC_PARAMS_V570) {
1227+
fi.fd.dev.nvp.objAdd(fi.ctx, ioctlParams.HRoot, ioctlParams.HObjectNew, ioctlParams.HClass, newRmAllocObject(fi.fd, ioctlParams, rightsRequested, allocParams), ioctlParams.HObjectParent, allocParams.HVASpace, allocParams.HContextShare)
1228+
})
1229+
}
1230+
12241231
func rmAllocContextShare(fi *frontendIoctlState, ioctlParams *nvgpu.NVOS64_PARAMETERS, isNVOS64 bool) (uintptr, error) {
12251232
return rmAllocSimpleParams(fi, ioctlParams, isNVOS64, func(fi *frontendIoctlState, ioctlParams *nvgpu.NVOS64_PARAMETERS, rightsRequested nvgpu.RS_ACCESS_MASK, allocParams *nvgpu.NV_CTXSHARE_ALLOCATION_PARAMETERS) {
12261233
// See

pkg/sentry/devices/nvproxy/version.go

+18-1
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,24 @@ func Init() {
839839
}
840840

841841
v560_35_03 := addDriverABI(560, 35, 03, "f2932c92fadd43c5b2341be453fc4f73f0ad7185c26bb7a43fbde81ae29f1fe3", v560_28_03)
842-
_ = addDriverABI(565, 57, 01, "6eebe94e585e385e8804f5a74152df414887bf819cc21bd95b72acd0fb182c7a", v560_35_03)
842+
v565_57_01 := addDriverABI(565, 57, 01, "6eebe94e585e385e8804f5a74152df414887bf819cc21bd95b72acd0fb182c7a", v560_35_03)
843+
844+
_ = addDriverABI(570, 86, 15, "87709c19c7401243136bc0ec9e7f147c6803070a11449ae8f0819dee7963f76b", func() *driverABI {
845+
abi := v565_57_01()
846+
abi.allocationClass[nvgpu.TURING_CHANNEL_GPFIFO_A] = allocHandler(rmAllocChannelV570, compUtil)
847+
abi.allocationClass[nvgpu.AMPERE_CHANNEL_GPFIFO_A] = allocHandler(rmAllocChannelV570, compUtil)
848+
abi.allocationClass[nvgpu.HOPPER_CHANNEL_GPFIFO_A] = allocHandler(rmAllocChannelV570, compUtil)
849+
850+
prevStructs := abi.getStructs
851+
abi.getStructs = func() *driverABIStructs {
852+
structs := prevStructs()
853+
structs.allocationStructs[nvgpu.TURING_CHANNEL_GPFIFO_A] = driverStructWithName(nvgpu.NV_CHANNEL_ALLOC_PARAMS_V570{}, "NV_CHANNEL_ALLOC_PARAMS")
854+
structs.allocationStructs[nvgpu.AMPERE_CHANNEL_GPFIFO_A] = driverStructWithName(nvgpu.NV_CHANNEL_ALLOC_PARAMS_V570{}, "NV_CHANNEL_ALLOC_PARAMS")
855+
structs.allocationStructs[nvgpu.HOPPER_CHANNEL_GPFIFO_A] = driverStructWithName(nvgpu.NV_CHANNEL_ALLOC_PARAMS_V570{}, "NV_CHANNEL_ALLOC_PARAMS")
856+
return structs
857+
}
858+
return abi
859+
})
843860
})
844861
}
845862

0 commit comments

Comments
 (0)