[R-sig-hpc] GPU Computing

Simon Urbanek simon.urbanek at r-project.org
Wed Aug 22 15:54:18 CEST 2012


On Aug 21, 2012, at 6:10 PM, M. Edward (Ed) Borasky <znmeb at znmeb.net> wrote:

> On Tue, Aug 21, 2012 at 1:54 PM, Norm Matloff <matloff at cs.ucdavis.edu> wrote:
>> In-Reply-To
>> 
>> Peter Chausse wrote:
>> 
>>> I am looking for a function similar to mclapply() that would work with
>>> GPU cores. I have looked at all possible packages related to GPU...
>> 
>> The short answer is no.
>> 
>> Functions like mclapply() work on, say a quad core machine, by setting
>> up new invocations of R to run on each of the four CPU cores.  What you
>> have in mind would mean having R run on each of the GPU cores.  This is
>> not possible, for a variety of reasons (R needs a terminal shell, it
>> needs I/O etc.).
>> 
>> To have R take advantage of GPUs, one must write C/C++ (or FORTRAN)
>> code.  Currently packages that do this are very limited.  See the
>> relevant CRAN Task View, at
>> 
>> http://cran.r-project.org/web/views/HighPerformanceComputing.html
> 
> There are a number of GPU packages in that task view, but few of them
> compile and execute in a pure open source environment (*none* on any
> of my recent tests with openSUSE and Fedora; I haven't attempted
> Debian or Ubuntu). And as far as I can recall they are NVidia only;
> there is precious little pure open source code that actually works out
> of the box for Intel or AMD/ATI GPUs.

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.

Cheers,
Simon



> There are GCC gotchas, missing
> libraries and all sorts of other non-repeatabilities to waste effort
> on. I gave up on pure open source GPU usage with R.
> 
> -- 
> Twitter: http://twitter.com/znmeb; Computational Journalism Publishers
> Workbench: http://j.mp/QCsXOr
> 
> How the Hell can the lion sleep with all those people singing "A weem
> oh way!" at the top of their lungs?
> 
> _______________________________________________
> R-sig-hpc mailing list
> R-sig-hpc at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-hpc
> 
> 



More information about the R-sig-hpc mailing list