Querying the amount of memory left on device

I need to query how much memory is left on the device. The appropriate function seems to be cuMemGetInfo, which also seems to require an include <cuda.h>. I’ve seen elsewhere that I need to link a specific lib to access the driver API.

What is the name of the lib under linux and where should that link be specified in the Makefile?

Thanks in advance…

libcuda.so is the library for the driver API, so you’d need to link -lcuda. If you’re compiling with nvcc, I don’t think you have to do this (links it automatically).

libcuda.so is the library for the driver API, so you’d need to link -lcuda. If you’re compiling with nvcc, I don’t think you have to do this (links it automatically).