GPGPU on modern iOS devices?

Discussion in 'iOS Programming' started by adildacoolset, Oct 7, 2013.

  1. adildacoolset macrumors 65816

    Joined:
    Sep 5, 2011
    Location:
    Lusaka, Zambia(If you know where it is)
    #1
    Hello,

    I was wondering if it's possible to do GPGPU computations on modern iOS devices. I read somewhere that the OpenCL framework is a private framework, but I want to see if it's true.

    I saw nothing on this when I searched apple developer manuals for iOS, and when I looked on other forums, there were outdated articles present before the arrival of the iPad 2.

    Now, the PowerVR 5XT and series 6 are OpenCL capable, so I would like to know if it can be used. If not, then what else can be used to perform GPGPU computations?
     
  2. Duncan C macrumors 6502a

    Duncan C

    Joined:
    Jan 21, 2008
    Location:
    Northern Virginia
    #2
    OpenCL is an open computing platform. It is most definitely not private.

    There are rumors that it is included in recent versions of iOS for internal use, but not exposed to third party developers. It could be there, but not available for our use, so in that sense it would be private.

    I have also heard rumors of third party developers who have successfully built OpenCL and included it in their apps, but have not been able to find out how to do it.

    So far the best I've been able to come up with is writing shader programs that do GPGPU work, but that is a crude tool at best.

    I too have been chomping at the bit for OpenCL on iOS devices. It would enable lots of cool possibilities.
     
  3. adildacoolset thread starter macrumors 65816

    Joined:
    Sep 5, 2011
    Location:
    Lusaka, Zambia(If you know where it is)
    #3
    Yeah, but why do I still see an OpenCL.framework in Xcode still?
     
  4. Duncan C macrumors 6502a

    Duncan C

    Joined:
    Jan 21, 2008
    Location:
    Northern Virginia
    #4
    See it how?
     
  5. adildacoolset thread starter macrumors 65816

    Joined:
    Sep 5, 2011
    Location:
    Lusaka, Zambia(If you know where it is)
    #5
    When you do the normail "link binary with libraries", I see OpenCL.framework
     
  6. Duncan C macrumors 6502a

    Duncan C

    Joined:
    Jan 21, 2008
    Location:
    Northern Virginia
    #6
    Can you be very specific?

    What version and build of Xcode? (e.g. Xcode Version 5.0.1 (5A2034a) )

    Where, exactly, are you seeing this? Can you provide a detailed description of how to get there, (e.g. "Select project in project navigator; select target, select build phases, look in 'link binary with libraries' and open that disclosure triangle...)

    Can you provide a screen-shot? When I try to add a new framework and type "Open" as the prefix, I see OpenAL.framework and OpenGLES.framework, but not OpenCL. Are you sure you're not misreading the name of the OpenAL framework?
     
  7. adildacoolset thread starter macrumors 65816

    Joined:
    Sep 5, 2011
    Location:
    Lusaka, Zambia(If you know where it is)
    #7
    Hmm, I could've sworn I saw it before. But now it doesn't. Maybe I was looking at OS X projects. Silly me.
     
  8. Duncan C macrumors 6502a

    Duncan C

    Joined:
    Jan 21, 2008
    Location:
    Northern Virginia
    #8
    Drat. I was hoping you were right and apple added it as a framework. Like you, I really want OpenCL support on iOS.
     
  9. erwincoumans macrumors newbie

    Joined:
    Nov 1, 2006
    Location:
    San Francisco
    #9
    You can compile and run OpenCL code on iOS devices using the private framework, but you won't be able to get them into the App Store.

    Here is some example project how to do it:
    https://github.com/linusyang/opencl-test-ios
     
  10. adildacoolset thread starter macrumors 65816

    Joined:
    Sep 5, 2011
    Location:
    Lusaka, Zambia(If you know where it is)
    #10
    Are you the developer of bullet physics? [sorry for being a little off topic. I just remember an Erwin as being the admin for bullet physics forums].

    Anyways thank you very much.
     
  11. adildacoolset thread starter macrumors 65816

    Joined:
    Sep 5, 2011
    Location:
    Lusaka, Zambia(If you know where it is)
    #11
    If you have a developer program account, maybe you can ask Apple. I don't have an account, so I can't. I'd love to have posted my findings.

    There was a lot of talk from Apple about the enhanced OpenCL for mavericks. And with Apple's push for the iPad as a content-creating PC replacement, it better get OpenCL soon.

    I'd really love to try out some really cool stuff. To me, using vertex/fragment shaders for GPGPU just seems like a messy alternative.
     
  12. Duncan C macrumors 6502a

    Duncan C

    Joined:
    Jan 21, 2008
    Location:
    Northern Virginia
    #12
    Agreed. A reaching-around-your-elbow-to-scratch-your-butt solution.
     
  13. adildacoolset thread starter macrumors 65816

    Joined:
    Sep 5, 2011
    Location:
    Lusaka, Zambia(If you know where it is)
    #13
    Anyways, I filed an "enhancement request" at bugreport.apple.com for the iOS SDK
     
  14. adildacoolset thread starter macrumors 65816

    Joined:
    Sep 5, 2011
    Location:
    Lusaka, Zambia(If you know where it is)
    #14
    Ok, so I've seen in the OpenGL ES programming guide for iOS that OpenGL ES 3.0 enables general purpose computing on the GPU. This is better than nothing, but OpenCL is capable of being run on almost, if not all of the devices supported on iOS 7
     
  15. thekev macrumors 604

    thekev

    Joined:
    Aug 5, 2010
    #15
    How is that effective? It sounds absolutely useless outside of games given the way the framework is structured.
     
  16. adildacoolset thread starter macrumors 65816

    Joined:
    Sep 5, 2011
    Location:
    Lusaka, Zambia(If you know where it is)
    #16
    What I'm saying is that it's better than nothing.
     
  17. thekev macrumors 604

    thekev

    Joined:
    Aug 5, 2010
    #17
    It isn't if it can't be practically implemented. It is the kind of thing I would simply ignore.
     
  18. SpamJunkie macrumors regular

    Joined:
    Jun 3, 2003
  19. firewood macrumors 604

    Joined:
    Jul 29, 2003
    Location:
    Silicon Valley
    #19
    You can ignore it. But other developers don't, and they do do (non-game) computation on iOS device GPUs, even given the limitations (no Open CL, latencies, etc.)
     
  20. thekev macrumors 604

    thekev

    Joined:
    Aug 5, 2010
    #20
    Perhaps you have an example? That sounds like a mess of code given the way you would have to write it.
     
  21. firewood macrumors 604

    Joined:
    Jul 29, 2003
    Location:
    Silicon Valley
    #21
    Is is. There are examples on the net of how to do it using vertex arrays, shader code, and fake image bitmaps for the results. Years ago, those methods are what initially generated the interest in developing cleaner APIs like CUDA and Open CL. But you can still do it like the old-time pioneers did, if it buys you anything.
     
  22. thekev macrumors 604

    thekev

    Joined:
    Aug 5, 2010
    #22

    I don't think I would do that in iOS due to difficulty to maintain it. What I forgot to mention before is that my other concern would be Apple's approval guidelines. They tend to be somewhat strict and unusual.
     
  23. firewood macrumors 604

    Joined:
    Jul 29, 2003
    Location:
    Silicon Valley
    #23
    I've heard of at least one approved app in App store that was using the GPU for computation. There are probably more. Although Apple could always change their mind... about almost anything.

    Some say that iOS code should not be written to be easy to maintain. Apple changes too much too often. Many of Apple's own iPhoneOS 2.x sample apps don't build any more. So iOS apps should instead be architected and coded to be easy to mostly throw away and re-write.
     

Share This Page