HAMi on NVIDIA GPU
Use this scenario when NVIDIA workloads need HAMi scheduling, whole-GPU allocation, memory or compute sharing, or HAMi-managed dynamic MIG. For direct NVIDIA GPU allocation without HAMi, use the NVIDIA GPU documentation instead.
Before you create a workload
Confirm that:
Alauda Build of HAMiis installed with Enable NVIDIA enabled;- the target node is selected by the HAMi NVIDIA node label, commonly
gpu=on; - HAMi is the only Device Plugin owner for the physical GPUs in that node pool;
- the node reports the HAMi NVIDIA resource keys delivered by the installed package.
Run the following checks:
The target node must report nvidia.com/gpualloc and the optional memory or compute keys required by the workload. If the same node also exposes direct-allocation resources from another NVIDIA Device Plugin, resolve the Device Plugin ownership conflict before continuing.
Understand the resource request
The example below uses nvidia.com/gpualloc, nvidia.com/gpucores, and nvidia.com/gpumem. See Resource Keys for their meanings, units, and the alternative percentage-based memory key. Do not use the absolute and percentage-based memory keys in the same container.
Run a shared-GPU workload
The following Pod manifest requests one physical GPU as the allocation base, 4096 MiB of GPU memory, and 50 percent of its compute capacity. Replace the image with a CUDA image that contains nvidia-smi and your test application.
Create and inspect the Pod:
Interpret the results as follows:
scheduler=hami-schedulerconfirms that the workload used the HAMi scheduler.- A non-empty
hami.io/vgpu-devices-allocatedannotation confirms that HAMi assigned a physical GPU and sharing quota to the container. CUDA_DEVICE_MEMORY_LIMIT_0=4096m,CUDA_DEVICE_SM_LIMIT=50, and thelibvgpu.sopreload entry confirm that the HAMi-Core sharing runtime was injected.nvidia-smiconfirms basic device visibility, but it does not prove enforcement by itself. Run a CUDA memory-allocation or compute workload for end-to-end quota verification.
If only nvidia.com/gpualloc is requested, HAMi allocates a whole GPU through the same HAMi-managed path. For HAMi-managed dynamic MIG, continue with Configure Dynamic MIG.