driver crash when using atomicAcc on changed size array

Hello,

I think i might have found a bug in cuda or current drivers, while working on a cuda app that convolves medical data to images.
I’m coding on win XP 32 bit with a Geforce GTX260b (core 216), at factory clocks.

I create a 2D GL buffer of 32bit integers:

glGenBuffers(1, bufi);
glBindBuffer(GL_ARRAY_BUFFER, *bufi);
glBufferData(GL_ARRAY_BUFFER, bufi_size, data, GL_DYNAMIC_DRAW);
glBindBuffer(GL_ARRAY_BUFFER, 0);
Cuda_RegisterPBO(*bufi);

CUDA_SAFE_CALL(cudaGLRegisterBufferObject(bufi));

When i run my cuda kernel and write the result of a thread to it, everything works fine.
I need to add the results with a gaussian filter (so adding to neighbouring pixels),
so i changed my kernel to add with AtomicAdd().

this works ok, but since changing my code to use AtomicAdd(),
when i delete the buffer, and recreate it with a different size (user changes resolution of image generated),
which all happens when the cuda kernel is not running (and everything is done within the same thread),
i get a crash.

This means: when in visual studio debugging mode, there’s a %50 change of getting a cuda error at xxxxxxxx returned,
and the other 50% is a complete display driver crash. (eg freeze, garbage on your screen, a beep from the motherboard and a reboot)
When not running in debugging mode it always crashes like this.

This code was running fine and never had this behaviour before when resizing I changed the ‘buffer[yw + x] += value’ to 'AtomicAdd(&buffer[yw + x], value)’ in my kernel.
It seems that once you have used atomic add on an array, change delete and create a new array, then launch the kernel again and use atomicadd again, this crash occurs.

When i remove the atomicadds and change back to the old system it works fine.

It’s not a hardware issue neither as the same behaviour happens on 3-4 other machines with different OS’es (vista and windows 7, some 64bit machines too) and different GPU’s (mostly GTX2 series and one 9000 series).
All machines are using current driver NVIDIA Driver 190.38 for Windows XP 32-bit with CUDA Support from the cuda download site.

Help much appreciated, i’m on a tight deadline and i’m completely stuck now…

Thanks you,
sando