MCPcopy Index your code
hub / github.com/ROCm/gpu-operator

github.com/ROCm/gpu-operator @v1.5.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.5.0 ↗ · + Follow
1,477 symbols 4,452 edges 79 files 693 documented · 47% updated todayv1.5.1-beta.0 · 2026-06-05★ 10414 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

AMD GPU Operator

:book: GPU Operator Documentation Site

For the most detailed and up-to-date documentation please visit our Instinct Documenation site: https://instinct.docs.amd.com/projects/gpu-operator

Introduction

AMD GPU Operator simplifies the deployment and management of AMD Instinct GPU accelerators within Kubernetes clusters. This project enables seamless configuration and operation of GPU-accelerated workloads, including machine learning, Generative AI, and other GPU-intensive applications.

Components

  • AMD GPU Operator Controller
  • K8s Device Plugin
  • K8s Node Labeller
  • K8s DRA (Dynamic Resource Allocation) Driver
  • Device Config Manager
  • Device Metrics Exporter
  • Device Test Runner
  • Node Feature Discovery Operator
  • Kernel Module Management Operator

Features

  • Streamlined GPU driver installation and management
  • Comprehensive metrics collection and export
  • Easy deployment of AMD GPU device plugin for Kubernetes
  • Support for DRA (Dynamic Resource Allocation) as an alternative to the traditional device plugin
  • Automated labeling of nodes with AMD GPU capabilities
  • GPU partitioning configuration and management via Device Config Manager
  • Compatibility with standard Kubernetes environments
  • Efficient GPU resource allocation for containerized workloads
  • GPU health monitoring and troubleshooting

Compatibility

  • ROCm DKMS Compatibility: Please refer to the ROCM official website for the compatability matrix for ROCM driver.
  • Kubernetes: 1.29.0+

Prerequisites

  • Kubernetes v1.29.0+
  • Helm v3.2.0+
  • kubectl CLI tool configured to access your cluster
  • Cert Manager Install it by running these commands if not already installed in the cluster:
helm repo add jetstack https://charts.jetstack.io --force-update

helm install cert-manager jetstack/cert-manager \
  --namespace cert-manager \
  --create-namespace \
  --version v1.15.1 \
  --set crds.enabled=true

Quick Start

1. Add the AMD Helm Repository

helm repo add rocm https://rocm.github.io/gpu-operator
helm repo update

2. Install the Operator

Basic installation

helm install amd-gpu-operator rocm/gpu-operator-charts \
  --namespace kube-amd-gpu \
  --create-namespace \
  --version=v1.4.0
Installation Options
  - Skip NFD installation: `--set node-feature-discovery.enabled=false`
  - Skip KMM installation: `--set kmm.enabled=false`
  - Disable KMM watching/usage: `--set kmm.watch=false`
  - Skip Auto Node Remediation: `--set remediation.enabled=false`
  - Enable DRA driver (instead of device plugin): `--set deviceConfig.spec.draDriver.enable=true --set deviceConfig.spec.devicePlugin.enableDevicePlugin=false`
  - Disable DeviceClass creation: `--set draDriver.deviceClass.create=false`

[!WARNING] It is strongly recommended to use AMD-optimized KMM images included in the operator release. This is not required when installing the GPU Operator on Red Hat OpenShift.

3. Install Custom Resource

After the installation of AMD GPU Operator:

  • By default there will be a default DeviceConfig installed. If you are using default DeviceConfig, you can modify the default DeviceConfig to adjust the config for your own use case. kubectl edit deviceconfigs -n kube-amd-gpu default
  • If you installed without default DeviceConfig (either by using --set crds.defaultCR.install=false or installing a chart prior to v1.3.0), you need to create the DeviceConfig custom resource in order to trigger the operator start to work. By preparing the DeviceConfig in the YAML file, you can create the resouce by running kubectl apply -f deviceconfigs.yaml.
  • For custom resource definition and more detailed information, please refer to Custom Resource Installation Guide.
  • Potential Failures with default DeviceConfig: a. Operand pods are stuck in Init:0/1 state: It means your GPU worker doesn't have inbox GPU driver loaded. We suggest check the Driver Installation Guide then modify the default DeviceConfig to ask Operator to install the out-of-tree GPU driver for your worker nodes. kubectl edit deviceconfigs -n kube-amd-gpu default b. No operand pods showed up: It is possible that default DeviceConfig selector feature.node.kubernetes.io/amd-gpu: "true" cannot find any matched node.
  • Check node label kubectl get node -oyaml | grep -e "amd-gpu:" -e "amd-vgpu:"
  • If you are using GPU in the VM, you may need to change the default DeviceConfig selector to feature.node.kubernetes.io/amd-vgpu: "true"
  • You can always customize the node selector of the DeviceConfig.

