What causes "Invalid configuration" at kernel launch?

I’ve got a rather complex piece of CUDA code. Most of the time, it works great. Sometimes, I get an “invalid configuration argument” error at kernel launch time. In this particular instance, if I do the task on the CPU and come back around to the GPU again the next time (after doing a bunch of other stuff), it runs without error.

Clearly, there’s some other side effect thing going on causing my problem. Unfortunately, I’ve got very little to work with.

Is there a list somewhere of all the things that cause an “invalid configuration argument” error? I know, for example, that a 3-D grid depth will cause it. Referencing out-of-bounds memory can sometimes cause it. But it would be really helpful if there were a list somewhere, so that I’d have some ideas to work from.

If I had access to the source (and I know we’re not going to get such thing), I’d probably spew breakpoints all over the place, so as to figure out which error check was leading to the message. More detailed error messages (e.g., which function argument caused the problem) would probably be a great thing for you guys to add in a future release. Alas, there is no such thing today.

Help? :-)

–Harold Z.