Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7599305
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T22:37:46+00:00 2026-05-30T22:37:46+00:00

I am using ATI RV770 graphics card, OpenCl 1.0 and ati-stream-sdk-v2.3-lnx64 on linux. While

  • 0

I am using ATI RV770 graphics card, OpenCl 1.0 and ati-stream-sdk-v2.3-lnx64 on linux.

While running my host code which includes following two sections to build kernel program, i am getting error code (-11) i.e. cl_build_program_failure. Does it means that kernel program compiled, if not then how is it compiled and debugged?

const char* KernelPath = "abc_kernel.cl";   //kernel program is in separate file but in same directory of host code..

/* Create Program object from the kernel source *******/

char* sProgramSource = readKernelSource(KernelPath);
size_t sourceSize =  strlen(sProgramSource) ;
program = clCreateProgramWithSource(context, 1,(const char **) &sProgramSource,&sourceSize, &err);
checkStatus("error while creating program",err);

/* Build (compile & Link ) Program *******/

char* options = (char* )malloc(10*sizeof(char));
strcpy(options, "-g");
err = clBuildProgram(program, num_devices, devices_id, options, NULL, NULL);
checkStatus("Build Program Failed", err); //This line throwing the error....

function to read kernel program is as follows::

/* read program source file*/

char* readKernelSource(const char* kernelSourcePath){
 FILE    *fp = NULL;
 size_t  sourceLength;
 char    *sourceString ;
 fp = fopen( kernelSourcePath , "r");
 if(fp == 0)
 {
        printf("failed to open file");
        return NULL;
 }
 // get the length of the source code
 fseek(fp, 0, SEEK_END);
 sourceLength = ftell(fp);
 rewind(fp);
 // allocate a buffer for the source code string and read it in
 sourceString = (char *)malloc( sourceLength + 1);
 if( fread( sourceString, 1, sourceLength, fp) !=sourceLength )
 {
          printf("\n\t Error : Fail to read file ");
          return 0;
 }
 sourceString[sourceLength+1]='\0';
 fclose(fp);
 return sourceString;

}// end of readKernelSource

Can anyone tell how to fix it?

Does it means that it is OpenCl compilation error at runtime or something else?

//Printing build_log info using clGetProgramBuildInfo() as below, But why is is not printing anything?

char* build_log;
size_t log_size;

// First call to know the proper size
        err = clGetProgramBuildInfo(program, devices_id, CL_PROGRAM_BUILD_LOG, 0, NULL, &log_size);
        build_log = (char* )malloc((log_size+1));

        // Second call to get the log
        err = clGetProgramBuildInfo(program, devices_id, CL_PROGRAM_BUILD_LOG, log_size, build_log, NULL);
        build_log[log_size] = '\0';
        printf("--- Build log ---\n ");
        fprintf(stderr, "%s\n", build_log);
        free(build_log);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T22:37:47+00:00Added an answer on May 30, 2026 at 10:37 pm

    This error is typically caused by a syntax error in your kernel code. You can call the OpenCL function clGetProgramBuildInfo with the flag CL_PROGRAM_BUILD_LOG to access the log generated by the compiler. This log contains the output you are probably used to when compiling on the command-line (errors, warnings, etc.).

    For example, you could add something similar to the following after you call clBuildProgram:

    if (err == CL_BUILD_PROGRAM_FAILURE) {
        // Determine the size of the log
        size_t log_size;
        clGetProgramBuildInfo(program, devices_id[0], CL_PROGRAM_BUILD_LOG, 0, NULL, &log_size);
    
        // Allocate memory for the log
        char *log = (char *) malloc(log_size);
    
        // Get the log
        clGetProgramBuildInfo(program, devices_id[0], CL_PROGRAM_BUILD_LOG, log_size, log, NULL);
    
        // Print the log
        printf("%s\n", log);
    }
    

    You can also see the function buildOpenCLProgram() in SDKCommon.cpp in the AMD APP SDK for a real example.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a ATI RV770 graphics card and i am using OpenCL 1.0 AMD-APP-SDK-v2.5
i've been writing some OpenCL code lately on linux (ubuntu 10.4, ati catalyst 10.4
I'm trying to run NVidia's OpenCL demo oclNbody.exe on ATI Radeo 4850 card and
Using preview 4 of ASP.NET MVC Code like: <%= Html.CheckBox( myCheckBox, Click Here, True,
I wish to do calculations with my graphics card as the CPU's etc are
I am trying to implement matrix multiplication usign OpenCL. I have an ATI Radeon
I have written a c++ code (using STL) and due to large computations it
I'm working on playing audio from an audio stream using VC++ with the QtMultimedia
Using online interfaces to a version control system is a nice way to have
Using PyObjC , you can use Python to write Cocoa applications for OS X.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.