How to debug cudaArray Debug technique. Need help

My program run correctly with one GPU, however the same code give wrong result with one thread with dual GPUs (the other is still correct) , when i try to debug and it turn out some problem related to cudaArray and texture. In that operation I copy device memory to cudaArray that attached to a texture. I use that texture to perform bilinear interpolation.

I don’t know the problem from the cudaMemcpyToArray funtion, or my bilinear interpolation using texture, because i don’t know how to debug the contain of cudaArray and texture.

My question are :

  • How can i debug the contain of cudaArray and texture
  • How can I know the current device of the array and texture, to make sure that each one is generated per device context.

Can any one help help me. Thank you.