Playing R with GPU accelerated in CentOS 7
来源:互联网 发布:嗟乎!是安知古谓廉者哉 编辑:程序博客网 时间:2024/05/20 18:03
Download R packages
Download packages from cran:gputools_1.0.tar.gz
wget https://cran.r-project.org/src/contrib/gputools_1.0.tar.gz
Install R Packages
First goto R and set work directory:
setwd("~")
config.status: creating src/Makefile** libs** arch - /usr/local/cuda/bin/nvcc -c -Xcompiler "-fpic -I/usr/local/include -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic" -I. -I"/usr/local/cuda-7.5/include" -I"/usr/lib64/R/include" rinterface.cu -o rinterface.ogcc: error: unrecognized command line option ‘-Wp’make: *** [rinterface.o] Error 1ERROR: compilation failed for package ‘gputools’
So, we need to hack the source code:
edit the Makefile, and change CFLAGS to :
CFLAGS = -O2 -g -pipe -Wall -Wp\,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic
Then
tar cvzf gputools_1.0.tar.gz /gputools_1.0.tar.gz
go into R and install the package:
install.packages("~/gputools.tar.gz", repos = NULL, type = "source")
Verify the installation
library(gputools)N <- 1e3m <- matrix(sample(100, size = N*N, replace = T), nrow = N)system.time(dist(m))system.time(gpuDist(m))
Results:
> library(gputools)> N <- 1e3> m <- matrix(sample(100, size = N*N, replace = T), nrow = N)> system.time(dist(m)) user system elapsed 6.289 0.005 6.293 > system.time(gpuDist(m)) user system elapsed 0.242 0.713 1.775
When using gpu, it saves much time.
[Reference]
Nvidia Blogs: accelerate-r-applications-cuda
Installing cuda toolkit and related R packages
0 0
- Playing R with GPU accelerated in CentOS 7
- GPU Accelerated Computing with Python
- GPU Accelerated Compositing in Chrome
- GPU Accelerated Compositing in Chrome
- CS 20SI|Lecture 7 Playing with convolutions in TensorFlow
- DeepSpeech: Accurate Speech Recognition with GPU-Accelerated DeepLearning
- chrome 硬件渲染(GPU Accelerated Compositing in Chrome)
- Some R functions while playing with the table
- Playing with stage.orientation in mobile AIR apps
- Playing Kinect 2 with ROS in Ubuntu 16.04: Hello World
- C++ AMP: .Massive Data Parallelism on the GPU with Microsoft's C++ AMP (Accelerated Massive Parallel
- GpuCV: GPU-accelerated Computer Vision
- Playing with DataGrid Control
- Playing with ptrace
- Playing with the Stack
- Playing with the Stack
- Playing with the stack
- playing with ptrace
- Oracle-34-if语句、case语句、loop循环、while循环、for循环
- 生活教会了我们什么?
- Hadoop新手学习指导
- VBA调用sqlserver带参数的存储过程
- WordPress 如何设置固定链接
- Playing R with GPU accelerated in CentOS 7
- 操作系统—处理器
- Unable to execute dex: Multiple dex files define
- USB hid通信 间隔报告的困扰
- Cannot send session cache limiter - headers already sent错误解决方法
- cocos2dx CCArray
- windows下AndroidStudio配置svn
- JAVA自带MD5实现数据加密
- Java 去除ArrayList集合中的重复元素。