Grafana Dashboards

Following dashboards are provided for visualizing GPU metrics collected from device-metrics-exporter:

  • Overview Dashboard: Provides a comprehensive view of the GPU cluster.
  • GPU Detail Dashboard: Offers a detailed look at individual GPUs.
  • Job Detail Dashboard: Presents detailed GPU usage for specific jobs in SLURM and Kubernetes environments.
  • Node Detail Dashboard: Displays detailed GPU usage at the host level.

Contributing

Please refer to our Developer Guide.

Support

For bugs and feature requests, please file an issue on our GitHub Issues page.

License

The AMD GPU Operator is licensed under the Apache License 2.0.

Extension points exported contracts — how you extend this code

PodEventHandlerAPI (Interface)
go:generate mockgen -source=pod.go -package=watchers -destination=mock_pod.go PodEventHandlerAPI [10 implementers]
internal/controllers/watchers/pod.go
KMMModuleAPI (Interface)
go:generate mockgen -source=kmmmodule.go -package=kmmmodule -destination=mock_kmmmodule.go KMMModuleAPI [4 implementers]
internal/kmmmodule/kmmmodule.go
DevicePluginAPI (Interface)
go:generate mockgen -source=plugin.go -package=plugin -destination=mock_plugin.go DevicePluginAPI [3 implementers]
internal/plugin/plugin.go
NodeLabeller (Interface)
go:generate mockgen -source=nodelabeller.go -package=nodelabeller -destination=mock_nodelabeller.go NodeLabeller [3 implementers]
internal/nodelabeller/nodelabeller.go
ConfigManager (Interface)
go:generate mockgen -source=configmanager.go -package=configmanager -destination=mock_configmanager.go ConfigManager [3 …
internal/configmanager/configmanager.go
MetricsExporter (Interface)
go:generate mockgen -source=metricsexporter.go -package=metricsexporter -destination=mock_metricsexporter.go MetricsExpo [3 …
internal/metricsexporter/metricsexporter.go
ValidatorAPI (Interface)
go:generate mockgen -source=validator.go -package=validator -destination=mock_validator.go ValidatorAPI [3 implementers]
internal/validator/validator.go
TestRunner (Interface)
go:generate mockgen -source=testrunner.go -package=testrunner -destination=mock_testrunner.go TestRunner [3 implementers]
internal/testrunner/testrunner.go

Core symbols most depended-on inside this repo

Get
called by 245
tests/e2e/client/client.go
List
called by 108
tests/e2e/client/client.go
DeviceConfigs
called by 98
tests/e2e/client/client.go
EXPECT
called by 72
internal/controllers/mock_upgrademgr.go
Delete
called by 52
tests/e2e/client/client.go
Patch
called by 40
internal/client/mock_client.go
Create
called by 34
tests/e2e/client/client.go
GetAMDGpuWorker
called by 31
tests/e2e/utils/utils.go

Shape

Method 1,107
Function 229
Struct 115
Interface 19
TypeAlias 3
Class 2
FuncType 2

Languages

Go99%
Python1%

Modules by API surface

internal/controllers/remediation_handler.go125 symbols
internal/controllers/mock_remediation_handler.go122 symbols
internal/controllers/upgrademgr.go97 symbols
internal/controllers/mock_upgrademgr.go96 symbols
tests/e2e/cluster_test.go78 symbols
internal/controllers/device_config_reconciler.go73 symbols
tests/e2e/utils/utils.go71 symbols
api/v1alpha1/zz_generated.deepcopy.go70 symbols
internal/controllers/mock_device_config_reconciler.go60 symbols
tests/e2e/client/client.go47 symbols
internal/client/mock_client.go40 symbols
api/v1alpha1/deviceconfig_types.go35 symbols

For agents

$ claude mcp add gpu-operator \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact