too many resources requested for launch how to find out what resources?

When I am trying to launch a kernel, the cuda error reports: too many resources requested for launch.

Is there a good way to find out what resources are not enough for the kernel?

Thank you,

I guess you’re out of registers or shared memory. To check this take a look on generated .cubin file (add -keep switch to nvcc to see this file). In this file find section corresponding to kernel you’re trying ta launch and there you’ll see smem= and reg=. smem must be less than 16384 and number of registers times your thread block size must be not greater than 8192.

Hope this helps.

This is exactly what I need. Thank you!

I ran out of registers.

What is weird is: I did not ask for any smem, but it lists smem = 40.

And what is bar and bincode as in this .cubin file? bincode seems to be a lot but I don’t know what it is.

smem is used for passing paramenters and for constants such as threadIdx, blockIdx etc. I think smems=40 corresponds to kernel with 4 or 5 paramenters.