driver crash (bitonic sorting algorithm)

hello

i was adjusting the bitonic sort example from the cuda SDK to be able to process more items than 512. This works fine for arrays smaller than 32768 items but when i want to sort an array of 32768 items after like 5sec my screen goes black and windows vista restarts the driver :blink: .

Sorting 16384 items only takes about 6ms so it would surprise me if sorting 32768 items takes longer than 5sec.

so i’m wondering:

-is it normal that your screen goes black when your kernel takes long time to execute or does that mean a bug in code? I have a geforce 8600M GS (laptop)

-is there a way to make the time for resetting the device driver in windows vista longer?

my code:

#ifndef _BITONIC_KERNEL_H_

#define _BITONIC_KERNEL_H_

#define NUM	32768

__global__ static void bitonicSort(int * values)

{

	unsigned int tid = threadIdx.x;

	unsigned int inc = blockDim.x;

	int a;

	int b;

	

	// Parallel bitonic sort.

	for (unsigned int k = 2; k <= NUM; k *= 2)

	{

		// Bitonic merge:

		for (unsigned int j = k / 2; j>0; j /= 2) 

		{

			tid = threadIdx.x;

			while(tid < NUM){

				unsigned int ixj = tid ^ j; //address we need

				if (ixj > tid)  //no double swaps

				{

					a =values[tid];

					b =values[ixj];

					if ((tid & k) ==0) //check if we need asc/desc

					{

						if ( a > b)

						{

							values[tid]=b; //swap items

							values[ixj]=a;

						}

					}else{

						if (a < b)

						{

							values[tid]=b; //swap items

							values[ixj]=a;

						}

					}

				}

				tid +=inc;

			}

			__syncthreads();

		}	

	}	

}

#endif // _BITONIC_KERNEL_H_

kernel call:

bitonicSort<<<1, 512>>>(dvalues);

also get this error:

First-chance exception at 0x764b42eb in bitonic.exe: Microsoft C++ exception: cudaError_enum at memory location 0x0010fc54…

Thanks

Tom

This is the expected 5 second watchdog timeout that Vista enforces at the OS level. Its discussed in detail in the CUDA release notes.