6 Replies Latest reply on Feb 23, 2010 7:07 PM by nou

    Kernel compilation error during runtime

    vsfan

      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

        • Kernel compilation error during runtime
          MicahVillmow
          vsfan,
          Please us GPU_DUMP_DEVICE_KERNELS=1 and make sure that all function calls have a body defined.
            • Kernel compilation error during runtime
              vsfan

               

              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?

               

               

            • Kernel compilation error during runtime
              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.
                • Kernel compilation error during runtime
                  vsfan

                   

                  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; ... ... }