1
votes

I found a site that suggested I try the following to check and see if everything was installed before installing Nvidia toolkit. I did the following inside R, and I am running:

R version 3.1.2 (2014-10-31) -- "Pumpkin Helmet" Copyright (C) 2014 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit)

2.1. Verify You Have a CUDA-Capable GPU

system("lspci | grep -i nvidia") 01:00.0 VGA compatible controller: NVIDIA Corporation GM107 [GeForce GTX 750 Ti] (rev a2) 01:00.1 Audio device: NVIDIA Corporation Device 0fbc (rev a1)

2.2. Verify You Have a Supported Version of Linux

system("uname -m && cat /etc/*release")
x86_64
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=15.04
DISTRIB_CODENAME=vivid
DISTRIB_DESCRIPTION="Ubuntu 15.04"
NAME="Ubuntu"
VERSION="15.04 (Vivid Vervet)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 15.04"
VERSION_ID="15.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"

2.3. Verify the System Has gcc Installed

system("gcc --version")
gcc (Ubuntu 4.9.2-10ubuntu13) 4.9.2
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

2.4. Verify the System has the Correct Kernel Headers and Development Packages Installed

system("uname -r")
3.19.0-28-generic

system("nvcc --version")
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2014 NVIDIA Corporation
Built on Thu_Jul_17_21:41:27_CDT_2014
Cuda compilation tools, release 6.5, V6.5.12

system("cat /proc/driver/nvidia/version")
NVRM version: NVIDIA UNIX x86_64 Kernel Module  352.30  Tue Jul 21 18:53:45 PDT 2015
GCC version:  gcc version 4.9.2 (Ubuntu 4.9.2-10ubuntu13) 

install.packages("gputools.tar.gz", repos = NULL, type = "source")
Installing package into ‘/home/steven/R/x86_64-pc-linux-gnu-library/3.1’
(as ‘lib’ is unspecified)
* installing *source* package ‘gputools’ ...
files ‘src/Makefile’, ‘src/config.mk’ have the wrong MD5 checksums
** libs
** arch - 
/usr/lib/nvidia-cuda-toolkit/bin/nvcc  -gencode arch=compute_50,code=sm_50 -c -I. -I"/usr/lib/nvidia-cuda-toolkit/include" -I"/usr/lib/R/include"  -Xcompiler -fpic rinterface.cu -o rinterface.o
rinterface.cu:1:14: fatal error: R.h: No such file or directory
 #include<R.h>
              ^
compilation terminated.
Makefile:27: recipe for target 'rinterface.o' failed
make: *** [rinterface.o] Error 1
ERROR: compilation failed for package ‘gputools’
* removing ‘/home/steven/R/x86_64-pc-linux-gnu-library/3.1/gputools’
Warning in install.packages :
  installation of package ‘gputools.tar.gz’ had non-zero exit status

install.packages("gputools", dependencies = T)
Installing package into ‘/home/steven/R/x86_64-pc-linux-gnu-library/3.1’
(as ‘lib’ is unspecified)
trying URL 'http://cran.rstudio.com/src/contrib/gputools_0.28.tar.gz'
Content type 'application/x-gzip' length 65883 bytes (64 Kb)
opened URL
==================================================
downloaded 64 Kb

* installing *source* package ‘gputools’ ...
** package ‘gputools’ successfully unpacked and MD5 sums checked
** libs
** arch - 
/usr/local/cuda/bin/nvcc -gencode arch=compute_10,code=sm_10 -gencode arch=compute_13,code=sm_13 -gencode arch=compute_20,code=sm_20 -gencode arch=compute_30,code=sm_30 -c -I. -I"/usr/local/cuda/include" -I"/usr/lib/R/include"  -Xcompiler -fpic rinterface.cu -o rinterface.o
/bin/bash: /usr/local/cuda/bin/nvcc: No such file or directory
Makefile:27: recipe for target 'rinterface.o' failed
make: *** [rinterface.o] Error 127
ERROR: compilation failed for package ‘gputools’
* removing ‘/home/steven/R/x86_64-pc-linux-gnu-library/3.1/gputools’
Warning in install.packages :
  installation of package ‘gputools’ had non-zero exit status

The downloaded source packages are in
    ‘/tmp/RtmpvcNoks/downloaded_packages’

As I am just starting out with R, any help would be great.

2
What is your $RHOME? Please check whether you have R.h in $RHOME/include/.user3710546
R.home() [1] "/usr/lib/R" Locate R.h says it is in /usr/lib/R/include/R.h so I guess it is where it needs to be?Steve burnett
Yes, this is the default location.user3710546
So now what do I do?Steve burnett

2 Answers

4
votes

I hope I'm not too late!

I had the same problem and I have resolved it by messing around the Makefile of the gputools package.

It seems that the package was expecting (in my case) nvcc and other things in the wrong directories, so when it tried to call for /usr/local/cuda/bin/nvcc I had the same message:

/usr/local/cuda/bin/nvcc -gencode arch=compute_10,code=sm_10 -gencode arch=compute_13,code=sm_13 -gencode arch=compute_20,code=sm_20 -gencode arch=compute_30,code=sm_30 -c -I. -I"/usr/local/cuda/include" -I"/usr/lib/R/include"  -Xcompiler -fpic rinterface.cu -o rinterface.o
/bin/bash: /usr/local/cuda/bin/nvcc: No such file or directory

What I did was download the package, unpackit somewhere, and then modify in src/Makefile, the line

CUDA_HOME=/usr/local/cuda

to point to my real coda home (in my case is /opt/cuda)

This solved for me, but others had other errors following this one, I'm sure this post can help you go through with them if the same happens to you!

http://dsnotes.com/blog/2015/06/04/installing-cuda-toolkit-and-gputools/

Cheers

0
votes

For the latest version of gputools, follow these instructions especially if you get the error:

rinterface.cu:1:14: fatal error: R.h: No such file or directory
  1. Download the tar file from: https://cran.r-project.org/web/packages/gputools/index.html

or

~$ wget http://cran.r-project.org/src/contrib/gputools_1.1.tar.gz

2. Extract Contents

~$ tar -zxvf gputools_1.1.tar.gz

3.View contents of the INSTALL file for instructions

~$ cd gputools/
~/gputools$ gedit INSTALL

4.If you follow the instructions you will end up with something like this

~$ R CMD INSTALL --configure-args="--with-nvcc=/usr/local/cuda/bin/nvcc 
--with-r-include=/usr/share/R/include" gputools_1.1.tar.gz