Total memory usage of a CUDA read-write texture (assuming we use cudaTextureObject and cudaSurfaceObject)

Hi,

I was wondering how much device memory a CUDA texture actually takes when I use cudaTextureObjects and cudaSurfaceObjects, and couldn’t really find a clear answer so far. Let’s assume I want to allocate a texture on my GPU that I want to read from and write to, so I allocate a cudaArray, and map a cudaTextureObject and cudaSurfaceObject to them. How much extra memory overhead are the textureObject and the surfaceObject causing?

I assume there are several possible sources of overhead, some of it constant, some of it dependent on the texture sizes

  • fixed size overhead of data structures representing texture/surface objects and cuda arrays
  • potential padding of the internal texture array storage size to achieve compatibility with hardware units
  • creation of MMU mapping page tables between logical and physical GPU memory

I’d say experimentation might be the quickest way to find out.

1 Like