Search code examples
macosopenclgpureal-time

two programs using gpu acceleration


very noob question here. I want to create a program that applies real-time effects to the screen (mac os), such as blurring, color shift, etc.. My question is, If a software, that is already using GPU acceleration, is running (such as Adobe Photoshop) how likely am I to run into problems? I guess I'm asking if it's possible for two programmes to access GPU acceleration/OpenCL at the same time?


Solution

  • Multiple programs can safely use the same GPU. You may encounter stuttering or other issues if you're doing something intensive, but otherwise it will be fine. If you want to be safe, you can check CL_DEVICE_AVAILABLE to make sure it's OK to use a device, or use clCreateSubDevices to partition a single OpenCL device into multiple sub-devices that can work independently (just to clarify, this is not required, but does give you finer control)