@@ -94,6 +94,10 @@ type ClusterPolicySpec struct {
9494 KataManager KataManagerSpec `json:"kataManager,omitempty"`
9595 // CCManager component spec
9696 CCManager CCManagerSpec `json:"ccManager,omitempty"`
97+ // GPUConfigManager component spec. The GPU configuration manager configures GPU settings
98+ // such as the power limit, locked clocks and ECC mode on each node from ConfigMaps in the
99+ // operator namespace, and applies them again after every driver load.
100+ GPUConfigManager GPUConfigManagerSpec `json:"gpuConfigManager,omitempty"`
97101 // HostPaths defines various paths on the host needed by GPU Operator components
98102 HostPaths HostPathsSpec `json:"hostPaths,omitempty"`
99103 // KataSandboxDevicePlugin component spec
@@ -1816,6 +1820,52 @@ type CCManagerSpec struct {
18161820 HostNetwork * bool `json:"hostNetwork,omitempty"`
18171821}
18181822
1823+ // GPUConfigManagerSpec defines the properties for deploying the GPU configuration manager
1824+ type GPUConfigManagerSpec struct {
1825+ // Enabled indicates if deployment of the GPU configuration manager is enabled
1826+ // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1827+ // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Enable GPU Configuration Manager deployment through GPU Operator"
1828+ // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:booleanSwitch"
1829+ Enabled * bool `json:"enabled,omitempty"`
1830+
1831+ // Config selects the ConfigMap (key config.yaml) in the operator namespace with the GPU settings for all nodes.
1832+ // For a node, gpu-config-node-<node name> wins over gpu-config-pool-<pool>, which wins over this one.
1833+ // <pool> is derived from the node's nvidia.com/gpu-config.pool label (lowercased, "_" to "-"; values that
1834+ // can't name a ConfigMap are ignored); set POOL_LABEL_KEY in spec.gpuConfigManager.env to use another label.
1835+ // +kubebuilder:validation:Optional
1836+ Config * GPUConfigManagerConfigSpec `json:"config,omitempty"`
1837+
1838+ // Optional: Define resources requests and limits for each pod
1839+ // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1840+ // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Resource Requirements"
1841+ // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:resourceRequirements"
1842+ Resources * ResourceRequirements `json:"resources,omitempty"`
1843+
1844+ // Optional: List of environment variables. They are also passed to the gpu-config init container
1845+ // of the validator / DRA kubelet plugin, even when the manager is disabled. GPU_CONFIG_NO_MODULE_TIMEOUT
1846+ // sets how long that container waits for the nvidia module before letting allocators start (default 5m).
1847+ // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1848+ // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Environment Variables"
1849+ // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:text"
1850+ Env []EnvVar `json:"env,omitempty"`
1851+
1852+ // HostNetwork indicates whether the GPU configuration manager pod uses the host's network namespace.
1853+ // +kubebuilder:validation:Optional
1854+ // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1855+ // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Enable hostNetwork for NVIDIA GPU Configuration Manager"
1856+ // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:booleanSwitch"
1857+ HostNetwork * bool `json:"hostNetwork,omitempty"`
1858+ }
1859+
1860+ // GPUConfigManagerConfigSpec selects the ConfigMap with the GPU settings for all nodes
1861+ type GPUConfigManagerConfigSpec struct {
1862+ // Name of the ConfigMap in the operator namespace with the GPU settings for nodes
1863+ // that have no per-node or per-pool ConfigMap
1864+ // +kubebuilder:validation:Optional
1865+ // +kubebuilder:default:="gpu-config"
1866+ Name string `json:"name,omitempty"`
1867+ }
1868+
18191869// VFIOManagerSpec defines the properties for deploying VFIO-PCI manager
18201870type VFIOManagerSpec struct {
18211871 // Enabled indicates if deployment of VFIO Manager is enabled
@@ -2516,6 +2566,22 @@ func (c *CCManagerSpec) IsEnabled() bool {
25162566 return * c .Enabled
25172567}
25182568
2569+ // IsEnabled returns true if the GPU configuration manager is enabled; it is disabled by default
2570+ func (g * GPUConfigManagerSpec ) IsEnabled () bool {
2571+ if g .Enabled == nil {
2572+ return false
2573+ }
2574+ return * g .Enabled
2575+ }
2576+
2577+ // ClusterDocumentName returns the name of the ConfigMap with the GPU settings for all nodes
2578+ func (g * GPUConfigManagerSpec ) ClusterDocumentName () string {
2579+ if g .Config == nil || g .Config .Name == "" {
2580+ return "gpu-config"
2581+ }
2582+ return g .Config .Name
2583+ }
2584+
25192585// +kubebuilder:object:generate=false
25202586type ConfigWithName interface {
25212587 GetName () string
0 commit comments