Announcement

Collapse
No announcement yet.

OpenCL Plugin

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    OpenCL Plugin

    OpenCL Plugin for Unreal Engine 4 (github)

    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

    1. Install NVIDIA Graphics Driver and Intel OpenCL runtime.
    2. Copy "OpenCL" folder to "Plugins" folder under your project directory.

    OS X

    1. Copy "OpenCL" folder to "Plugins" folder under your project directory.

    Screenshots
    Windows
    Click image for larger version

Name:	opencl-ue4plugin-log-win.png
Views:	1
Size:	18.3 KB
ID:	1142644

    OS X
    Click image for larger version

Name:	opencl-ue4plugin-log-osx.png
Views:	1
Size:	32.1 KB
ID:	1142645

    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.

    #2
    This would surely come in handy. Thanks for sharing!

    Comment


      #3
      Awesome, thanks for this!

      Have you considered upgrading to OpenCL 2.0? Not super important, but I hear SVM can be handy

      Comment


        #4
        And then he writes the drivers and infrastructure for OpenCL 2.0 on all that hardware for Windows and OS X all by himself?

        Comment


          #5
          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

          Comment


            #6
            Originally posted by Mikand79 View Post
            And then he writes the drivers and infrastructure for OpenCL 2.0 on all that hardware for Windows and OS X all by himself?
            You're right, that is a silly - I forgot the limited support.

            Originally posted by kwonoh View Post
            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
            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?
            Last edited by HateDread; 01-28-2015, 09:08 PM.

            Comment


              #7
              Originally posted by HateDread View Post
              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".

              Comment


                #8
                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.

                Comment


                  #9
                  Originally posted by balazon View Post
                  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.
                  Click image for larger version

Name:	OpenCL-UE4Plugin.PNG
Views:	1
Size:	72.3 KB
ID:	1068138
                  It will be under "Window>Plugins>Installed>Computing".
                  See "OpenCLPlugin.cpp" for an example. It prints OpenCL device information.

                  BTW, I have some problems after I updated to 4.7.X.
                  I'll fix it soon.

                  Comment


                    #10
                    I updated the plugin.
                    I tested on UE 4.7.6 in OS X (10.10.3), Windows 8.1.

                    Comment


                      #11
                      Originally posted by balazon View Post
                      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.
                      If you still have this problem, try to regenerate your project file.

                      Comment


                        #12
                        Hey Kwonoh,

                        Any possibility of updating the OpenCL plugin to 4.10?

                        Just thought I would ask.

                        Comment


                          #13
                          Hi, I haven't tried on 4.10
                          Let me know if it is not working on 4.10.

                          Comment


                            #14
                            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.

                            Comment


                              #15
                              Originally posted by rrstuv View Post
                              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.
                              Last edited by kwonoh; 02-09-2016, 01:45 AM.

                              Comment

                              Working...
                              X