mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Add nvproxy ioctl support for UVM_SET_RANGE_GROUP and UVM_MIGRATE_RANGE_GROUP.
This fixes the `0_Introduction/UnifiedMemoryStreams` CUDA test. PiperOrigin-RevId: 641385705
This commit is contained in:
@@ -27,6 +27,7 @@ const (
|
||||
UVM_UNREGISTER_GPU_VASPACE = 26
|
||||
UVM_REGISTER_CHANNEL = 27
|
||||
UVM_UNREGISTER_CHANNEL = 28
|
||||
UVM_SET_RANGE_GROUP = 31
|
||||
UVM_MAP_EXTERNAL_ALLOCATION = 33
|
||||
UVM_FREE = 34
|
||||
UVM_REGISTER_GPU = 37
|
||||
@@ -34,6 +35,7 @@ const (
|
||||
UVM_PAGEABLE_MEM_ACCESS = 39
|
||||
UVM_SET_PREFERRED_LOCATION = 42
|
||||
UVM_DISABLE_READ_DUPLICATION = 45
|
||||
UVM_MIGRATE_RANGE_GROUP = 53
|
||||
UVM_TOOLS_READ_PROCESS_MEMORY = 62
|
||||
UVM_TOOLS_WRITE_PROCESS_MEMORY = 63
|
||||
UVM_MAP_DYNAMIC_PARALLELISM_REGION = 65
|
||||
@@ -125,6 +127,15 @@ type UVM_UNREGISTER_CHANNEL_PARAMS struct {
|
||||
RMStatus uint32
|
||||
}
|
||||
|
||||
// +marshal
|
||||
type UVM_SET_RANGE_GROUP_PARAMS struct {
|
||||
RangeGroupID uint64
|
||||
RequestedBase uint64
|
||||
Length uint64
|
||||
RMStatus uint32
|
||||
Pad0 [4]byte
|
||||
}
|
||||
|
||||
// +marshal
|
||||
type UVM_MAP_EXTERNAL_ALLOCATION_PARAMS struct {
|
||||
Base uint64
|
||||
@@ -240,6 +251,14 @@ type UVM_DISABLE_READ_DUPLICATION_PARAMS struct {
|
||||
Pad0 [4]byte
|
||||
}
|
||||
|
||||
// +marshal
|
||||
type UVM_MIGRATE_RANGE_GROUP_PARAMS struct {
|
||||
RangeGroupID uint64
|
||||
DestinationUUID NvUUID
|
||||
RMStatus uint32
|
||||
Pad0 [4]byte
|
||||
}
|
||||
|
||||
// +marshal
|
||||
type UVM_TOOLS_READ_PROCESS_MEMORY_PARAMS struct {
|
||||
Buffer uint64
|
||||
|
||||
@@ -134,6 +134,10 @@ func Filters() seccomp.SyscallRules {
|
||||
seccomp.NonNegativeFD{},
|
||||
seccomp.EqualTo(nvgpu.UVM_UNREGISTER_CHANNEL),
|
||||
},
|
||||
seccomp.PerArg{
|
||||
seccomp.NonNegativeFD{},
|
||||
seccomp.EqualTo(nvgpu.UVM_SET_RANGE_GROUP),
|
||||
},
|
||||
seccomp.PerArg{
|
||||
seccomp.NonNegativeFD{},
|
||||
seccomp.EqualTo(nvgpu.UVM_MAP_EXTERNAL_ALLOCATION),
|
||||
@@ -162,6 +166,10 @@ func Filters() seccomp.SyscallRules {
|
||||
seccomp.NonNegativeFD{},
|
||||
seccomp.EqualTo(nvgpu.UVM_DISABLE_READ_DUPLICATION),
|
||||
},
|
||||
seccomp.PerArg{
|
||||
seccomp.NonNegativeFD{},
|
||||
seccomp.EqualTo(nvgpu.UVM_MIGRATE_RANGE_GROUP),
|
||||
},
|
||||
seccomp.PerArg{
|
||||
seccomp.NonNegativeFD{},
|
||||
seccomp.EqualTo(nvgpu.UVM_TOOLS_READ_PROCESS_MEMORY),
|
||||
|
||||
@@ -182,6 +182,7 @@ func Init() {
|
||||
nvgpu.UVM_UNREGISTER_GPU_VASPACE: uvmIoctlSimple[nvgpu.UVM_UNREGISTER_GPU_VASPACE_PARAMS],
|
||||
nvgpu.UVM_REGISTER_CHANNEL: uvmIoctlHasFrontendFD[nvgpu.UVM_REGISTER_CHANNEL_PARAMS],
|
||||
nvgpu.UVM_UNREGISTER_CHANNEL: uvmIoctlSimple[nvgpu.UVM_UNREGISTER_CHANNEL_PARAMS],
|
||||
nvgpu.UVM_SET_RANGE_GROUP: uvmIoctlSimple[nvgpu.UVM_SET_RANGE_GROUP_PARAMS],
|
||||
nvgpu.UVM_MAP_EXTERNAL_ALLOCATION: uvmIoctlHasFrontendFD[nvgpu.UVM_MAP_EXTERNAL_ALLOCATION_PARAMS],
|
||||
nvgpu.UVM_FREE: uvmIoctlSimple[nvgpu.UVM_FREE_PARAMS],
|
||||
nvgpu.UVM_REGISTER_GPU: uvmIoctlHasFrontendFD[nvgpu.UVM_REGISTER_GPU_PARAMS],
|
||||
@@ -189,6 +190,7 @@ func Init() {
|
||||
nvgpu.UVM_PAGEABLE_MEM_ACCESS: uvmIoctlSimple[nvgpu.UVM_PAGEABLE_MEM_ACCESS_PARAMS],
|
||||
nvgpu.UVM_SET_PREFERRED_LOCATION: uvmIoctlSimple[nvgpu.UVM_SET_PREFERRED_LOCATION_PARAMS],
|
||||
nvgpu.UVM_DISABLE_READ_DUPLICATION: uvmIoctlSimple[nvgpu.UVM_DISABLE_READ_DUPLICATION_PARAMS],
|
||||
nvgpu.UVM_MIGRATE_RANGE_GROUP: uvmIoctlSimple[nvgpu.UVM_MIGRATE_RANGE_GROUP_PARAMS],
|
||||
nvgpu.UVM_MAP_DYNAMIC_PARALLELISM_REGION: uvmIoctlSimple[nvgpu.UVM_MAP_DYNAMIC_PARALLELISM_REGION_PARAMS],
|
||||
nvgpu.UVM_ALLOC_SEMAPHORE_POOL: uvmIoctlSimple[nvgpu.UVM_ALLOC_SEMAPHORE_POOL_PARAMS],
|
||||
nvgpu.UVM_VALIDATE_VA_RANGE: uvmIoctlSimple[nvgpu.UVM_VALIDATE_VA_RANGE_PARAMS],
|
||||
|
||||
@@ -71,12 +71,11 @@ var (
|
||||
// testCompatibility maps test names to their compatibility data.
|
||||
// Unmapped test names are assumed to be fully compatible.
|
||||
var testCompatibility = map[string]Compatibility{
|
||||
"0_Introduction/simpleAttributes": RequiresFeatures(FeaturePersistentL2Caching),
|
||||
"0_Introduction/simpleCUDA2GL": RequiresFeatures(FeatureGL),
|
||||
"0_Introduction/simpleIPC": &BrokenInGVisor{OnlyWhenMultipleGPU: true},
|
||||
"0_Introduction/simpleP2P": MultiCompatibility(&RequiresMultiGPU{}, &BrokenInGVisor{}),
|
||||
"0_Introduction/UnifiedMemoryStreams": &BrokenInGVisor{},
|
||||
"0_Introduction/vectorAddMMAP": &BrokenInGVisor{OnlyWhenMultipleGPU: true},
|
||||
"0_Introduction/simpleAttributes": RequiresFeatures(FeaturePersistentL2Caching),
|
||||
"0_Introduction/simpleCUDA2GL": RequiresFeatures(FeatureGL),
|
||||
"0_Introduction/simpleIPC": &BrokenInGVisor{OnlyWhenMultipleGPU: true},
|
||||
"0_Introduction/simpleP2P": MultiCompatibility(&RequiresMultiGPU{}, &BrokenInGVisor{}),
|
||||
"0_Introduction/vectorAddMMAP": &BrokenInGVisor{OnlyWhenMultipleGPU: true},
|
||||
"2_Concepts_and_Techniques/cuHook": &BrokenEverywhere{
|
||||
Reason: "Requires ancient version of glibc (<=2.33)",
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user