CPU Spin Lock and Log Flooding on NVML Event Error - #2322
Conversation
Signed-off-by: aniket866 <iamaniketkumarmaner@gmail.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: aniket866 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe NVML health check now returns non-timeout event-wait errors after marking all devices unhealthy. It no longer retries the wait loop for these errors. ChangesNVML health monitoring
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
Suggested labels: Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
explained in #2321 |
Closes #2321
Location:
pkg/device-plugin/nvidiadevice/nvinternal/rm/checkHealth)Code:
Explanation:
checkHealthuses NVML events to watch for hardware errors (XIDs). It listens for event notifications by callingeventSet.Wait(5000)inside a loop.Reason for Crash:
If
eventSet.Wait()fails with a persistent error (for instance, if the NVML context becomes corrupted or the GPU driver encounters a critical error), it returns a non-SUCCESS code immediately without blocking. The loop captures this, writes a log, sends all devices to theunhealthychannel, and executes acontinue. Because the error is persistent, the loop immediately checks again, creating a tight CPU spin lock consuming 100% of a CPU core and flooding logs/channels, locking up or crashing the device plugin.Spin Lock Loop:
graph TD A[eventSet.Wait fails immediately] --> B[Log error] B --> C[Send unhealthy notification] C --> D[continue loop] D --> A Note over A,D: Loops with zero sleep delay:<br/>100% CPU usage & log spam!Summary by CodeRabbit