I allocate cudaArray, bind texture.
The first time step is ok, I read the right texture values in the kernel.
But after the first time step, all the texture values become NaN.
Do you have an idea what can destroy my memory?
I don’t do any cudaMalloc/cudaMemcpy/cudaUnbindTexture/cudaFreeArray/cudaFree after the first time step.
I found that changing the grid size can make it working.
What is strange it’s if I call my kernel in a very small test application, it works well for any grid size. But in my big application, only selected grid size works.
I found that changing the grid size can make it working.
What is strange it’s if I call my kernel in a very small test application, it works well for any grid size. But in my big application, only selected grid size works.
My hunch is that your kernel is having out of bound access (bad pointers) which somehow overwrite the texture memory area… (the texture memory still resides in global memory only except that CUDA does not expose the memory area… so, if ur pointer is bad – you can actually corrupt your texture…)
My hunch is that your kernel is having out of bound access (bad pointers) which somehow overwrite the texture memory area… (the texture memory still resides in global memory only except that CUDA does not expose the memory area… so, if ur pointer is bad – you can actually corrupt your texture…)
Sarnath, I think about it, but now I am testing with a kernel that does nothing, just taking the first value of a texture, and cuPrintf it.
So if my memory is corrupted, it is not by my kernel!
Sarnath, I think about it, but now I am testing with a kernel that does nothing, just taking the first value of a texture, and cuPrintf it.
So if my memory is corrupted, it is not by my kernel!
There are finite limits on the maximum memory size and dimensions of textures that CUDA supports. Are you sure your “big” case isn’t exceeding the texture size limits? They are described in appendix G of the CUDA 3.0 programming guide.
There are finite limits on the maximum memory size and dimensions of textures that CUDA supports. Are you sure your “big” case isn’t exceeding the texture size limits? They are described in appendix G of the CUDA 3.0 programming guide.