Limitations on arrays/texture references

Does anyone know if there is a limit on the number of texture references and cuda arrays that a program can use? I’m seeing some odd results in a program that uses tens of texture references, each bound to a different cuda array.

If someone can confirm that no such limit should exist then I’ll post a repro case for people to have a look at.

Yes, there exists a limit on the number of texture references. For my case, 8800 GTX, it is 128.

Is that number documented somewhere, or is it a limit you’ve run into in your own tests? Do you know what the case is for the 8800 GTS?

128 is nominally the DirectX 10 spec. DX10, however, also allows 512-entry texture arrays addressable from the shader. I’m not sure how that fits in, tho. (Possibly, DX10 arrays are just wrappers around 3D textures).

You might be experiencing the same error as I just discovered in my own code.

I have a fairly large number of textures (37 to be accurate) declared at the beginning of my .cu file. They are used in different kernels so I am never using all of them at the same time. Looking at the .cubin file however, I can see that they are referenced as texunit 0-36.

I am wondering if there is a way to get these textures associated to texunit 0 and up for each kernel individually. I will post this question in a separate thread.