Bug Description
nvtop crashes with an assertion failure on AMD GPUs:
nvtop: ./src/extract_gpuinfo_amdgpu.c:964: parse_drm_fdinfo_amd:
Assertion `!cache_entry_check && "We should not be processing a client id twice per update"' failed.
Aborted (core dumped)
Environment
- OS: Ubuntu 24.04 (Linux 6.14.0-37-generic)
- GPU: AMD
- nvtop version: latest from git
Root Cause
The assertion fails when a process has multiple file descriptors referencing the same DRM client (e.g., via dup(), fork(), or DRM master operations). The kcmp syscall filters duplicate file descriptions but not distinct file descriptions that report the same underlying DRM client_id.
Fix
PR #434 converts the debug assertion into a runtime check that gracefully handles duplicates.