cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

vsfan
Journeyman III

Kernel compilation error during runtime

Hi,

I got a kernel which could be compiled using clc offline, and the .ll file is generated.

 

However, if the same kernel is loaded as source file and being complied during runtime, I will get the following error information using clGetProgramBuildInfo(),

 

"Internal error: Link failed.

Make sure the system setup is correct."

 

Which I have no idea on how to debug. Any suggestions or workarounds?

 

All the environment settings should be fine, as I can run all the example code in the StreamSDK2.01. And some other kernels I have written are working pretty well.

 

Thanks!

 

Yours,

Yang

0 Likes
6 Replies

vsfan,
Please us GPU_DUMP_DEVICE_KERNELS=1 and make sure that all function calls have a body defined.
0 Likes

Originally posted by: MicahVillmow vsfan, Please us GPU_DUMP_DEVICE_KERNELS=1 and make sure that all function calls have a body defined.


Thanks for the info. However, where should I put this "macro", in the kernel source file, or in the other source code? And what will be the expected outcome?

 

 

0 Likes

vsfan,
It is an environment variable, it can be set on windows with 'set GPU_DUMP_DEVICE_KERNEL=1' and linux with 'export GPU_DUMP_DEVICE_KERNEL=1'.

As a correct, it is GPU_DUMP_DEVICE_KERNEL, not GPU_DUMP_DEVICE_KERNELS as I mentioned above.
0 Likes

Originally posted by: MicahVillmow vsfan, It is an environment variable, it can be set on windows with 'set GPU_DUMP_DEVICE_KERNEL=1' and linux with 'export GPU_DUMP_DEVICE_KERNEL=1'. As a correct, it is GPU_DUMP_DEVICE_KERNEL, not GPU_DUMP_DEVICE_KERNELS as I mentioned above.


 

I am running on Linux, which is Ubuntu 8.04 LTS 32bit version. And after exporting the environment variable, I found nothing changed when executing the code.

 

The attachment is an overview of my kernel code, hopefully that could be helpful in determining what happened...

 

Thanks!

 

Yours,

Yang

 

 

#pragma OPENCL EXTENSION cl_khr_byte_addressable_store : enable typedef struct { int nposi, nposj; int nmaxpos; float fmaxscore; int noutputlen; } MAX_INFO; __kernel void char2index2(char inch, __local short *result) { if(inch >= 65 && inch <= 73) //'A' --> 'I' { *result = inch - 65; } ... ... else { *result = -1; } return; } __kernel void MatchString(__global char *str_npathflagp, __global char *str_nExtFlagp, __global float *str_fngapdistp, __global float *str_fhgapdistp, __global float *str_fvgapdistp, int nstartpos, int nposi, int nposj, int npreprewidth, int nprewidth, int nthreadnum, __global char *instr1D, __global char *instr2D, __global float * blosum62D, int ntableWidth, float open_penalty, float ext_penalty, __global MAX_INFO *strMaxInfop) { int npos, ntablepos; int npreposngap, npreposhgap, npreposvgap; int indexi, indexj; int tid = get_global_id(0) + get_global_id(1) * get_global_size(0); int PATH_END = 0; float fdist; float fdistngap, fdisthgap, fdistvgap; float ext_dist; ... ... }

0 Likes

never mind, I found the reason now.

 

It was caused by a "printf", which is fine with clc for some reason...

 

And thanks for your help!

0 Likes

yes you can use printf() when you run kernel on CPU device under Linux. on GPU it is invalid.

0 Likes