[R-sig-hpc] How to configure R to work with GPUs transparently
brad.spiers at bankofamerica.com
Fri Mar 19 19:21:38 CET 2010
I didn't think there was a magic wand, but it's best to be sure.
From: Dirk Eddelbuettel [mailto:edd at debian.org]
Sent: Friday, March 19, 2010 2:13 PM
To: Spiers, Brad
Cc: Dirk Eddelbuettel; r-sig-hpc at r-project.org
Subject: RE: [R-sig-hpc] How to configure R to work with GPUs
On 19 March 2010 at 12:29, Spiers, Brad wrote:
| Ticket Name: R installation question
| Ticket ID: WATS-14
| Reply Submitted: Mar-18-2010 (02:49)
| Reply Submitted By: john
| Hi Brad,<br />
| We're actually not in any way involved with the R project - they are
| end user that has integrated our product.<br /> <br /> Notably,
| we nor CUBLAS provide a symbol "dgemm_" - that is a CPU call
| rather than a GPU call. The Nvidia CUBLAS provides cublasDgemm, which
| the closest thing to that. I don't know too much about the R-tools
| you might want to also continue to link to a CPU BLAS with -lblas in
| BLAS_LIBS. The R package might still want to link both CPU and GPU
| versions in case a GPU is not present?<br /> <br /> Regards,<br />
That is a somewhat different story.
Blas is indeed an external interface, and just how you can make your R
processing faster by installing an optimised Blas library like Goto,
Intel MKL, ... you can conceivably also gain by letting the GPU handle
But as the answer stated, that still involves going 'inside' and
dgemm class (to Blas) with cublasDgemm (to GPU).
Moreover, trouble is that back in real-life, we are rarely seeing our
processing_ constrained by the Blas / linear algebra portion. Plus,
Blas are already using multiple cores so the net gain is small.
| I had thought that culatools provided a BLAS interface, but that is
| apparently wrong. From the response above, I thought there might be
| some flag in R configuration that I could not find via
| googling--something like "--use-GPU" that would have R use some
| integrated version of culatools. However, from the manuals and from
| what you're saying, that does not appear to be possible.
You are again asking for a magic wand. Someone would have had to add an
option --use-GPU. But sadly, nobody has.
PS If you want to learn more about GPU programming and R, our upcoming
conference 'R / Finance' has both a GPU tutorial and a paper
both handled by J Buckner and M Seligman, authors of gputools. Details
signature or at www.RinFinance.com
| If anyone is aware of such a flag in R--one that will enable the
| automatically, without changing code--please let me know. Thanks.
| -----Original Message-----
| From: Dirk Eddelbuettel [mailto:edd at debian.org]
| Sent: Friday, March 19, 2010 1:24 PM
| To: Spiers, Brad
| Cc: r-sig-hpc at r-project.org
| Subject: Re: [R-sig-hpc] How to configure R to work with GPUs
| On 19 March 2010 at 11:55, Spiers, Brad wrote:
| | I am trying to get R to work with an NVIDIA GPU transparently. I
| | know about gputools, but they require changing R scripts to include
| | "gpu" before the relevant calls.
| In order to execute code on the GPU instead of the CPU, you actually
| need to
| have code that the GPU understands and that is written in a way the
| the GPU features are taken advantage of.
| And sadly, there is no magic wand that takes existing code and just
| makes it
| work there. Just how you can't just execute your (x86) Windows
| your (old PPC) Mac etc pp.
| | According to the Cula Tools folks, R is actually a client of
| | so there should be some way to get R to work with GPUs natively. I
| Can you quote what they state, please?
| | seriously doubt that I am the first person to try this. If someone
| | done this, could you please share how you have done so? If you know
| | that this does not work, could you please confirm? Thanks.
| Registration is open for the 2nd International conference R /
| See http://www.RinFinance.com for details, and see you in Chicago in
Registration is open for the 2nd International conference R / Finance
See http://www.RinFinance.com for details, and see you in Chicago in
More information about the R-sig-hpc