3D texture maximum dimensions

I have an application that tries to create a 3D texture that is large in X and Z but small in Y.

I recently discovered that my call to cudaMalloc3DArray() fails on the GT 440 (which is a compute capability 2.1 card). Previously I have been using a GTX TITAN X (which is a compute capability 5.2 card).

So I checked the documentation (http://docs.nvidia.com/cuda/cuda-c-programming-guide/#features-and-technical-specifications).

This seems to say that for the GT 440 there is a limit of 2048 x 2048 x 2048 for textures or 65536 x 32768 x 2048 for surfaces. Presumably, since the cudaMalloc3DArray() would be common to textures and surfaces it is the larger limit that would apply. But I am exceeding 2048 in depth so it makes sense that it would fail.

My real question is about the GTX TITAN X. This should have a limit of 4096 x 4096 x 4096 for textures and 65536 x 32768 x 2048 for surfaces. But I have just tested it and the call succeeds for a size of 2000 x 20 x 12541. A subsequent call to cudaBindTextureToArray() also succeeds and indeed my program appears to work as intended.

I have been alternating between CUDA 2.3 and 7.0 and the behaviour appears to be the same in both although I note that the documentation for cudaMalloc3DArray() seems to have changed somewhat.

In the 2.3 documentation it specifically says “For 3D arrays valid extent ranges are {(1, 2048), (1, 2048), (1, 2048)}.”

In the 7.5 documentation it says “{ (1,maxTexture3D[0]), (1,maxTexture3D[1]), (1,maxTexture3D[2]) } OR { (1,maxTexture3DAlt[0]), (1,maxTexture3DAlt[1]), (1,maxTexture3DAlt[2]) }”

I guess I can query maxTexture3D and maxTexture3DAlt on my GTX TITAN X but I’m wondering if these limits are documented for different devices anywhere and if anyone can provide any further insight into what is going on?

Edit: So maxTexture3D and maxTexture3DAlt sadly don’t exist in cudaDeviceProp in 2.3 but in 7.0 for the GTX TITAN X maxTexture3D is (4096, 4096, 4096) and maxTexture3DAlt is (2048, 2048, 16384). I guess that’s why it works. This maxTexture3DAlt extent doesn’t seem to correspond to any documented values that I’ve been able to find so far.