Get GPU memory usage progamatically

cudaMemGetInfo (documented here) requires nothing other than the cuda runtime API to get free memory and total memory on the current device.


Check out the function nvmlDeviceGetMemoryInfo in NVIDIA Management Libraryhttps://developer.nvidia.com/nvidia-management-library-nvml:

"Retrieves the amount of used, free and total memory available on the device, in bytes."

Don't know if AMD has something equivalent.


D3DKMTQueryStatistics is what you need.


猜你喜欢

转载自blog.csdn.net/chao56789/article/details/77898115