Skip to content

Build Instructions for Windows

khvorov45 edited this page Mar 1, 2019 · 9 revisions

Dependencies

There are a few dependencies that are required:

  1. An OpenCL SDK specific to your GPU vender (AMD, NVIDIA, Intel, etc.)
  2. OpenCL headers (likely part of your SDK in #1 but can be found at Khronos.org)
  3. Rtools (for compiling the C++ code)
  4. The environmental variables OPENCL_INC and OPENCL_LIB32/OPENCL_LIB64 pointing towards your opencl headers and opencl library (OpenCL.dll) respectively.

Installing an SDK

  • AMD - The latest AMD SDK on their website
  • NVIDIA - The latest CUDA SDK at NVIDIA
  • Intel - The latest Intel OpenCL runtimes on their website

You should be able to download and install your required SDK by following the installation instructions.

gpuR package install

If you haven't set your OPENCL_INC and OPENCL_LIB environmental variables globally on your machine you can easily set them within R with respect to your specific architecture.

Sys.setenv(OPENCL_INC = "/path/to/opencl/headers/")
Sys.setenv(OPENCL_LIB32 = "/path/to/opencl/library/x86")
Sys.setenv(OPENCL_LIB64 = "/path/to/opencl/library/x86_64")

PLEASE NOTE that you don't want to pass the CL path directory. You want the directory just above it so the configure script can work appropriately.

Intel OpenCL runtimes

Sys.setenv(OPENCL_INC   = "C:\\Intel\\OpenCL\\sdk\\include\\CL")
Sys.setenv(OPENCL_LIB32 = "C:\\Intel\\OpenCL\\sdk\\lib\\x86")
Sys.setenv(OPENCL_LIB64 = "C:\\Intel\\OpenCL\\sdk\\lib\\x64")

Then you should be able to install gpuR normally:

install.packages('gpuR')

Test

library('gpuR')

current <- currentDevice()
gpus <- detectGPUs()
has.double <- deviceHasDouble()

message(paste("gpu device", current[1], "gpus", gpus, "has double", has.double, sep = "\n"))