Title: OpenCL on the Mac ? Post by: David Makin on May 26, 2010, 11:45:16 PM Is anyone here doing OpenCL on the Mac ?
It's something I hope to do when I finally get around to getting a Mac and I'd appreciate any information on the subject. Title: Re: OpenCL on the Mac ? Post by: aluminumstudios on May 27, 2010, 12:31:04 AM I have an old Macbook with integrated Intel video, so I can't get any GPU acceleration :sad1:, but i have tinkered with running OpenCL code because the code can use the CPU cores instead.
I downloaded Apple's "Hello World" OpenCL example and opened it in XCode: http://developer.apple.com/mac/library/samplecode/OpenCL_Hello_World_Example/Introduction/Intro.html I then started pasting in code from my Buddhabrot software and rewrote one of the simple orbit processing functions as an openCL function as a test (that was trivial, but changing my iteration function to a highly parallel opencl function will take a lot of work.) It seems pretty easy to do, but my current code runs sooooooooo much faster than the opencl code on the CPU. Also, Macbooks and iMacs GPUs only support single precision. I'm not in a market for a Mac Pro at the moment, so the best bet for my project is to keep my threaded CPU code running. I also tinkered with Nvidia CUDA (using the emulator mode of their compiler since once again, my old MacBook has integrated Intel GPU). CUDA code seemed a little more simple and less tedious than OpenCL code. It was easier for me to get that written and working ,but for a serious programer there might not be a difference. Title: Re: OpenCL on the Mac ? Post by: David Makin on May 27, 2010, 12:52:19 AM Thanks for that.
I'm saving for a MacPro since I've decided to avoid Microsoft products at all cost from now on :) Ultra Fractal is now the only reason for me to need a Windows OS - and maybe that's not for much longer ;) Title: Re: OpenCL on the Mac ? Post by: aluminumstudios on May 27, 2010, 03:38:28 AM With Parallels or VMware (and maybe other virtual machine software), you can easily boot Windows on a Mac while MacOS continues to run. You would have no problem doing this to run Ultrafractal and there isn't a performance hit from doing this (other than the large amount of memory usage and any active processes sharing the CPU cores - aside from this Windows runs at full native speed.)
While I also choose to not be reliant on Microsoft for the majority of my computing, I do boot into XP once in a while to run a few apps and utilities that I like :evil1:. Title: Re: OpenCL on the Mac ? Post by: KRAFTWERK on May 27, 2010, 09:15:57 AM Thanks for that. I'm saving for a MacPro since I've decided to avoid Microsoft products at all cost from now on :) Ultra Fractal is now the only reason for me to need a Windows OS - and maybe that's not for much longer ;) This is a post that makes me very happy David! Right move! Looking forward to see what you can do when you are no longer on the dark side! :) And on the same day that this happened: http://gizmodo.com/5548460/apple-is-now-bigger-than-microsoft-the-most-valuable-tech-company-in-the-world (http://gizmodo.com/5548460/apple-is-now-bigger-than-microsoft-the-most-valuable-tech-company-in-the-world) Title: Re: OpenCL on the Mac ? Post by: subblue on May 27, 2010, 10:34:26 AM Apple actually released an OpenCL demo of the Quaternion Julia set fractal (http://developer.apple.com/mac/library/samplecode/OpenCL_RayTraced_Quaternion_Julia-Set_Example/Introduction/Intro.html) renderer as part of one of their demo apps. I've not actually had chance to investigate it further.
I think I'm going to look down this route first though: http://www.fractalforums.com/programming/qt-plus-opencl-qtopencl as the cross platform approach of Qt appeals more. Title: Re: OpenCL on the Mac ? Post by: ker2x on May 27, 2010, 02:24:11 PM You should take a look at Apple's "Grand Central", that use openCL.
Title: Re: OpenCL on the Mac ? Post by: hobold on May 28, 2010, 06:20:47 PM My next Mac will be OpenCL capable, but I am still waiting for an update of the MacPro line of models before I make a decision what to buy. The OpenCL support is not yet persuasive on the Mac, but Apple seems to be busy providing OpenCL drivers for more and more of the currently available GPUs. Oh, and I second the recommendation to take a look at rand Central Dispatch. It doesn't make the hard problems easy, but it makes the easy stuff trivial. With GCD I multithreaded some arbitrary precision mandelbrot renderer in maybe two hours. Doing the same with Posix threads took me two days of trial and error ... in both cases I started with zero knowledge of the respective APIs. |