Skip to content

Instantly share code, notes, and snippets.

@gmarkall
Created February 24, 2015 14:35
Show Gist options
  • Save gmarkall/c77bd04300cb733ada54 to your computer and use it in GitHub Desktop.
Save gmarkall/c77bd04300cb733ada54 to your computer and use it in GitHub Desktop.
Get memory info for all GPUs in Numba
from numba import cuda
gpus = cuda.gpus.lst
for gpu in gpus:
with gpu:
meminfo = cuda.current_context().get_memory_info()
print("%s, free: %s bytes, total, %s bytes" % (gpu, meminfo[0], meminfo[1]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment