Skip to content

Commit c51f087

Browse files
authored
Merge pull request #668 from eero-t/gpu-plugin-monitoring-to-operator
Add "-enable-monitoring" GPU plugin option operator support
2 parents 5bdf8f5 + 4b26c94 commit c51f087

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

deployments/operator/crd/bases/deviceplugin.intel.com_gpudeviceplugins.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ spec:
5151
spec:
5252
description: GpuDevicePluginSpec defines the desired state of GpuDevicePlugin.
5353
properties:
54+
enableMonitoring:
55+
description: EnableMonitoring enables the monitoring resource ('i915_monitoring')
56+
which gives access to all GPU devices on given node.
57+
type: boolean
5458
image:
5559
description: Image is a container image with GPU device plugin executable.
5660
type: string

pkg/apis/deviceplugin/v1/gpudeviceplugin_types.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,17 @@ type GpuDevicePluginSpec struct {
3535
// +kubebuilder:validation:Minimum=1
3636
SharedDevNum int `json:"sharedDevNum,omitempty"`
3737

38-
// ResourceManager handles the fractional resource management for multi-GPU nodes
39-
ResourceManager bool `json:"resourceManager,omitempty"`
40-
4138
// LogLevel sets the plugin's log level.
4239
// +kubebuilder:validation:Minimum=0
4340
LogLevel int `json:"logLevel,omitempty"`
4441

42+
// ResourceManager handles the fractional resource management for multi-GPU nodes
43+
ResourceManager bool `json:"resourceManager,omitempty"`
44+
45+
// EnableMonitoring enables the monitoring resource ('i915_monitoring')
46+
// which gives access to all GPU devices on given node.
47+
EnableMonitoring bool `json:"enableMonitoring,omitempty"`
48+
4549
// NodeSelector provides a simple way to constrain device plugin pods to nodes with particular labels.
4650
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
4751
}

pkg/controllers/gpu/controller.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,10 @@ func getPodArgs(gdp *devicepluginv1.GpuDevicePlugin) []string {
393393
args := make([]string, 0, 4)
394394
args = append(args, "-v", strconv.Itoa(gdp.Spec.LogLevel))
395395

396+
if gdp.Spec.EnableMonitoring {
397+
args = append(args, "-enable-monitoring")
398+
}
399+
396400
if gdp.Spec.SharedDevNum > 0 {
397401
args = append(args, "-shared-dev-num", strconv.Itoa(gdp.Spec.SharedDevNum))
398402
} else {

0 commit comments

Comments
 (0)