total memory returned by cudaMemGetInfo()

Exactly what is the total memory returned by cudaMemGetInfo()? Is it total global memory only, or is constant and/or texture memory included somehow?

For my GTX 480 cards, deviceQuery says the amount of global memory is 1610285056 bytes, while cudaMemGetInfo() says that the amount is 1609760768 bytes, for a difference of 524288 bytes.

To my knowledge, cudaGetMemInfo() gives the available GPU global memory, the difference you see here migt be due some structures initilized during CUDA context creation.

There is no distinct texture or constant memory in the hardware. All are stored in the same generic device memory, but accessed through different cache subsystems.

That said, it does seem a little odd that you get 500 kB difference between the deviceQuery and cudaMemGetInfo(). The CUDA driver uses a lot more memory than 500 kB, which you should see if you compare the free and total values you get from cudaMemGetInfo(). I’m really not sure what this difference could be.

Thanks. Just to be clear, if I want to know the amount of free global memory available for me to allocate with cudaMalloc(), the value returned by cudaMemGetInfo()is that number? And the amount already allocated to constant memory is reflected in that number? Sorry for being dense External Image