Accelerated R with CUDA on Linux

The R programming language uses Basic Linear Algebra Subprograms (BLAS) for performing common linear algebra operations such as vector addition, scalar multiplication, dot products, linear combinations, and matrix multiplication. R includes Netlib BLAS by default. Significant performance gains can be achieved by replacing that with a different BLAS library such as OpenBLAS or ATLAS.

Further gains are possible by intercepting certain calls to BLAS with NVIDIA’s NVBLAS. Operations that can benefit from running on a GPU will be automatically redirected to cuBLAS without any modification to your R code.

Continue reading Accelerated R with CUDA on Linux

Visualising OCO-2 XCO2 in R with DeltaRho

NASA JPL’s Orbiting Carbon Observatory 2 (OCO-2) was launched into sun-synchronous orbit around the Earth on July 2, 2014. It carries 3 grated spectrometers for measuring the spectrum of sunlight reflected off the surface of the earth, which is used to calculate the average concentration of Carbon Dioxide in the column of atmosphere beneath the satellite (XCO2). It takes 16 days to provide full coverage of the Earth’s surface.

I am using the R packages datadr and Trelliscope from the DeltaRho project (formerly called Tessera.io) to explore and visualise the XCO2 observations from the OCO-2 Level 2 Lite version 7R data product.

Continue reading Visualising OCO-2 XCO2 in R with DeltaRho

Installing every CRAN package in R on CentOS 7

Why would you want to install every CRAN package? That’s a good question.

Step 1: Install CentOS 7 Linux.

Some R packages will not install without an active X window session, so if you are not logged in to a graphical interface on the machine you will need to connect via SSH with X-forwarding enabled, such as with PuTTY and VcXsrv on Windows.

Most of this guide must be run from the Linux terminal as the user who will be running R. That user must be allowed to run commands as root with sudo.

Continue reading Installing every CRAN package in R on CentOS 7

Preventing VPN leaks on Linux

A Raspberry Pi running OpenVPN with a D-Link DUB-1312 Ethernet adapter
A Raspberry Pi model B running OpenVPN with a D-Link DUB-1312 Ethernet adapter

If you connect to the internet through a public WiFi hotspot, or at school or at work, the metadata and contents of your online communications can be intercepted and viewed (or altered) by the network operator or another malicious party on the network. One of the ways to protect your privacy is to send all of your internet traffic through a Virtual Private Network.

Unfortunately a lot of personal data can leak out when you join a new network but have not yet connected the VPN. This guide shows you how to configure the Linux iptables firewall to block all normal outgoing connections, and only allow connections to your VPN server.

Continue reading Preventing VPN leaks on Linux

Testing a Titan

We recently acquired a Nvidia GTX Titan graphical processing unit (GPU) for statistical computing at work, specifically double-precision floating point operations on the CUDA API. Before I lock it away in the server room I would like to see how it compares to my primary GPU at home – a Nvidia GTX 680, and my older GPUs – a pair of AMD Radeon HD 5770. This act of comparison is called benchmarking – running a number of standard tests and trials in order to assess the relative performance of a piece of hardware or software.

Continue reading Testing a Titan