1

Anyone know how to determine free/available global memory on a GPU, similar to the CUDA "cudaMemGetInfo(&free_byte, &total_byte);?.

I've searched the Alea website for the API trying to locate a property to determine free bytes, but nothing seems to fit the bill.

Thanks.

Dinu Kuruppu
  • 165
  • 1
  • 15
ebergerly
  • 19
  • 6

1 Answers1

1

I am not aware of a high level API for that. But you can use low level CUDA interop this way :

private unsafe void ShowMem()
{
    IntPtr free;
    IntPtr total;
    Alea.CUDAInterop.cuSafeCall(Alea.CUDAInterop.cuMemGetInfo(&free, &total));
    Console.Out.WriteLine($"free={free} - total={total}");
}
Samy
  • 11
  • 3