unspecified launch failure

Hi

I have a problem with my code.

When I use CUDA version 1.1, no error occured.

But now I am using v.2.0, an error occured.

Somtimes no error eccured in v.2.0.

The error message is " CUDA error in file ‘xxx. cu’ in line 261 ~~~ : unspecified launch failure"

I don’t know what part in my source code is wrong.

please help me…

My source code is the following.

in “xxx. cu” file

RefineUncoveredArea<<< dimGrid, dimBlock, 0 >>> (m_pVirtualView[i].m_pImage, m_pVirtualView[i].m_pDisparityMap,m_xWidth,m_yHeight,xWidthStep);

CUDA_SAFE_CALL( cudaThreadSynchronize() ); // line 261 : here is error occured

in “xxx_kernel.cu” file

__global__ void

RefineUncoveredArea(unsigned char* d_pImageArray, unsigned char* d_depth, int xWidth, int yHeight, int xWidthStep)

{

	unsigned int iX = blockIdx.x * blockDim.x + threadIdx.x;

	unsigned int iY = blockIdx.y * blockDim.y + threadIdx.y;

	unsigned char disparity, disparityUp, disparityDown, disparityRight, disparityLeft;

	

	if(1 <= iX && xWidth-1 > iX && 1 <= iY && yHeight-1 > iY)

	{

	

 Â disparity = ((unsigned char*) d_depth)[iY*xWidth + iX];

 Â 

 Â if(0 != disparity)

 Â {

 �  disparityUp = ((unsigned char*) d_depth)[(iY-1)*xWidth + iX];

 �  if(0 != disparityUp)

 �   return;

 �  disparityDown = ((unsigned char*) d_depth)[(iY+1)*xWidth + iX];

 �  if(0 != disparityDown)

 �   return;

 �  disparityLeft = ((unsigned char*) d_depth)[iY*xWidth + iX-1];

 �  if(0 != disparityLeft)

 �   return;

 �  disparityRight = ((unsigned char*) d_depth)[iY*xWidth + iX+1];

 �  if(0 != disparityRight)

 �   return;

 �  

 �  d_pImageArray[iY*xWidthStep + 3*iX   Â  Â ] = 0;

 �  d_pImageArray[iY*xWidthStep + 3*iX + 1] = 0;

 �  d_pImageArray[iY*xWidthStep + 3*iX + 2] = 0;

 �  d_depth[iY*xWidth + iX] = 0;

�  }

 Â }

 Â 

	}

}

Thanks in advance.

Compile using --deviceemu, run valgrind on the result. Nine times out of ten, unspecified launch error is really a segmentation fault in your kernel. Look for illegal reads or writes in the valgrind log–it should give you a pretty good idea of where to start.