Sunday, 18 August 2013

Hard Resets when Launching a Trivial Kernel

Hard Resets when Launching a Trivial Kernel

I've wasted two days on this. I have code that causes a hard reset when
the kernel is launched. It happens on Windows 7 with GTX 680. When I tried
running it on other computers (Windows 7 with Tesla K20c, and Linux with
GTX 560 Ti) it worked well. My code follows. Note that doing meaningless
things to the code (e.g. removing unused parameters of the device
function) can prevent the hard resets. This is the shortest code I managed
to get that still causes the hard-resets (for example – removing the call
to the empty device function "solves" the hard-resets).
Do you think the problem is with the GTX 680 itself – which is
malfunctioning? (updating the driver didn't help)
__device__ void EmptyDeviceFunction(int x1, int x2, int x3, int x4, int
x5, int x6, int x7, int x8, int x9, float * f1, float * f2)
{
}
__global__ void KernelFunction()
{
for (int i=0; i < 10; i++ )
{
for (int j=0; j<10; j+=1)
{
int t;
for (int k = 0; k < 21; k+=1)
{
for (int s = 0; s < 21; s+=1)
{
t = 0;
while(t<25)
{
EmptyDeviceFunction(t, 25, 1, j, 10, 1, 5, s, k,
0, 0);
t += 1;
}
}
}
}
}
}
//...
// On host:
int numBlocks = 1;
dim3 threadsPerBlock(1, 1, 1);
KernelFunction <<<numBlocks, threadsPerBlock>>>(); //BOOM! hard-reset.

No comments:

Post a Comment