File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -103,16 +103,19 @@ func main() {
103103 },
104104 & cli.BoolFlag {
105105 Name : "gdrcopy-enabled" ,
106+ Value : true ,
106107 Usage : "ensure that containers that request NVIDIA GPU resources are started with GDRCopy support" ,
107108 EnvVars : []string {"GDRCOPY_ENABLED" },
108109 },
109110 & cli.BoolFlag {
110111 Name : "gds-enabled" ,
112+ Value : true ,
111113 Usage : "ensure that containers that request NVIDIA GPU resources are started with GPUDirect Storage support" ,
112114 EnvVars : []string {"GDS_ENABLED" },
113115 },
114116 & cli.BoolFlag {
115117 Name : "mofed-enabled" ,
118+ Value : true ,
116119 Usage : "ensure that containers that request NVIDIA GPU resources are started with MOFED support" ,
117120 EnvVars : []string {"MOFED_ENABLED" },
118121 },
Original file line number Diff line number Diff line change @@ -336,6 +336,16 @@ func (plugin *nvidiaDevicePlugin) getAllocateResponse(requestIds []string) (*plu
336336 plugin .updateResponseForMPS (response )
337337 }
338338
339+ if plugin .config .Flags .GDRCopyEnabled != nil && * plugin .config .Flags .GDRCopyEnabled {
340+ response .Envs ["NVIDIA_GDRCOPY" ] = "enabled"
341+ }
342+ if plugin .config .Flags .GDSEnabled != nil && * plugin .config .Flags .GDSEnabled {
343+ response .Envs ["NVIDIA_GDS" ] = "enabled"
344+ }
345+ if plugin .config .Flags .MOFEDEnabled != nil && * plugin .config .Flags .MOFEDEnabled {
346+ response .Envs ["NVIDIA_MOFED" ] = "enabled"
347+ }
348+
339349 // The following modifications are only made if at least one non-CDI device
340350 // list strategy is selected.
341351 if plugin .deviceListStrategies .AllCDIEnabled () {
@@ -352,15 +362,6 @@ func (plugin *nvidiaDevicePlugin) getAllocateResponse(requestIds []string) (*plu
352362 if plugin .config .Flags .Plugin .PassDeviceSpecs != nil && * plugin .config .Flags .Plugin .PassDeviceSpecs {
353363 response .Devices = append (response .Devices , plugin .apiDeviceSpecs (* plugin .config .Flags .NvidiaDevRoot , requestIds )... )
354364 }
355- if plugin .config .Flags .GDRCopyEnabled != nil && * plugin .config .Flags .GDRCopyEnabled {
356- response .Envs ["NVIDIA_GDRCOPY" ] = "enabled"
357- }
358- if plugin .config .Flags .GDSEnabled != nil && * plugin .config .Flags .GDSEnabled {
359- response .Envs ["NVIDIA_GDS" ] = "enabled"
360- }
361- if plugin .config .Flags .MOFEDEnabled != nil && * plugin .config .Flags .MOFEDEnabled {
362- response .Envs ["NVIDIA_MOFED" ] = "enabled"
363- }
364365 return response , nil
365366}
366367
You can’t perform that action at this time.
0 commit comments