PixInsight Forum (historical)

Software Development => PCL and PJSR Development => Topic started by: Nocturnal on 2009 April 29 06:57:49

Title: OpenCL vs. CUDA
Post by: Nocturnal on 2009 April 29 06:57:49
Hi,

You may have read about OpenCL here http://www.khronos.org/opencl/ and here http://en.wikipedia.org/wiki/OpenCL . It promises to allow thread creation on both CPU and GPU which would allow PCL to spread the processing load across all available processing resources. CUDA is Nvidia specific and therefore less interesting for us. ATI is on board with OpenCL even if they don't have a driver yet. Nvidia already published the first version.

I've reviewed some of the documentation and it looks pretty straight forward to initialize buffers on the GPU, fill them, upload code to process the data and then retrieve the result. Clearly it won't make sense to process all data this way. The copy operations while fast (PCI-E DMA after all) are still an extra operation that can be skipped if the data is processed by the host CPU. It's also not quite clear to me how OpenCL allows you to use CPU and GPU as 'similar' resources. This all requires investigation. I'm starting this thread to gauge interest and see if anyone has experience in these matters already.

Juan suggested making this thread sticky but I don't have permission to do so.
Title: Re: OpenCL vs. CUDA
Post by: georg.viehoever on 2009 April 30 10:13:35
Sander,

I am watching the GP-GPU arena in my professional life as a software developer.

- It has a lot of potential, in particular if you algorithm is CPU bound and has a fairly simple control flow (such as many image processing algorithms)
- Memory bound algorithms can benefit as well, if they have simple access patterns (basically linear access).
- An important bottleneck currently is the data transfer between graphics card and main memory. If you have only short problems to compute on the GPU, this can kill any speedup.
- In some cases, it is necessary to design your implementation specifically for GPUs. Algorithms working well on normal CPUs (often tuned to optimize L2-cache access) sometimes dont work well on GPUs.

If you want to experiment with GPUs, I would stick to CUDA for the moment. The first OpenCL implementations lack maturity, and at the current stage OpenCL does not even have mandatory support for floats (see the spec, or http://de.wikipedia.org/wiki/OpenCL). Also, CUDA is sufficiently similar to OpenCL, so you should not have much trouble in moving to OpenCL later.

Georg
Title: Re: OpenCL vs. CUDA
Post by: Nocturnal on 2009 April 30 10:26:17
Hi Georg,

thanks for your comments on this topic. I agree with your conclusions regarding suitability of GPU vs. CPU.

It'll be interesting to experiment with this stuff. Unfortunately my own machine has an ATI card but my work laptop has a discrete Nvidia chip that supports CUDA so I can at least play.
Title: Re: OpenCL vs. CUDA
Post by: georg.viehoever on 2009 April 30 10:29:50
Make sure you install the latest driver on your laptop. See http://www.laptopvideo2go.com/ if your supplier does not provide one.

Georg
Title: Re: OpenCL vs. CUDA
Post by: Juan Conejero on 2009 September 21 03:45:55
Just to inform you about some news regarding this topic: I have now a CUDA-enabled nVidia driver installed and working for my Quadro FX 570 on my Fedora 11 workstation.

Don't expect CUDA-based features implemented in PixInsight very soon though, as we have lots and lots of priorities before this. But a first step has been made  8)
Title: Re: OpenCL vs. CUDA
Post by: Yuriy Toropin on 2010 March 27 04:05:26
As you probably have heard already, after half year delay NVidia finally released GTX 480 & 470 "Fermi"-based cards.
Here is the first report (http://www.anandtech.com/video/showdoc.aspx?i=3783&p=6) on performance in computing-intensive applciation (both Open CL & CUDA-based).
Benchmarks demonstrated significant jump over GTX 285 performance, 480 shaders do their job in GTX480 quite well...