Results 1 to 4 of 4

Thread: Sharing the GPU between OpenCL capable programs

  1. #1
    Junior Member
    Join Date
    Aug 2010
    Posts
    2

    Sharing the GPU between OpenCL capable programs

    I'm a beginner so be gentle!

    Is there a method to share the GPU between two separate OpenCL capable programs, or more specifically between two separate processes that simultaneously both require the GPU to execute OpenCL kernels? If so, how is this done?

  2. #2
    Senior Member
    Join Date
    May 2010
    Location
    Toronto, Canada
    Posts
    845

    Re: Sharing the GPU between OpenCL capable programs

    It depends on what do you mean by "share".

    All implementations you are going to find will support multiple host processes using OpenCL simultaneously by time-slicing the GPU. That is, at any given point in time the GPU will be executing the commands from only one of the several host processes and from time to time a different process will be given control over the GPU. This will all be handled automatically by the OpenCL driver.

    However, if by sharing you mean that at a given point in time the GPU is executing commands from multiple different processes then you may not be so lucky. It's going to depend on your hardware vendor. In this case again it will be handled automatically by the driver and there's nothing you can do from the application to enable it if the hardware/driver doesn't support it.
    Disclaimer: Employee of Qualcomm Canada. Any opinions expressed here are personal and do not necessarily reflect the views of my employer. LinkedIn profile.

  3. #3
    Junior Member
    Join Date
    Aug 2010
    Posts
    2

    Re: Sharing the GPU between OpenCL capable programs

    If the driver uses time slicing, does this mean that every time the GPU is allocated a time slot from a different host process, the driver is having to move memory between the host and device, i.e. swap the memory from different processes in and out of the GPU? Would this not be quite inefficient?

  4. #4
    Senior Member
    Join Date
    May 2010
    Location
    Toronto, Canada
    Posts
    845

    Re: Sharing the GPU between OpenCL capable programs

    If the driver uses time slicing, does this mean that every time the GPU is allocated a time slot from a different host process, the driver is having to move memory between the host and device, i.e. swap the memory from different processes in and out of the GPU?
    If the two different processes are using a ton of (GPU) memory, then yes, the context switch can cause this sort of traffic. If the GPU has enough memory for the buffers and images from both processes, then this is avoided.

    Would this not be quite inefficient?
    Yes, it is Do you have a better idea? (I'm not asking in a sarcastic way, but to make you think a bit why we do this).
    Disclaimer: Employee of Qualcomm Canada. Any opinions expressed here are personal and do not necessarily reflect the views of my employer. LinkedIn profile.

Similar Threads

  1. diferent time in openCL programs execution
    By mustang in forum OpenCL
    Replies: 9
    Last Post: 03-02-2012, 06:40 AM

Posting Permissions

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