Supported Platform:
OS X, Windows on Intel CPU/GPU, NVIDIA GPU.
I’ve tested on OS X 10.10.1 (Intel Ivy Bridge, GT 650M, GTX 980) and Windows 8.1.
All suggestions for other platforms are welcome.
Known Issues:
On windows, It’s failed to run editor on DebugGame mode.
Installation
Windows
Install NVIDIA Graphics Driver and Intel OpenCL runtime.
Copy “OpenCL” folder to “Plugins” folder under your project directory.
OS X
Copy “OpenCL” folder to “Plugins” folder under your project directory.
Screenshots
Windows
OS X
Legal info
Unreal® is a trademark or registered trademark of Epic Games, Inc. in the United States of America and elsewhere. Unreal® Engine, Copyright 1998 – 2014, Epic Games, Inc. All rights reserved.
Plugin is completely free and available under MIT open-source license.
It is easy to link with OpenCL on OS X because it’s already installed as a global framework.
But on windows it is not simple.
If you want to add/replace for other version or platform, you can replace the header files from the Khronos OpenCL Registry and the OpenCL.lib files in ThirdParty/OpenCL/Lib from OpenCL SDKs of the SDK providers (Intel/ATI/NVIDIA).
The OpenCL.lib files helps you to link with OpenCL.dll which installed on system with the drivers.
(It is not recommended to link with OpenCL.dll directly.)
In current state, NVIDIA’s OpenCL SDK supports OpenCL 1.1 on Windows and Apple’s SDK supports OpenCL 1.2
You’re right, that is a silly - I forgot the limited support.
Yeah, totally overlooked NVIDIA’s 1.1 support. Nevermind - this is still really great. I appreciate it!
EDIT: With OpenCL plugin added as a public dependency module, with the ‘OpenCL/Public’ path added to PublicIncludePaths, including cl.hpp leads to an include problem - cl.hpp, line 178 - where it fails on include <CL.opencl.h>, stating that it cannot be found. Have any of you succeeded in using the C++ wrapper?
I updated the plugin to resolve the include <CL/opencl.h> issue.
You don’t have to add “OpenCL/Public” to “PublicIncludePaths”.
You can include header files by add “OpenCL” to “PublicDependencyModuleNames”.
I have the latest NVIDIA driver, and I downloaded the Intel OpenCL runtime, I put in the OpenCL folder under my project inside a folder named Plugins, I have added OpenCL to my build.cs in PublicDependencyModuleNames, but when I build, and look for the plugin in the editor under window/plugins, I don’t see it.
Could you make a howto setup tutorial with a simple program that uses your plugin ? That would help a lot.
OpenCL is useless for UE4 as UE4 NVPhys implements this better. How about expanding this openCL plugin to actually be open, and thus to include AMD cards.
If you have lots of existing OpenCL codes then it is not useless
For OS X, AMD cards are already available using this plugin. For Windows, I already explained how to add SDK provider specific *.lib files in Readme.
Also, PhsyX is a physics engine. For GPGPU in UE4, I believe that Compute Shader is the best option.