Results 1 to 4 of 4

Thread: GL/CL interop on multiple GPUs

  1. #1
    Newbie
    Join Date
    Dec 2013
    Posts
    5

    GL/CL interop on multiple GPUs

    Hi, my question is:
    If i have two gpu of different type (like ati and nvidia) installed on my pc and execute some openGL code in the first gpu and instead, in the second GPU i execute some openCL code, the two gpus can interact with GL/CL interop methods without pass ANY data through the CPU?
    And if this is possible can tell me which is the GL/CL code that do the devices selection where the code will be excuted?

    thanks very much.

  2. #2
    Senior Member
    Join Date
    Dec 2011
    Posts
    124
    In order to interoperate between OpenGL and OpenCL, the OpenCL context must be built from the OpenGL context. If you don't get an error when trying to do this across devices (GL on one, CL on the other), then it should work correctly. However, in most cases you'll get an error and you'll need to have a non-interop fallback case (stand-alone CL context, transfer images through CPU).

  3. #3
    Newbie
    Join Date
    Dec 2013
    Posts
    5
    And for the devices selection where the code will be excuted, how to do that?

    thanks for replying.

  4. #4
    Senior Member
    Join Date
    Dec 2011
    Posts
    124
    In OpenCL you iterate the Platforms, then within each Platform, iterate the Devices that are available. Filter to those that you wish to support (e.g., perhaps GPU only) then select one or more that you create Contexts on (this is where you'd use CL/GL interop if available). Then for a Context + Device you create a Command Queue. Memory transfers and Kernel executions are submitted to a Command Queue, so this is how you select which device your kernels run on.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •