[R-sig-hpc] GPU Computing

Simon Urbanek simon.urbanek at r-project.org
Wed Aug 22 19:10:06 CEST 2012


On Aug 22, 2012, at 12:45 PM, "M. Edward (Ed) Borasky" <znmeb at znmeb.net> wrote:

> On Wed, Aug 22, 2012 at 6:54 AM, Simon Urbanek
> <simon.urbanek at r-project.org> wrote:
> 
>> That is not true - OpenCL is platform independent and you can use a wide range of back-end implementations - not only GPUs but also accelerators and CPUs. See the installation notes in the package for details - there are many to choose from. You may still need to tweak kernels for performance on particular type of back-end (e.g., kernels optimized for CPUs won't be very fast on GPUs and vice-versa), but at least you need not worry about vendors. The nice thing about OpenCL is that the API is open source and free so you can use it without any baggage, however, drivers for particular hardware tend to be proprietary just because GPU vendors like their secret performance sauce to stay secret.
> 
> I wasn't able to get OpenCL to run on anything except Intel CPUs. My ancient NVidia GeForce 6150SE nForce 430 didn't work, even with proprietary Linux drivers and other binary stuff downloaded from the NVidia site. The open source "nouveau" drivers? Fugeddaboutit! The built-in GPU on my year-old Intel i5 laptop? Nope. I don't have an ATI / AMD GPU any more, so maybe that one actually works.
> 
> This stuff is hand-tuned to work on Windows gamer gear, Macs and strategic government HPC procurements. Everybody else is a second-class citizen.
> 

I had no trouble getting OpenCL working on pretty much all machines I have been testing. Obviously, on Macs it is the easiest as it comes pre-installed with the system so it just works. I don't use Windows so I can't comment on that one, but Linux (Debian and Ubuntu) it was still easy - the API comes as open-source with the distribution, so the only thing you need is the libOpenCL.so from your vendor - which was just one download that you don't even have to install (i.e., you don't need to set any special env vars or so). I grabbed just a random version, and didn't need to upgrade drivers.

That said, using random GPUs won't do you any good with R - the performance of regular "consumer" GPUs is horrible with double-precision arithmetics (even more so with mobile GPUs). Also they are not much faster compared to modern CPUs (other than for very specific class of problems that can be hand-tuned to a particular GPU and its hardware specifics, but I don't consider that realistic use for data analysis). The only serious benefit is with modern GPUs that are geared specifically at HPC (like Teslas etc.) - they can really blow CPUs out of the water, but they have an appropriate cost. So even though you can run GPU code on random hardware as a first-class citizen, it won't help you solve a problem.

Cheers,
Simon



More information about the R-sig-hpc mailing list