Invalid Kernel Image

Hi Im using 9800GT on windows platform. Following is my code.

int main(int argc, char *argv[]) { 

        // Pre-Calculation

        readData();

        convertor(); //convert values into single float

        calc_resample_coefficients();

//Cuda Memory Allocation

        // Explicitly set device 

glutInit(&argc, argv);

        glewInit();

cudaGLSetGLDevice(2);

CUcontext *pCtx = NULL;

cuInit(0);

        cuCtxCreate(pCtx, CU_CTX_MAP_HOST, 0);

        cuGLInit();

        cuGLCtxCreate(pCtx, CU_CTX_MAP_HOST, 0);        

int frame = 0, sum =0;

cudaMalloc((void**)&dev_frame, sizeof(int));

        cudaMalloc((void**)&dev_sum, sizeof(int));

        cudaMalloc((void**)&dev_original, sizeof(float)*FRAMES*XDIM*YDIM);

        cudaMalloc((void**)&d_in,sizeof(cuComplex)*YDIM*XDIM);

        cudaMalloc((void**)&dev_resamp, sizeof(float)*LINE_LENGTH*2);

        cudaMalloc((void**)&dev_k_resampledspacing, sizeof(float));

        cudaMalloc((void**)&dc_subtracted, sizeof(float)*XDIM*YDIM);

cudaMemcpy(dev_k_resampledspacing, &k_resampledspacing, sizeof(float), cudaMemcpyHostToDevice);

        cudaMemcpy(dev_resamp, resamp_1D, sizeof(float)*LINE_LENGTH*2, cudaMemcpyHostToDevice);

        cudaMemcpy(dev_original, original_cpu, sizeof(float)*FRAMES*XDIM*YDIM, cudaMemcpyHostToDevice);

        cudaMemcpy(dev_frame, &frame, sizeof(int), cudaMemcpyHostToDevice);

        cudaMemcpy(dev_sum, &sum, sizeof(int), cudaMemcpyHostToDevice);

glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE);

    glutInitWindowSize(window_width, window_height);

    glutCreateWindow("Cuda GL Interop (VBO)");

        glutDisplayFunc(display);

        // Create buffer object and register it with CUDA 

        createVBO(&pbo, &cuda_pbo_resource);

// Loop 

        glutMainLoop(); 

deleteVBO();

cudaThreadExit();

}

If I run the code I get device kernel image is invalid. Does this mean I have problem with my GPU? Can someone guide me how to solve this if had similar problem? Thank you.

Regards,

Jaehong Yoon

Something that I did not mention above is that Im using the latest version of driver and when I run the code without debugging, the screen says

I have at CUT_CHECK_ERROR(cudaGraphicsGLRegisterBuffer(cuda_pixel_resource, *pixel_buffer, cudaGraphicsMapFlagsWriteDiscard)); of the following code.

void createVBO(GLuint* pixel_buffer, struct cudaGraphicsResource **cuda_pixel_resource)

{

	if(pixel_buffer){

	// create buffer object

	glGenBuffers(1, pixel_buffer);

	glBindBuffer(GL_ARRAY_BUFFER, *pixel_buffer);

	//register buffer on cuda

	unsigned int size = XDIM * YDIM * 4 * sizeof(float); 

	glBufferData(GL_ARRAY_BUFFER, size, 0, GL_DYNAMIC_DRAW); 

	glBindBuffer(GL_ARRAY_BUFFER, 0); 

	CUT_CHECK_ERROR(cudaGraphicsGLRegisterBuffer(cuda_pixel_resource, *pixel_buffer, cudaGraphicsMapFlagsWriteDiscard));

	}

	else{

	cutilSafeCall( cudaMalloc( (void **)&d_vbo_buffer, XDIM*YDIM*4*sizeof(float) ) );

	}

}

which makes my device kernel image invalid… Did anyone have the same problem? Did anyone solve it? Thank you.