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.
任何人都知道如何确定free/availableGPU 上的全局内存,类似于CUDA "cudaMemGetInfo(&free_byte, &total_byte);?.
free/available
CUDA "cudaMemGetInfo(&free_byte, &total_byte);?
我在Alea网站上搜索了 API,试图找到一个属性来确定空闲字节,但似乎没有任何东西符合要求。
Alea
谢谢。
我不知道有一个高级 API。但是您可以通过这种方式使用低级 CUDA 互操作:
private unsafe void ShowMem() { IntPtr free; IntPtr total; Alea.CUDAInterop.cuSafeCall(Alea.CUDAInterop.cuMemGetInfo(&free, &total)); Console.Out.WriteLine($"free={free} - total={total}"); }