Quantcast
Channel: AMD Developer Forums: Message List
Viewing all articles
Browse latest Browse all 4104

Re: Execution of OpenCL Kernel on more than one GPU

$
0
0

hello maxdz8,

 

thanks for your reply.

I read your message and i know about the blocking nature of this calls. I don't understand why one of the calls should block another host program from enqueueing commands in the queue of the second gpu.

host program nr 1 only handles gpu nr 1 and host program nr 2 handles gpu nr 2.

 

If i reduce my host program to:

 

...

 

/* Create a command queue */

    queue = clCreateCommandQueue(context, device, 0, &err);

 

    if (err < 0) {

   perror("Couldn't create a command queue");
   client_cleanup(EXIT_FAILURE);

    }

 

    /* Create a kernel */

    kernel = clCreateKernel(program, KERNEL_FUNC, &err);

 

    if (err < 0) {

   perror("Couldn't create a kernel");
   client_cleanup(EXIT_FAILURE);

    }

 

    /* Create kernel arguments */

    err = clSetKernelArg(kernel, 0, sizeof(input_buffer), &input_buffer);

    err |= clSetKernelArg(kernel, 1, sizeof(output_buffer), &output_buffer);

 

    if (err < 0) {

   perror("Couldn't create a kernel argument");
   client_cleanup(EXIT_FAILURE);

    }

 

    debug("enqueueing kernel\n");

 

    /* Enqueue kernel */

    err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global_size,

     &local_size, 0, NULL, NULL);

 

    if (err < 0) {

   perror("Couldn't enqueue the kernel");
   client_cleanup(EXIT_FAILURE);

    }

 

    sleep(60);

 

/* Deallocate resources */

    clReleaseKernel(kernel);

    clReleaseMemObject(output_buffer);

    clReleaseMemObject(input_buffer);

    clReleaseCommandQueue(queue);

    clReleaseProgram(program);

    clReleaseContext(context);

 

    client_cleanup(EXIT_SUCCESS);

-----------------------------------------------------------------

Now i should be able to call a clXXX function (for example clGetPlatformIDs()) from host program nr.  2.

But every clXXX-call from host program nr 2. will block until the kernel from host program nr. 1 got finished.

 

At the moment i don't really know where the problem could be.

 

greets


Viewing all articles
Browse latest Browse all 4104

Trending Articles