Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有一种方法可以让我获得 cuda 上下文内存使用情况,而不必使用仅报告设备全局信息的 cudaMemGetInfo?或者至少是一种获取当前应用程序占用多少内存的方法?
这似乎是不可能的[No]。但是,检索每个进程的内存使用情况仍然是一个不错的选择。正如罗伯特指出的那样,可以使用NVML检索每个进程的内存使用情况,特别是通过使用nvmlDeviceGetComputeRunningProcesses函数。
nvmlDeviceGetComputeRunningProcesses