An R Introduction to Statistics

Installing GPU Packages

After you have installed the CUDA Toolkit, you can start installing the R GPU packages. Since some of the packages have to be compiled from source, you must also install the R developer environment. For Fedora users, enter the following in a terminal:

$ sudo yum install R-devel

As for Ubuntu users, use the following instead.

$ sudo apt-get install r-base-dev

Ubuntu users should follow the R installation instruction for Ubuntu as found in CRAN for the latest release.

Installing RPUD Package

Define a environment variable named R_LIBS_USER in .bashrc that points to an existing folder in your home directory. In the example below, I have chosen a folder lib/R created ahead of time.

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

You would need to install a required dependency of SparseM in R.

> install.packages("SparseM")

Now retrieve the latest release of rpud from the download page, and install it in a terminal:

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

You may verify the installation by loading rpud in R. The welcome message will show whether it has been successful.

> library(rpud)                  # load rpud 
Rpud 0.2.0 
http://www.r-tutor.com 
Copyright (C) 2010-2012 Chi Yau. All Rights Reserved. 
Rpud is licensed under GPL-v3. There is absolutely NO warranty.

Installing RPUDPLUS Add-on

While rpud computes the distance matrix on GPU in high speed, its data processing capacity is confined by the video graphics memory. In order to make full use of the system RAM available to R (about 2GB) for certain operations, you can install the rpudplus add-on. It enables rpud to handle larger data sets in calculating distance metrics, and can perform more tasks efficiently. You can download and extract the package in a temporary folder, and run the installation script.

$ tar xf rpudplus_<version>.tar.gz 
$ cd rpudplus_<version> 
$ ./install.sh

You may now verify your rpudplus installation in R.

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

Note

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