HAMi: GPU Device Allocation Error: "unknown device" when using HAMi vGPU
Environment
- HAMi Version: v2.5.1
- Kubernetes Version: 1.31
- GPU Driver Version: NVIDIA-SMI 535.183.06 Driver Version: 535.183.06 CUDA Version: 12.2
- Container Runtime: containerd with nvidia runtime
- GPU Model: 4090
- Node OS: [Please specify OS version]
Problem Description
Pod fails to start with CrashLoopBackOff status when using HAMi vGPU resource allocation. The nvidia-container-cli reports “unknown device” error for the GPU UUID allocated by HAMi.
Error Message
nvidia-container-cli: device error: GPU-2409b7b6-2df6-0343-90dd-2d73da18e0e8: unknown device: unknown
Pod Configuration
Resource Requests:
resources:
limits:
nvidia.com/gpu: "1"
nvidia.com/gpumem: "4096"
requests:
nvidia.com/gpu: "1"
nvidia.com/gpumem: "4096"
HAMi Annotations:
annotations:
hami.io/bind-phase: success
hami.io/bind-time: "1749138883"
hami.io/vgpu-devices-allocated: GPU-2409b7b6-2df6-0343-90dd-2d73da18e0e8,NVIDIA:;
hami.io/vgpu-devices-to-allocate: ;
hami.io/vgpu-node: bare-xxxx-10-28-8-114
hami.io/vgpu-time: "1749139149"
Steps to Reproduce
- Deploy a Pod with HAMi vGPU resource requests (
nvidia.com/gpu: "1",nvidia.com/gpumem: "4096") - HAMi scheduler successfully allocates GPU device with UUID
GPU-2409b7b6-2df6-0343-90dd-2d73da18e0e8 - Pod binding phase shows
successin annotations - Container runtime attempts to start the container
- nvidia-container-cli fails to recognize the allocated GPU device UUID
Expected Behavior
- Pod should start successfully with the allocated vGPU device
- Container should have access to the specified GPU memory (4096MB)
- No “unknown device” errors should occur
Actual Behavior
- Pod enters
CrashLoopBackOffstate - Container fails to start due to GPU device recognition failure
- Error indicates the GPU UUID allocated by HAMi is not recognized by nvidia-container-cli
Additional Information
Pod Status:
containerStatuses:
- lastState:
terminated:
exitCode: 128
reason: StartError
message: |-
failed to create containerd task: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error running hook #0: error running hook: exit status 1, stdout: , stderr: Auto-detected mode as 'legacy'
nvidia-container-cli: device error: GPU-2409b7b6-2df6-0343-90dd-2d73da18e0e8: unknown device: unknown
Node Information:
- Scheduled Node:
bare-xxxx-10-28-117 - HAMi vGPU Node:
bare-xxxx-10-28-8-114
Possible Root Cause Analysis
- UUID Mismatch: The GPU UUID generated/used by HAMi doesn’t match the actual GPU device UUID recognized by the NVIDIA driver
- Device Plugin Communication: Potential issue in communication between HAMi device plugin and nvidia-container-runtime
- GPU Device State: The allocated GPU device might not be in the expected state or properly exposed to the container runtime
- Node Mismatch: Notice that the scheduled node and HAMi vGPU node are different, which might indicate a scheduling inconsistency
Debug Information Needed
To help diagnose this issue, please provide:
- Output of
nvidia-smi -Lon the target node - HAMi device plugin logs from the affected node
- HAMi scheduler logs during the pod scheduling
- Output of
kubectl describe node <node-name>for the affected node - HAMi configuration (ConfigMap/DaemonSet configuration)
Workaround
Currently no known workaround. The issue prevents successful pod startup when using HAMi vGPU allocation.
Labels: bug, vgpu, device-allocation, nvidia, container-runtime
About this issue
- Original URL
- State: open
- Created a year ago
- Reactions: 2
- Comments: 15 (10 by maintainers)
yes, the UUID in the annotations must be the one mounted into container, otherwise, error is occurred. and it seems your cause is different from the issue owner
Let me re - frame the question
This is declared in the Pod’s annotation
hami.io/vgpu-devices-allocated: GPU-2409b7b6-2df6-0343-90dd-2d73da18e0e8,NVIDIA,4096,0:; hami.io/vgpu-node: bare-xxx-10-28-8-114
But the actual final scheduling node is nodeName: bare-xxxx-10-28-8-117
From the scheduling log of the cluster, at the beginning, this Pod was bound to this node by hami. Successfully filtered to following nodes: [bare-xxx-10-28-8-114] for dev/aaa-bbb-68d778dd6f-tfcrs
I understand that at this time hami.io/vgpu-devices-allocated : GPU-2409b7b6-2df6-0343-90dd-2d73da18e0e8, NVIDIA, 4096, 0:; has been hit on the Pod annotation
The device IP of GPU-2409b7b6-2df6-0343-90dd-2d73da18e0e8 is actually on the machine bare-xxx-10-28-8-114
But the node finally scheduled to is bare-xxxx-10-28-8-117. When starting this Pod on the bare-xxxx-10-28-8-117 node, the GPU deviceID GPU-2409b7b6-2df6-0343-90dd-2d73da18e0e8 on the machine bare-xxx-10-28-8-114 is still used
The Pod fails to start
Error: failed to create containerd task: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error running hook #0: error running hook: exit status 1, stdout: , stderr: Auto-detected mode as ‘legacy’ nvidia-container-cli: device error: GPU-2409b7b6-2df6-0343-90dd-2d73da18e0e8: unknown device: unknown