From dtemplelang at ucdavis.edu  Thu Jul 18 16:16:35 2013
From: dtemplelang at ucdavis.edu (Duncan Temple Lang)
Date: Thu, 18 Jul 2013 07:16:35 -0700
Subject: [Rd] question about Makeconf and nvcc/CUDA
In-Reply-To: <FF9DB805FC41CC4E95825A50F680630217A25E2C@columbia.uhd.campus>
References: <FF9DB805FC41CC4E95825A50F680630217A25E2C@columbia.uhd.campus>
Message-ID: <51E7F8C3.30000@ucdavis.edu>


Hi Erin

 Glad you are making progress on this with Brian's help.

 I thought I would mention a different approach that might save you some
programming time and actually make the code more flexible at the same time.
Basically, in a high-level language like R, it is nice to keep the code
calling a GPU kernel also high-level rather than writing code in C/C++
to do the transfer of data to and from the CPU and GPU.

Simon's OpenCL package (on CRAN) and the new RCUDA package (www.omegahat.org/RCUDA)
allow us to load and invoke kernels directly from R.
These provide more flexibility for invoking GPU kernels from R than fixed C/C++ code.

RCUDA provides an interface to almost all of the CUDA API and so allows us to transfer
values from R to the GPU and back (in different ways), invoke kernels asynchronously, etc.
I haven't built the package on Windows yet, but may be able to get to that in the next
few days.

With a Windows binary of RCUDA (or OpenCL), you would be able to skip nvcc in your
package by  compiling the kernel code generically so that it contains code for GPUs
with different  capabilities (e.g. sm_20, sm_30, sm_35).

In the last few days, I have also managed to compile very simple R code
directly in R to PTX code that we can load and invoke using RCUDA.
The compilation uses the Rllvm and RLLVMCompile packages. So in the
future, I expect we will be able to compile simple R functions
to native and PTX code.

 D.

On 7/17/13 11:45 PM, Hodgess, Erin wrote:
> Dear R development:
> 
> 
> 
> I'm not sure if this is the appropriate list, but it's a start.
> 
> 
> 
> I would like to put together a package which contains a CUDA program on Windows 7.  I believe that it has to do with the Makeconf file in the etc directory.
> 
> 
> 
> But when I just use the nvcc with the shared option, I can use the dyn.load command, but when I use the is.loaded function, it shows FALSE.
> 
> 
> 
> 
> 
> 
> 
> Here are the results of the check command:
> 
> 
> 
> c:\PROGRA~1\R\R-3.0.1\bin\i386>R CMD check cudasize
> R CMD check cudasize
> * using log directory 'c:/PROGRA~1/R/R-3.0.1/bin/i386/cudasize.Rcheck'
> * using R version 3.0.1 (2013-05-16)
> * using platform: i386-w64-mingw32 (32-bit)
> * using session charset: ISO8859-1
> * checking for file 'cudasize/DESCRIPTION' ... OK
> * checking extension type ... Package
> * this is package 'cudasize' version '1.0'
> * checking package namespace information ... OK
> * checking package dependencies ... OK
> * checking if this is a source package ... OK
> * checking if there is a namespace ... OK
> * checking for executable files ... OK
> * checking for hidden files and directories ... OK
> * checking for portable file names ... OK
> * checking whether package 'cudasize' can be installed ... ERROR
> Installation failed.
> See 'c:/PROGRA~1/R/R-3.0.1/bin/i386/cudasize.Rcheck/00install.out' for details.
> 
> And the 00install.out file:
> 
> * installing *source* package 'cudasize' ...
> 
> ** libs
> 
> 
> 
> *** arch - i386
> 
> cygwin warning:
>   MS-DOS style path detected: c:/PROGRA~1/R/R-30~1.1/etc/i386/Makeconf
>   Preferred POSIX equivalent is: /cygdrive/c/PROGRA~1/R/R-30~1.1/etc/i386/Makeconf
>   CYGWIN environment variable option "nodosfilewarning" turns off this warning.
>   Consult the user's guide for more details about POSIX paths:
>     http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
> cygwin warning:
>   MS-DOS style path detected: c:/PROGRA~1/R/R-30~1.1/etc/i386/Makeconf
>   Preferred POSIX equivalent is: /cygdrive/c/PROGRA~1/R/R-30~1.1/etc/i386/Makeconf
>   CYGWIN environment variable option "nodosfilewarning" turns off this warning.
>   Consult the user's guide for more details about POSIX paths:
>     http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
> make: `symbols.rds' is up to date.
> ERROR: compilation failed for package 'cudasize'
> 
> * removing 'c:/PROGRA~1/R/R-3.0.1/bin/i386/cudasize.Rcheck/cudasize'
> 
> 
> 
> I've been experimenting with the Makeconf file, but to no avail.
> 
> 
> 
> Does anyone have any suggestions, please?
> 
> 
> 
> Thanks,
> 
> Erin
> 
> 
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>



[Rd] question about Makeconf and nvcc/CUDA
Duncan Temple Lang