An R Introduction to Statistics

Installing GPU Packages

After installing the CUDA Toolkit and R, you can download and extract the latest RPUD package in a local folder, and proceed to install rpudplus in your operating system.

Windows

For Windows users, in the R main window, you can select the menu item “Packages > Install package(s) from local zip files”. Then navigate to the extraction folder you have just created, and install the two binary packages rpud_*.zip and rpudplus_*.zip in turn. The rpud_*_src.zip package is for your reference only. It is not meant to be installed.

Mac OS X

For Mac OS X users, you should define a environment variable named R_LIBS_USER in your .bash_profile file that points to an existing folder in your home directory. In the example below, I have created a directory ’Library/R’ in the home folder.

export R_LIBS_USER="${HOME}/Library/R"

Then you can install the binary packages inside the extraction folder in a terminal.

$ R CMD INSTALL rpud_<version>.tgz 
$ R CMD INSTALL rpudplus_<version>.tgz

You can optionally install the rpud source package as well.

$ R CMD INSTALL rpud_<version>_src.tgz

Linux

The R installation process is a little bit different in Linux. For Fedora users, enter the following in a terminal.

$ sudo yum install R-devel

For Ubuntu users, use the following instead.

$ sudo apt-get install r-base-dev

Ubuntu users should also follow the Ubuntu instruction in CRAN for the latest update.

In your .bashrc file, you should define a environment variable named R_LIBS_USER that points to an existing folder in your home directory. In the example below, I have created a directory ’lib/R’ in the home folder.

export R_LIBS_USER="${HOME}/lib/R"

Then you can install the binary packages inside the extraction folder in a terminal.

$ R CMD INSTALL rpud_<version>.tar.gz 
$ R CMD INSTALL rpudplus_<version>.tar.gz

The installation of the rpud source package is optional.

$ R CMD INSTALL rpud_<version>_src.tar.gz

Post Installation

If you need SVM and Bayesian inferences, you should meet their dependencies on coda and SparseM in R.

> install.packages(c("coda", "SparseM"))

Now you may verify your rpudplus installation.

> library(rpud) 
Rpudplus 0.4.0 
http://www.r-tutor.com 
Copyright (C) 2010-2014 Chi Yau. All Rights Reserved. 
Rpudplus is free for academic use only. There is absolutely NO warranty.

Note

The rpudplus GPU package requires double precision arithmetic hardware support. In order to fully exploit its capabilities, you should ensure the compute capability of your CUDA GPU exceeds 1.3 or above according to the CUDA hardware page.

Furthermore, the Windows version of rpudplus prefers a Tesla GPU running in TCC mode. Since the GeForce hardware does not support TCC mode, the performance is suboptimal.