Install the NVIDIA GPU Operator and HAMi with one command, then prove that two pods can share one GPU with a hard VRAM limit each. Verified on a GreenNode VKS GPU node (see Tested on).
A VKS node group with GPU nodes comes with no NVIDIA driver and no device plugin, and nvidia.com/gpu does not
appear until a device plugin runs. This sample installs:
| Component | Role |
|---|---|
| GPU Operator | NVIDIA driver, container toolkit, node labels. Its own device plugin is off |
| HAMi | The only device plugin + scheduler. Splits one GPU's memory and cores between pods |
Only one device plugin may run. Two plugins that both register nvidia.com/gpu let pods get a GPU with no VRAM limit.
Requirements: kubectl pointing at your VKS cluster, helm 3, and nodes with Internet access
(they pull images from nvcr.io, docker.io and registry.k8s.io).
git clone https://github.com/GreenNode-Samples/sample-vks-gpu-hami && cd sample-vks-gpu-hami
./install.sh # GPU Operator, waits for the driver, then HAMi
./verify.sh # PASS/FAIL checks + a two-pod VRAM isolation testExpected output of ./verify.sh:
PASS no image pull errors
PASS GPU Operator ClusterPolicy ready
PASS only one device plugin (HAMi)
PASS HAMi scheduler and device plugin running
PASS virtual GPUs advertised: <cards x 10>
PASS pod A sees 2000 MiB
PASS pod B sees 3000 MiB
The driver is compiled on the node, so the first install takes several minutes (4.5 minutes in our test).
install.sh finds GPU nodes by themselves (Node Feature Discovery label for NVIDIA PCI devices).
To choose them yourself: GPU_NODES="node-a node-b" ./install.sh.
Schedule with HAMi and ask for a slice of the GPU:
spec:
schedulerName: hami-scheduler
containers:
- name: app
resources:
limits:
nvidia.com/gpu: 1 # one virtual GPU
nvidia.com/gpumem: 4000 # MiB of VRAM (must not exceed one physical card)
nvidia.com/gpucores: 30 # % of computenvidia.com/gpu: 20 on a node means 20 virtual GPUs (HAMi splits each card into 10 by default), not 20 cards.
| Date | 2026-12-02 |
| Platform | GreenNode VKS, Kubernetes v1.32.9, zone HCM03-1A, node image Ubuntu 22.04 (kernel 5.15.0-179) |
| GPU | 1× GeForce RTX 2080 Ti, 11 GB (consumer card), installed with CONSUMER_GPU=1 |
| Versions | GPU Operator v26.3.3 (driver 580.126.20, the chart default), HAMi 2.9.0 |
| Result | ./verify.sh: all 7 checks PASS; the node advertised 10 virtual GPUs; two pods asking 2000 MiB and 3000 MiB saw exactly that |
Not covered by this test: datacenter cards (the default install without CONSUMER_GPU) and multi-GPU or multi-node clusters.
New GPU nodes are not labeled automatically. Label them so the HAMi device plugin runs there:
kubectl label node <node> gpu=true. (Re-running ./install.sh does it for every detected GPU node.)
- Chart versions are pinned in
versions.env(GPU_OPERATOR_VERSION,HAMI_VERSION) — the combination we tested. Upgrade by changing one line, then run./install.shand./verify.sh. - The HAMi
kube-schedulerimage tag is set to your cluster's Kubernetes version automatically. - CI (every push and weekly) runs static checks only: shellcheck,
helm lint/helm templateof both pinned charts, a check that every key invalues/*.yamlexists in the chart defaults (Helm silently ignores unknown keys), assertions on the rendered manifests (upstreamkube-schedulerimage, no mirror registry, device plugin off in the operator),helm install --dry-run=serveron akindcluster, andinstall.shup to node selection with a fake NFD label. CI has no GPU, so driver build, HAMi scheduling andverify.share not exercised there: run them on your own GPU cluster. - No GreenNode IDs, flavors or endpoints are used anywhere.
Only what HAMi needs is switched on, so nothing competes with it:
| Component | State |
|---|---|
| GPU Operator: driver, container toolkit, CDI, node feature discovery | on |
| GPU Operator: device plugin, GPU feature discovery, MIG manager, DCGM exporter, vGPU/VFIO/Kata/sandbox and confidential-computing components | off |
| HAMi: scheduler, device plugin | on |
| HAMi: handlers for non-NVIDIA devices (Kunlun, Enflame, Moore Threads, VastAI) | off |
CI fails if any other GPU Operator component becomes enabled.
./uninstall.sh # removes HAMi first, then the GPU Operator (order matters)- Remove HAMi before touching the driver. HAMi keeps the GPU's NVML open, so the driver cannot be unloaded
or upgraded while HAMi runs.
driver.upgradePolicy.autoUpgradeisfalseinvalues/gpu-operator.yamlfor this reason. - Consumer GPUs (GeForce, e.g. RTX 2080 Ti): the default open kernel module requires the GSP firmware, and on some
consumer cards the firmware fails to start (
nvidia-smishows "No devices were found"). Datacenter cards (A100, L40S, H100) are expected to work with the defaults (this repository's test did not cover them). For GeForce cards runCONSUMER_GPU=1 ./install.sh: it uses the proprietary kernel module (values/consumer-gpu.yaml) and switches the GSP firmware off (manifests/kernel-module-params-cm.yaml). Ifnvidia-smithen hangs for about two minutes and fails withRmInitAdapter failed (0x25:0x65), the card needs a PCI function-level reset (FLR) from inside the node; that step is manual and not scripted here. - Pods requesting more
gpumemthan one card has stayPendingforever. - No egress on the nodes? The default path needs Internet from the nodes. For air-gapped clusters, mirror the images to a private registry (vCR) and override the image repositories in the values files.
| File | Purpose |
|---|---|
install.sh / verify.sh / uninstall.sh |
Install, check, remove |
lib.sh |
Shared helper (cluster version parsing) |
versions.env |
Pinned chart and image versions |
values/gpu-operator.yaml, values/hami.yaml |
Helm values with the required settings |
ci/ |
Scripts used by CI (values key check, rendered-manifest checks, unit test) |
.github/workflows/ci.yml |
Static checks on push and weekly |
MIT — see LICENSE.