Results 1 to 8 of 8

Thread: program hangs on clBuildProgram with an empty kernel or takes > 1 hour

Hybrid View

  1. #1
    Junior Member
    Join Date
    Mar 2012

    program hangs on clBuildProgram with an empty kernel or takes > 1 hour

    My program hangs on a clBuildProgram call, with no specific parameters, and with an empty kernel. My program is successfully created but not built!
    It happens on a Tesla S1070...

    Sometimes, it takes more than 1hour to succeed in the build......
    NVIDIA driver version : 304.54

    Any Idea?

  2. #2
    Junior Member
    Join Date
    Mar 2012
    Please, HELP!

  3. #3
    Administrator khronos's Avatar
    Join Date
    Jun 2002

    Your question is vague, and contains now code or examples for anyone to be able to help you. Please heed my suggestions from email and read the forum posting guidelines and add complete information about your issue with specific details, code etc.


  4. #4
    Junior Member
    Join Date
    Mar 2012
    Sorry, here is a piece of code hanging on clBuildProgram call...

    #include <stdio.h>
    #include <string.h>
    #include <CL/cl.h>

    int main(void) {

    char *source_str = "__kernel void emptyKernel() {}";
    size_t source_size = strlen(source_str);

    // Get platform and device information
    cl_platform_id platform_id = NULL;
    cl_device_id device_id = NULL;
    clGetPlatformIDs(1, &platform_id, NULL);
    clGetDeviceIDs( platform_id, CL_DEVICE_TYPE_DEFAULT, 1, &device_id, NULL);

    // print device name
    size_t valueSize;
    clGetDeviceInfo(device_id, CL_DEVICE_NAME, 0, NULL, &valueSize);
    char* value = (char*) malloc(valueSize);
    clGetDeviceInfo(device_id, CL_DEVICE_NAME, valueSize, value, NULL);
    printf("Device: %s\n", value);

    // Create an OpenCL context
    cl_context context = clCreateContext( NULL, 1, &device_id, NULL, NULL, NULL);

    // Create a program from the kernel source
    cl_int ciErr;
    cl_program program = clCreateProgramWithSource(context, 1,(const char **)&source_str, (const size_t *)&source_size, &ciErr);
    if (ciErr != CL_SUCCESS)
    printf("clCreateProgramWithSource failed");
    return 1;

    // Build the program
    clBuildProgram(program, 1, &device_id, NULL, NULL, NULL);
    printf("AFTER\n");// Randomly appears

    // Clean up

    return 0;

  5. #5
    If it helps, I don't think there is anything wrong with your program. I ran it on a GeForce 480 GTX and it runs in about a second. So it seems more likely to be some sort of system problem. Since it's a Tesla I assume this might be in a cluster rather than a PC - is it possible that another user is using the card and thus preventing your program from accessing it?

  6. #6
    Junior Member
    Join Date
    Mar 2012
    Hi !
    It cannot be possible.. There are no conflict when accessing the Tesla..
    I traced system calls :

    open("/home/mbenguigui/.nv/ComputeCache/index", O_RDWR) = 19
    fcntl(19, F_SETLK, {type=F_WRLCK, whence=SEEK_SET, start=0, len=0}

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Proudly hosted by Digital Ocean