The GPU computing is very popular since its capability of parallel computing. The environment of ubuntu is adequate to try GPU computing and its setting is easier than in window. I introduce the installation of CUDA, nVidia driver and R packages of GPU.
First, we go over the installation of CUDA 6.0.
Download the CUDA 6.0 installer: CUDA Download. In my case, I download the RUN file of Ubuntu 13.04.
Remove the old drive of nVidia:
1 | sudo apt-get purge nvidia |
- Install compatible GCC compiler. If the version of GCC compiler is not below 4.7.3, please install GCC 4.7.3. You can do that in this way:
1 | sudo add-apt-repository ppa:ubuntu-toolchain-r/test |
Choose gcc-4.7 for installing CUDA.
- Install CUDA 6.0: Press
alt+ctrl+F1
login tty1 and input following commands:
1 | sudo stop lightdm |
At begin, I do not install the driver, then it cause I can’t implement the compiled program.
- Add some environment variables: Use your text editor to edit
.bashrc
(In my case, it issubl ~/.bashrc
.) and add following lines into the files: (Notice whether your installation dictionary is the same as mine.)
1 | export PATH=/usr/local/cuda-6.0/bin:$PATH |
Then you can use CUDA and start to install R package gputools
. Besides, if you want opencl
, then you need to install opencl-headers
(use apt-get) and you can install R package OpenCL
. However, I did not install R package WideLM
successfully. (Caused by unknown option Wl
)
The R package rpud
is updated, but it did not update in CRAN. You need go to its website to download. Follow its installation note, you can install it successfully. Next time I will try to install the R package HiPLARM
.
My environment is ubuntu 14.04. My CPU is 3770K@4.3GHz and GPU is GTX 670. If you have some questions, you can reference following urls: