Display driver stops

Hi!

I have a problem whit my “test” code.

My kernel code:

__kernel void test(int num, __global float* temp) {

	int i, j;

	float k;

	int gx = get_global_id(0);

	int gy = get_global_id(1);

	int gs = get_global_size(1);

	for (i = 0; i < num; i++) {

		for (j = 0; j < num; j++) {

			k=(float)i/(float)i;

			temp[gy+gx*gs] *= k;

		}

	}

}

If I run this code whit low “num” (num < 4000), it’s work perfectly. But if the “num” is greater than 4000, my monitor goes to black, and then the driver throws this error message: “Display driver NVIDIA Windows Kernel Mode Driver, Version 260.99 stopped responding and has successfully recovered”

In my program the clEnqueueReadBuffer() function sometimes return CL_OUT_OF_RESOURCES error, sometimes CL_INVALID_COMMAND_QUEUE error.

Could you help me to find the problem?

I use a GS8400 GPU, driver version: 260.99, CUDA toolkit: 3.2.16.

This probably is due to your kernel requiring more than 2 seconds to complete for “num” greater than 4000, which makes the TDR “feature” of Windows Vista and later kick in, see here for details and a work-around by modifying the registry.

Now it’s work. Thank you so much! :)