Bug Report: vgpu-monitor fails to parse cache file in v2.8.1 - "not valid UTF-8"
Environment
- HAMi Version: v2.8.1
- Kubernetes Version: v1.34.6
- GPU Model: NVIDIA GeForce RTX 2080 Ti
- OS: Ubuntu (Linux/amd64)
Description
After upgrading to v2.8.1, vgpu-monitor fails to collect per-pod GPU metrics with the following error:
E0428 metrics.go:407] Failed to send memoryTotal metric for device 0 in Pod work-1234/pod-dir-test, Container gpu-test: failed to create metric: label value "\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00GPU-609c" is not valid UTF-8
E0428 metrics.go:358] Failed to collect metrics for container gpu-test in Pod work-1234/pod-dir-test: failed to create metric: label value "\x80\x00...GPU-609c" is not valid UTF-8
Root Cause (suspected)
The cache file written by libvgpu.so (HAMi-core) in /usr/local/vgpu/containers/<uuid>_<container>/ contains binary data (struct) followed by the GPU UUID string. The vgpu-monitor in v2.8.1 appears to read the entire binary content as a UTF-8 label value, causing the parse failure.
This worked correctly in v2.8.0.
Steps to Reproduce
- Install HAMi v2.8.1
- Create a pod requesting
nvidia.com/gpu: 1 with nvidia.com/gpumem and nvidia.com/gpucores
- Run any CUDA workload inside the pod (e.g.
torch.randn(1000,1000).cuda())
- Check vgpu-monitor logs:
kubectl logs -n kube-system <hami-device-plugin-pod> -c vgpu-monitor
Expected Behavior
Per-pod GPU metrics should be collected and exposed:
vGPU_device_memory_limit_in_bytes{podname="...", ...}
vGPU_device_memory_usage_in_bytes{podname="...", ...}
Device_utilization_desc_of_container{podname="...", ...}
Actual Behavior
- vgpu-monitor logs show
not valid UTF-8 errors
- Per-pod metrics are completely missing from
/metrics endpoint
- Only host-level metrics (
HostCoreUtilization, HostGPUMemoryUsage) are exposed
Workaround
Downgrade to v2.8.0:
helm upgrade hami hami-charts/hami -n kube-system \
--reuse-values \
--set global.imageTag=v2.8.0
This restores correct per-pod metrics collection.
Additional Notes
- v2.8.1 release note only mentions a vLLM fix, so this regression may be unintentional
- The issue is in the interaction between
libvgpu.so cache file format and vgpu-monitor parsing logic
Bug Report: vgpu-monitor fails to parse cache file in v2.8.1 - "not valid UTF-8"
Environment
Description
After upgrading to v2.8.1, vgpu-monitor fails to collect per-pod GPU metrics with the following error:
Root Cause (suspected)
The cache file written by
libvgpu.so(HAMi-core) in/usr/local/vgpu/containers/<uuid>_<container>/contains binary data (struct) followed by the GPU UUID string. Thevgpu-monitorin v2.8.1 appears to read the entire binary content as a UTF-8 label value, causing the parse failure.This worked correctly in v2.8.0.
Steps to Reproduce
nvidia.com/gpu: 1withnvidia.com/gpumemandnvidia.com/gpucorestorch.randn(1000,1000).cuda())kubectl logs -n kube-system <hami-device-plugin-pod> -c vgpu-monitorExpected Behavior
Per-pod GPU metrics should be collected and exposed:
Actual Behavior
not valid UTF-8errors/metricsendpointHostCoreUtilization,HostGPUMemoryUsage) are exposedWorkaround
Downgrade to v2.8.0:
This restores correct per-pod metrics collection.
Additional Notes
libvgpu.socache file format andvgpu-monitorparsing logic