Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@sbhavani
Copy link

Detect and handle NVIDIA GPUs with unified memory architecture (e.g., GB10) that use system RAM. When nvmlDeviceGetMemoryInfo fails or returns zero memory, fall back to querying system memory via sysinfo() to report total, used, and free memory statistics.

This approach mirrors the existing unified memory handling for Apple M1/M2 GPUs and enables proper memory monitoring for NVIDIA GPUs with unified memory.

Use /proc/meminfo MemAvailable instead of sysinfo freeram to properly
account for reclaimable cache. Now matches free -h output accurately.
@sbhavani
Copy link
Author

Update: uses /proc/meminfo with MemAvailable instead of sysinfo()->freeram to properly account for reclaimable buffers and cache. The previous sysinfo() approach incorrectly counted disk cache as used memory

Query running processes to sum actual GPU memory usage instead of
reporting system-wide memory consumption (MemTotal - MemAvailable).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant