cudaMalloc problem

Hi,

I’m working on GeForce GTX 460, installed as the second device.
If I allocate memory by cudaMalloc, copy data, make calculations, and frees memory on each iteration, then everything works fine.
But if I allocate device memory once and copy data into it at each iteration, then I get a runtime error.

Are there some restrictions on time to work with allocated memory? Or anything like that?

Hi,

I’m working on GeForce GTX 460, installed as the second device.
If I allocate memory by cudaMalloc, copy data, make calculations, and frees memory on each iteration, then everything works fine.
But if I allocate device memory once and copy data into it at each iteration, then I get a runtime error.

Are there some restrictions on time to work with allocated memory? Or anything like that?

No, it sounds like you have a bug in your code. What you describe should work just fine.

No, it sounds like you have a bug in your code. What you describe should work just fine.