cdeterman / gpuR

R interface to use GPU's
241 stars 26 forks source link

Trouble installing package on CentOS 7.2 related to OpenCL #117

Open advocateddrummer opened 6 years ago

advocateddrummer commented 6 years ago

I'm new to R and OpenCL, so please be kind if I'm being a complete noob! I've looked at #58 and used some information I found there to get started.

I manage a high performance computing resource at my university and a user would like to use this package on the cluster. Each node has an NVIDIA Tesla P100 card in it: see below:

root@ts01 tmp]# git clone https://github.com/cdeterman/intel_opencl.git
Cloning into 'intel_opencl'...
remote: Counting objects: 20, done.
remote: Total 20 (delta 0), reused 0 (delta 0), pack-reused 20
Unpacking objects: 100% (20/20), done.
[root@ts01 tmp]# cd intel_opencl/
[root@ts01 intel_opencl]# g++ clDeviceQuery.cpp -o clDeviceQuery -L/cm/shared/apps/cuda80/toolkit/8.0.44/lib64 -lOpenCL
[root@ts01 tmp]# ./clDeviceQuery 
clDeviceQuery Starting...

1 OpenCL Platforms found

 CL_PLATFORM_NAME:      NVIDIA CUDA
 CL_PLATFORM_VERSION:   OpenCL 1.2 CUDA 8.0.44
OpenCL Device Info:

 1 devices found supporting OpenCL on: NVIDIA CUDA

 ----------------------------------
 Device Tesla P100-PCIE-16GB
 ---------------------------------
  CL_DEVICE_NAME:                       Tesla P100-PCIE-16GB
  CL_DEVICE_VENDOR:                     NVIDIA Corporation
  CL_DRIVER_VERSION:                    361.93.03
  CL_DEVICE_TYPE:                       CL_DEVICE_TYPE_GPU
  CL_DEVICE_MAX_COMPUTE_UNITS:          56
  CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS:   3
  CL_DEVICE_MAX_WORK_ITEM_SIZES:        1024 / 1024 / 64 
  CL_DEVICE_MAX_WORK_GROUP_SIZE:        1024
  CL_DEVICE_MAX_CLOCK_FREQUENCY:        1328 MHz
  CL_DEVICE_ADDRESS_BITS:               64
  CL_DEVICE_MAX_MEM_ALLOC_SIZE:         4070 MByte
  CL_DEVICE_GLOBAL_MEM_SIZE:            16280 MByte
  CL_DEVICE_ERROR_CORRECTION_SUPPORT:   no
  CL_DEVICE_LOCAL_MEM_TYPE:             local
  CL_DEVICE_LOCAL_MEM_SIZE:             48 KByte
  CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE:   64 KByte
  CL_DEVICE_QUEUE_PROPERTIES:           
  CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE
  CL_DEVICE_QUEUE_PROPERTIES:           CL_QUEUE_PROFILING_ENABLE
  CL_DEVICE_IMAGE_SUPPORT:              1
  CL_DEVICE_MAX_READ_IMAGE_ARGS:        256
  CL_DEVICE_MAX_WRITE_IMAGE_ARGS:       16

  CL_DEVICE_IMAGE <dim>                 2D_MAX_WIDTH     16384
                                        2D_MAX_HEIGHT    32768
                                        3D_MAX_WIDTH     16384
                                        3D_MAX_HEIGHT    16384
                                        3D_MAX_DEPTH     16384
  CL_DEVICE_PREFERRED_VECTOR_WIDTH_<t>  CHAR 1, SHORT 1, INT 1, FLOAT 1, DOUBLE 1

clDeviceQuery, Platform Name = NVIDIA CUDA, Platform Version = OpenCL 1.2 CUDA 8.0.44, NumDevs = 1, Device = Tesla P100-PCIE-16GB

However, when I try to install the package, below is what I get:

* installing *source* package ‘gpuR’ ...
** package ‘gpuR’ successfully unpacked and MD5 sums checked
OPENCL_FLAGS not set, using default -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS  -DCL_HPP_TARGET_OPENCL_VERSION=120
Linux OS
found OpenCL library
Checking OpenCL C++ API
OPENCL_INC not set, using default include directory /usr/include
No OpenCL C++ API found, will use the headers contained in the package

*********** Generated Makevars file ***********
CXX_STD=CXX11
PKG_CPPFLAGS=-I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/usr/include/' -I. -pthread
PKG_CXXFLAGS=
PKG_LIBS=-lOpenCL
BUILD_LIB=

$(SHLIB): $(BUILD_LIB)

../inst/include/loader/libOpenCL.a:
        cd ../inst/include/loader/ && $(MAKE) libOpenCL.a \
        CC="$(CC)" CFLAGS="$(ALL_CFLAGS)" AR="$(AR)" RM="$(RM)" \
        ICD_OS=icd_linux
***********************************************
** libs
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/usr/include/' -I. -pthread -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c RcppExports.cpp -o RcppExports.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/usr/include/' -I. -pthread -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c chol.cpp -o chol.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/usr/include/' -I. -pthread -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c context.cpp -o context.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/usr/include/' -I. -pthread -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c custom_math.cpp -o custom_math.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/usr/include/' -I. -pthread -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c device.cpp -o device.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/usr/include/' -I. -pthread -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c gpuEigenPtr.cpp -o gpuEigenPtr.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/usr/include/' -I. -pthread -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c gpuMatrix_igemm.cpp -o gpuMatrix_igemm.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/usr/include/' -I. -pthread -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c norm.cpp -o norm.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/usr/include/' -I. -pthread -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c platform.cpp -o platform.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/usr/include/' -I. -pthread -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c set_row_order.cpp -o set_row_order.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/usr/include/' -I. -pthread -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c solve.cpp -o solve.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/usr/include/' -I. -pthread -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c synchronize.cpp -o synchronize.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/usr/include/' -I. -pthread -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c trunc_gpuMat.cpp -o trunc_gpuMat.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/usr/include/' -I. -pthread -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c utils-vcl.cpp -o utils-vcl.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/usr/include/' -I. -pthread -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c utils.cpp -o utils.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/usr/include/' -I. -pthread -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c vclPtr.cpp -o vclPtr.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/usr/include/' -I. -pthread -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c vienna_blas1.cpp -o vienna_blas1.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/usr/include/' -I. -pthread -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c vienna_blas2.cpp -o vienna_blas2.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/usr/include/' -I. -pthread -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c vienna_blas3.cpp -o vienna_blas3.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/usr/include/' -I. -pthread -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c vienna_eigen.cpp -o vienna_eigen.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/usr/include/' -I. -pthread -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c vienna_qr.cpp -o vienna_qr.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/usr/include/' -I. -pthread -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c vienna_stats.cpp -o vienna_stats.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/usr/include/' -I. -pthread -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c vienna_svd.cpp -o vienna_svd.o
g++ -std=gnu++11 -shared -L/usr/local/lib64 -o gpuR.so RcppExports.o chol.o context.o custom_math.o device.o gpuEigenPtr.o gpuMatrix_igemm.o norm.o platform.o set_row_order.o solve.o synchronize.o trunc_gpuMat.o utils-vcl.o utils.o vclPtr.o vienna_blas1.o vienna_blas2.o vienna_blas3.o vienna_eigen.o vienna_qr.o vienna_stats.o vienna_svd.o -lOpenCL
/usr/bin/ld: cannot find -lOpenCL
collect2: error: ld returned 1 exit status
make: *** [gpuR.so] Error 1
ERROR: compilation failed for package ‘gpuR’
* removing ‘/cm/shared/apps/R/R-3.4.3/lib64/R/library/gpuR’

The downloaded source packages are in
        ‘/tmp/RtmpX5MP6V/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages("gpuR") :
  installation of package ‘gpuR’ had non-zero exit status

The line near the beginning: "found OpenCL library" seems to indicate that it knows where the library is, however, as you see at the end, it fails to link.

I'm using the CUDA 8.0 toolkit and modules to manage my environment, but I have a feeling that something isn't quite correct with my environment.

I have figured out how to fix this, but it's sort of hacky and I'm not sure if it's just my environment, or perhaps something that should be fixed/improved on your end? I have determined that if I set both the OPENCL_{INC,LIB} environment variables to /cm/shared/apps/cuda80/toolkit/8.0.44/{include,lib64} with Sys.setenv() and install on a compute node with a GPU installed the installation succeeds. I realize that your configure script looks for the CUDA_HOME variable, which my environment does not provide, mine has CUDA_PATH which matches what your CUDA_HOME variable should contain.

I am pretty sure that if I set the CUDA_HOME variable to match my environment's CUDA_PATH variable, the build would also succeed. I guess my question/issue is that the build seems to suggest that it finds the library, and then fails to link at the end. Is it just me or is that mis-leading?

I know this isn't exactly an issue, forgive me, but it did take me quite some time to work through this. Maybe it's all my fault, but if not, it may help future users.

cdeterman commented 6 years ago

Thanks for this report, I thought my configure script was taking care of this but something appears off. You are correct that it is looks for CUDA_HOME. It may be a good idea for me to add a section for CUDA_PATH as I believe that is another common configuration. I am still a little perplexed why the default section of my configure failed for you though. Can you provide the output of the following command?

ldconfig -p | grep 'libOpenCL\|lOpenCL' | wc -l
advocateddrummer commented 6 years ago

Please see below for your requested output. Thanks!

[root@qbert ~]# ldconfig -p | grep 'libOpenCL\|lOpenCL'
   libOpenCL.so.1 (libc6,x86-64) => /usr/lib64/nvidia/libOpenCL.so.1
   libOpenCL.so.1 (libc6,x86-64) => /usr/lib64/libOpenCL.so.1
   libOpenCL.so.1 (libc6) => /usr/lib/libOpenCL.so.1
   libOpenCL.so (libc6,x86-64) => /usr/lib64/nvidia/libOpenCL.so
   libOpenCL.so (libc6,x86-64) => /usr/lib64/libOpenCL.so
   libOpenCL.so (libc6) => /usr/lib/libOpenCL.so

[root@qbert ~]# ldconfig -p | grep 'libOpenCL|lOpenCL' | wc -l 6

On Mon, Mar 12, 2018 at 10:15 AM Charles Determan notifications@github.com wrote:

Thanks for this report, I thought my configure script was taking care of this but something appears off. You are correct that it is looks for CUDA_HOME. It may be a good idea for me to add a section for CUDA_PATH as I believe that is another common configuration. I am still a little perplexed why the default section of my configure failed for you though. Can you provide the output of the following command?

ldconfig -p | grep 'libOpenCL|lOpenCL' | wc -l

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/cdeterman/gpuR/issues/117#issuecomment-372324123, or mute the thread https://github.com/notifications/unsubscribe-auth/AAl2D7wZ7xNj3qi6ybpoOfw5nIAe03iPks5tdoL0gaJpZM4ShMoU .

cdeterman commented 6 years ago

I believe you need an ICD loader. For debian system I know it is ocl-icd-opencl-dev. For a CentOS system I believe you need ocl-icd-devel which you should be able to install with yum. Install that and try again to let me know if it works.

cdeterman commented 6 years ago

@advocateddrummer I have just recently spun up a docker image of centos 7 from nvidia's docker hub. You can find the dockerfile here. I made sure to use the CUDA 8.0 as you have on your system as well. I could reproduce the error and following install of yum install ocl-icd-devel the gpuR build completed without error. Please let me know if it does solve the problem on your actual machine so I know if this issue should be closed.

cdeterman commented 6 years ago

@advocateddrummer can you confirm whether this issue was resolved? If I don't hear from you in the next few days I will need to assume that it was resolved as all local tests I have run pass.

advocateddrummer commented 6 years ago

@cdeterman I'm sorry for the delay in responding; I've been snowed under. I've done what you suggested, i.e., yum install ocl-icd-devel followed immediately by starting R and running install.packages("gpuR") which fails for what seems to be a different reason. Please see below.

** testing if installed package can be loaded
Error: package or namespace load failed for ‘gpuR’:
 .onAttach failed in attachNamespace() for 'gpuR', details:
  call: initContexts()
  error: ViennaCL: FATAL ERROR: ViennaCL encountered an unknown OpenCL error. Most likely your OpenCL SDK or driver is not installed properly. In some cases, this error is due to an invalid global work size or several kernel compilation errors.
If you think that this is a bug in ViennaCL, please report it at viennacl-support@lists.sourceforge.net and supply at least the following information:
 * Operating System
 * Which OpenCL implementation (AMD, NVIDIA, etc.)
 * ViennaCL version
Many thanks in advance!
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/cm/shared/apps/R/R-3.4.3/lib64/R/library/gpuR’
* restoring previous ‘/cm/shared/apps/R/R-3.4.3/lib64/R/library/gpuR’

The downloaded source packages are in
        ‘/tmp/RtmpCqz1Bx/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages("gpuR") :
  installation of package ‘gpuR’ had non-zero exit status

Is this an unrelated error? Thanks for all help you've provided, I'll try to be more prompt hereafter. I'll be busy for most of the rest of this week, but should have time to spend on this next week.

cdeterman commented 6 years ago

@advocateddrummer hmm... can you see if it works if you set the environmental variable CUDA_HOME = CUDA_PATH?

I'm unsure about the icd thing at the moment. I thought it would work but perhaps your installation doesn't have the NVIDIA icd either? My initial guess would be to manually create the icd file to your nvidia opencl library. You likely would need to create the directory structure /etc/OpenCL/vendors and then execute the following (if my understanding of your setup correctly)

echo /cm/shared/apps/cuda80/toolkit/8.0.44/targets/x86_64-linux/lib/libOpenCL.so | tee /etc/OpenCL/vendors/nvidia.icd

But like I said, it may be more prudent to just try the different environmental variable first and see where we go from there.

advocateddrummer commented 6 years ago

Still no dice:

[root@os-hn ~]# export CUDA_HOME=$CUDA_PATH
[root@os-hn ~]# R

R version 3.4.3 (2017-11-30) -- "Kite-Eating Tree"
Copyright (C) 2017 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> install.packages("gpuR")
...
...
...
** testing if installed package can be loaded
Error: package or namespace load failed for ‘gpuR’:
 .onAttach failed in attachNamespace() for 'gpuR', details:
  call: initContexts()
  error: ViennaCL: FATAL ERROR: ViennaCL encountered an unknown OpenCL error. Most likely your OpenCL SDK or driver is not installed properly. In some cases, this error is due to an invalid global work size or several kernel compilation errors.
If you think that this is a bug in ViennaCL, please report it at viennacl-support@lists.sourceforge.net and supply at least the following information:
 * Operating System
 * Which OpenCL implementation (AMD, NVIDIA, etc.)
 * ViennaCL version
Many thanks in advance!
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/cm/shared/apps/R/R-3.4.3/lib64/R/library/gpuR’
* restoring previous ‘/cm/shared/apps/R/R-3.4.3/lib64/R/library/gpuR’

The downloaded source packages are in
        ‘/tmp/Rtmpgd95az/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages("gpuR") :
  installation of package ‘gpuR’ had non-zero exit status

Furthermore, the path you mention above does not exist on this host, I can only see

/cm/shared/apps/cuda80/toolkit/8.0.44/

i.e., the target subdirectory is not there. However, the libOpenCL.so file exists in

/cm/shared/apps/cuda80/toolkit/8.0.44/lib64/

I tried:

echo /cm/shared/apps/cuda80/toolkit/8.0.44/lib64/libOpenCL.so | tee /etc/OpenCL/vendors/nvidia.icd

as you mentioned, but I get the same error as above.

I'm sorry this has been such a hassle. Your help is sincerely appreciated.

cdeterman commented 6 years ago

@advocateddrummer Can you provide the configure output from the install? It would be the output in the ... you put in. Also include the first g++ call and the last one. I want to have a look at how the code is actually being compiled and the flags are set.

advocateddrummer commented 6 years ago

So sorry for the delay here. Please find below all the output I see when I try to install this package. Please note the environment setup up front; I copied it too so you'd know at least for now, that the $CUDA_HOME variable is set.

[root@os-hn ~]# export CUDA_HOME=$CUDA_PATH
[root@os-hn ~]# echo $CUDA_HOME            
/cm/shared/apps/cuda80/toolkit/8.0.44

install.packages("gpuR")
--- Please select a CRAN mirror for use in this session ---
Secure CRAN mirrors 

 1: 0-Cloud [https]                   2: Algeria [https]                
 3: Australia (Canberra) [https]      4: Australia (Melbourne 1) [https]
 5: Australia (Melbourne 2) [https]   6: Australia (Perth) [https]      
 7: Austria [https]                   8: Belgium (Ghent) [https]        
 9: Brazil (PR) [https]              10: Brazil (RJ) [https]            
11: Brazil (SP 1) [https]            12: Brazil (SP 2) [https]          
13: Bulgaria [https]                 14: Chile 1 [https]                
15: Chile 2 [https]                  16: China (Guangzhou) [https]      
17: China (Lanzhou) [https]          18: China (Shanghai) [https]       
19: Colombia (Cali) [https]          20: Czech Republic [https]         
21: Denmark [https]                  22: East Asia [https]              
23: Ecuador (Cuenca) [https]         24: Ecuador (Quito) [https]        
25: Estonia [https]                  26: France (Lyon 1) [https]        
27: France (Lyon 2) [https]          28: France (Marseille) [https]     
29: France (Montpellier) [https]     30: France (Paris 2) [https]       
31: Germany (Erlangen) [https]       32: Germany (Göttingen) [https]    
33: Germany (Münster) [https]        34: Greece [https]                 
35: Iceland [https]                  36: Indonesia (Jakarta) [https]    
37: Ireland [https]                  38: Italy (Padua) [https]          
39: Japan (Tokyo) [https]            40: Japan (Yonezawa) [https]       
41: Malaysia [https]                 42: Mexico (Mexico City) [https]   
43: Norway [https]                   44: Philippines [https]            
45: Serbia [https]                   46: Spain (A Coruña) [https]       
47: Spain (Madrid) [https]           48: Sweden [https]                 
49: Switzerland [https]              50: Turkey (Denizli) [https]       
51: Turkey (Mersin) [https]          52: UK (Bristol) [https]           
53: UK (Cambridge) [https]           54: UK (London 1) [https]          
55: USA (CA 1) [https]               56: USA (IA) [https]               
57: USA (KS) [https]                 58: USA (MI 1) [https]             
59: USA (NY) [https]                 60: USA (OR) [https]               
61: USA (TN) [https]                 62: USA (TX 1) [https]             
63: Vietnam [https]                  64: (other mirrors)                

Selection: 61
trying URL 'https://mirrors.nics.utk.edu/cran/src/contrib/gpuR_2.0.0.tar.gz'
Content type 'application/x-gzip' length 538276 bytes (525 KB)
==================================================
downloaded 525 KB

* installing *source* package ‘gpuR’ ...
** package ‘gpuR’ successfully unpacked and MD5 sums checked
OPENCL_FLAGS not set, using default -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS  -DCL_HPP_TARGET_OPENCL_VERSION=120
Linux OS
found OpenCL library
Checking OpenCL C++ API
OPENCL_INC not set, using default include directory /usr/include
cl2.hpp header exists

*********** Generated Makevars file ***********
CXX_STD=CXX11
PKG_CPPFLAGS=-I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/usr/include/' -DHAVE_CL_CL2_HPP
PKG_CXXFLAGS=
PKG_LIBS=-lOpenCL
BUILD_LIB=

$(SHLIB): $(BUILD_LIB)

../inst/include/loader/libOpenCL.a:
        cd ../inst/include/loader/ && $(MAKE) libOpenCL.a \
        CC="$(CC)" CFLAGS="$(ALL_CFLAGS)" AR="$(AR)" RM="$(RM)" \
        ICD_OS=icd_linux
***********************************************
** libs
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/usr/include/' -DHAVE_CL_CL2_HPP -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c RcppExports.cpp -o RcppExports.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/usr/include/' -DHAVE_CL_CL2_HPP -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c chol.cpp -o chol.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/usr/include/' -DHAVE_CL_CL2_HPP -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c context.cpp -o context.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/usr/include/' -DHAVE_CL_CL2_HPP -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c custom_math.cpp -o custom_math.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/usr/include/' -DHAVE_CL_CL2_HPP -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c device.cpp -o device.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/usr/include/' -DHAVE_CL_CL2_HPP -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c gpuEigenPtr.cpp -o gpuEigenPtr.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/usr/include/' -DHAVE_CL_CL2_HPP -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c gpuMatrix_igemm.cpp -o gpuMatrix_igemm.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/usr/include/' -DHAVE_CL_CL2_HPP -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c norm.cpp -o norm.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/usr/include/' -DHAVE_CL_CL2_HPP -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c platform.cpp -o platform.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/usr/include/' -DHAVE_CL_CL2_HPP -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c set_row_order.cpp -o set_row_order.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/usr/include/' -DHAVE_CL_CL2_HPP -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c solve.cpp -o solve.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/usr/include/' -DHAVE_CL_CL2_HPP -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c synchronize.cpp -o synchronize.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/usr/include/' -DHAVE_CL_CL2_HPP -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c trunc_gpuMat.cpp -o trunc_gpuMat.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/usr/include/' -DHAVE_CL_CL2_HPP -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c utils-vcl.cpp -o utils-vcl.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/usr/include/' -DHAVE_CL_CL2_HPP -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c utils.cpp -o utils.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/usr/include/' -DHAVE_CL_CL2_HPP -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c vclPtr.cpp -o vclPtr.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/usr/include/' -DHAVE_CL_CL2_HPP -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c vienna_blas1.cpp -o vienna_blas1.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/usr/include/' -DHAVE_CL_CL2_HPP -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c vienna_blas2.cpp -o vienna_blas2.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/usr/include/' -DHAVE_CL_CL2_HPP -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c vienna_blas3.cpp -o vienna_blas3.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/usr/include/' -DHAVE_CL_CL2_HPP -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c vienna_eigen.cpp -o vienna_eigen.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/usr/include/' -DHAVE_CL_CL2_HPP -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c vienna_qr.cpp -o vienna_qr.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/usr/include/' -DHAVE_CL_CL2_HPP -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c vienna_stats.cpp -o vienna_stats.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/usr/include/' -DHAVE_CL_CL2_HPP -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c vienna_svd.cpp -o vienna_svd.o
g++ -std=gnu++11 -shared -L/usr/local/lib64 -o gpuR.so RcppExports.o chol.o context.o custom_math.o device.o gpuEigenPtr.o gpuMatrix_igemm.o norm.o platform.o set_row_order.o solve.o synchronize.o trunc_gpuMat.o utils-vcl.o utils.o vclPtr.o vienna_blas1.o vienna_blas2.o vienna_blas3.o vienna_eigen.o vienna_qr.o vienna_stats.o vienna_svd.o -lOpenCL
installing to /cm/shared/apps/R/R-3.4.3/lib64/R/library/gpuR/libs
** R
** inst
** preparing package for lazy loading
Creating a generic function for ‘eigen’ from package ‘base’ in package ‘gpuR’
Creating a generic function for ‘%o%’ from package ‘base’ in package ‘gpuR’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘gpuR’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘gpuR’
Creating a generic function for ‘crossprod’ from package ‘base’ in package ‘gpuR’
Creating a generic function for ‘tcrossprod’ from package ‘base’ in package ‘gpuR’
Creating a generic function for ‘cov’ from package ‘stats’ in package ‘gpuR’
Creating a generic function for ‘colSums’ from package ‘base’ in package ‘gpuR’
Creating a generic function for ‘rowSums’ from package ‘base’ in package ‘gpuR’
Creating a generic function for ‘colMeans’ from package ‘base’ in package ‘gpuR’
Creating a generic function for ‘rowMeans’ from package ‘base’ in package ‘gpuR’
Creating a generic function for ‘dist’ from package ‘stats’ in package ‘gpuR’
Creating a generic function for ‘diag’ from package ‘base’ in package ‘gpuR’
Creating a generic function for ‘diag<-’ from package ‘base’ in package ‘gpuR’
Creating a generic function for ‘det’ from package ‘base’ in package ‘gpuR’
Creating a generic function for ‘norm’ from package ‘base’ in package ‘gpuR’
Creating a generic function for ‘qr.R’ from package ‘base’ in package ‘gpuR’
Creating a generic function for ‘qr.Q’ from package ‘base’ in package ‘gpuR’
Creating a generic function for ‘typeof’ from package ‘base’ in package ‘gpuR’
Creating a generic function for ‘colnames<-’ from package ‘base’ in package ‘gpuR’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
Error: package or namespace load failed for ‘gpuR’:
 .onAttach failed in attachNamespace() for 'gpuR', details:
  call: initContexts()
  error: ViennaCL: FATAL ERROR: ViennaCL encountered an unknown OpenCL error. Most likely your OpenCL SDK or driver is not installed properly. In some cases, this error is due to an invalid global work size or several kernel compilation errors.
If you think that this is a bug in ViennaCL, please report it at viennacl-support@lists.sourceforge.net and supply at least the following information:
 * Operating System
 * Which OpenCL implementation (AMD, NVIDIA, etc.)
 * ViennaCL version
Many thanks in advance!
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/cm/shared/apps/R/R-3.4.3/lib64/R/library/gpuR’
* restoring previous ‘/cm/shared/apps/R/R-3.4.3/lib64/R/library/gpuR’

The downloaded source packages are in
        ‘/tmp/RtmpjsL7zr/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages("gpuR") :
  installation of package ‘gpuR’ had non-zero exit status
cdeterman commented 6 years ago

@advocateddrummer It looks like the CUDA_HOME variable is not being found as you defined it in the current bash session. You would need to define it either in your .bashrc file or directly in the R session with Sys.setenv(). Try that and let me know if it helps. You should see something like the following when you try to install

OPENCL_FLAGS not set, using default -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS  -DCL_HPP_TARGET_OPENCL_VERSION=120
Linux OS
looking for OpenCL flags
using CUDA_HOME
cl.hpp header exists

In particular the using CUDA_HOME line.

advocateddrummer commented 6 years ago

@cdeterman I'm so sorry for all this back and forth. It feels like we're going around in circles, not making any progress. For what it's worth, I'm pasting the entire output of the install attempt again below. I don't want to continue wasting your time and I hope this isn't a PEBKAC error; is there any other relevant information that I could provide that might help here?

[root@os-hn ~]# echo $CUDA_PATH 
/cm/shared/apps/cuda80/toolkit/8.0.44
[root@os-hn ~]# R
> Sys.setenv(CUDA_HOME = "/cm/shared/apps/cuda80/toolkit/8.0.44")
> Sys.getenv("CUDA_HOME")
[1] "/cm/shared/apps/cuda80/toolkit/8.0.44"    
> install.packages("gpuR")
--- Please select a CRAN mirror for use in this session ---
Secure CRAN mirrors 

 1: 0-Cloud [https]                   2: Algeria [https]                
 3: Australia (Canberra) [https]      4: Australia (Melbourne 1) [https]
 5: Australia (Melbourne 2) [https]   6: Australia (Perth) [https]      
 7: Austria [https]                   8: Belgium (Ghent) [https]        
 9: Brazil (PR) [https]              10: Brazil (RJ) [https]            
11: Brazil (SP 1) [https]            12: Brazil (SP 2) [https]          
13: Bulgaria [https]                 14: Chile 1 [https]                
15: Chile 2 [https]                  16: China (Guangzhou) [https]      
17: China (Lanzhou) [https]          18: China (Shanghai) [https]       
19: Colombia (Cali) [https]          20: Czech Republic [https]         
21: Denmark [https]                  22: East Asia [https]              
23: Ecuador (Cuenca) [https]         24: Ecuador (Quito) [https]        
25: Estonia [https]                  26: France (Lyon 1) [https]        
27: France (Lyon 2) [https]          28: France (Marseille) [https]     
29: France (Montpellier) [https]     30: France (Paris 2) [https]       
31: Germany (Erlangen) [https]       32: Germany (Göttingen) [https]    
33: Germany (Münster) [https]        34: Greece [https]                 
35: Iceland [https]                  36: Indonesia (Jakarta) [https]    
37: Ireland [https]                  38: Italy (Padua) [https]          
39: Japan (Tokyo) [https]            40: Japan (Yonezawa) [https]       
41: Malaysia [https]                 42: Mexico (Mexico City) [https]   
43: Norway [https]                   44: Philippines [https]            
45: Serbia [https]                   46: Spain (A Coruña) [https]       
47: Spain (Madrid) [https]           48: Sweden [https]                 
49: Switzerland [https]              50: Turkey (Denizli) [https]       
51: Turkey (Mersin) [https]          52: UK (Bristol) [https]           
53: UK (Cambridge) [https]           54: UK (London 1) [https]          
55: USA (CA 1) [https]               56: USA (IA) [https]               
57: USA (KS) [https]                 58: USA (MI 1) [https]             
59: USA (NY) [https]                 60: USA (OR) [https]               
61: USA (TN) [https]                 62: USA (TX 1) [https]             
63: Vietnam [https]                  64: (other mirrors)                

Selection: 61
trying URL 'https://mirrors.nics.utk.edu/cran/src/contrib/gpuR_2.0.0.tar.gz'
Content type 'application/x-gzip' length 538276 bytes (525 KB)
==================================================
downloaded 525 KB

* installing *source* package ‘gpuR’ ...
** package ‘gpuR’ successfully unpacked and MD5 sums checked
OPENCL_FLAGS not set, using default -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS  -DCL_HPP_TARGET_OPENCL_VERSION=120
Linux OS
using CUDA_HOME
cl.hpp header exists

*********** Generated Makevars file ***********
CXX_STD=CXX11
PKG_CPPFLAGS=-I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/cm/shared/apps/cuda80/toolkit/8.0.44/include'
PKG_CXXFLAGS=
PKG_LIBS=-L/cm/shared/apps/cuda80/toolkit/8.0.44/lib64 -lOpenCL -Wl,-rpath,/cm/shared/apps/cuda80/toolkit/8.0.44/lib64
BUILD_LIB=

$(SHLIB): $(BUILD_LIB)

../inst/include/loader/libOpenCL.a:
        cd ../inst/include/loader/ && $(MAKE) libOpenCL.a \
        CC="$(CC)" CFLAGS="$(ALL_CFLAGS)" AR="$(AR)" RM="$(RM)" \
        ICD_OS=icd_linux
***********************************************
** libs
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/cm/shared/apps/cuda80/toolkit/8.0.44/include' -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c RcppExports.cpp -o RcppExports.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/cm/shared/apps/cuda80/toolkit/8.0.44/include' -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c chol.cpp -o chol.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/cm/shared/apps/cuda80/toolkit/8.0.44/include' -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c context.cpp -o context.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/cm/shared/apps/cuda80/toolkit/8.0.44/include' -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c custom_math.cpp -o custom_math.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/cm/shared/apps/cuda80/toolkit/8.0.44/include' -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c device.cpp -o device.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/cm/shared/apps/cuda80/toolkit/8.0.44/include' -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c gpuEigenPtr.cpp -o gpuEigenPtr.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/cm/shared/apps/cuda80/toolkit/8.0.44/include' -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c gpuMatrix_igemm.cpp -o gpuMatrix_igemm.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/cm/shared/apps/cuda80/toolkit/8.0.44/include' -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c norm.cpp -o norm.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/cm/shared/apps/cuda80/toolkit/8.0.44/include' -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c platform.cpp -o platform.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/cm/shared/apps/cuda80/toolkit/8.0.44/include' -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c set_row_order.cpp -o set_row_order.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/cm/shared/apps/cuda80/toolkit/8.0.44/include' -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c solve.cpp -o solve.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/cm/shared/apps/cuda80/toolkit/8.0.44/include' -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c synchronize.cpp -o synchronize.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/cm/shared/apps/cuda80/toolkit/8.0.44/include' -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c trunc_gpuMat.cpp -o trunc_gpuMat.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/cm/shared/apps/cuda80/toolkit/8.0.44/include' -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c utils-vcl.cpp -o utils-vcl.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/cm/shared/apps/cuda80/toolkit/8.0.44/include' -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c utils.cpp -o utils.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/cm/shared/apps/cuda80/toolkit/8.0.44/include' -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c vclPtr.cpp -o vclPtr.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/cm/shared/apps/cuda80/toolkit/8.0.44/include' -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c vienna_blas1.cpp -o vienna_blas1.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/cm/shared/apps/cuda80/toolkit/8.0.44/include' -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c vienna_blas2.cpp -o vienna_blas2.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/cm/shared/apps/cuda80/toolkit/8.0.44/include' -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c vienna_blas3.cpp -o vienna_blas3.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/cm/shared/apps/cuda80/toolkit/8.0.44/include' -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c vienna_eigen.cpp -o vienna_eigen.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/cm/shared/apps/cuda80/toolkit/8.0.44/include' -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c vienna_qr.cpp -o vienna_qr.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/cm/shared/apps/cuda80/toolkit/8.0.44/include' -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c vienna_stats.cpp -o vienna_stats.o
g++ -std=gnu++11 -I/cm/shared/apps/R/R-3.4.3/lib64/R/include -DNDEBUG -I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -fPIC -I'/cm/shared/apps/cuda80/toolkit/8.0.44/include' -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RcppEigen/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include" -I"/cm/shared/apps/R/R-3.4.3/lib64/R/library/BH/include" -I/usr/local/include   -fpic  -g -O2 -c vienna_svd.cpp -o vienna_svd.o
g++ -std=gnu++11 -shared -L/usr/local/lib64 -o gpuR.so RcppExports.o chol.o context.o custom_math.o device.o gpuEigenPtr.o gpuMatrix_igemm.o norm.o platform.o set_row_order.o solve.o synchronize.o trunc_gpuMat.o utils-vcl.o utils.o vclPtr.o vienna_blas1.o vienna_blas2.o vienna_blas3.o vienna_eigen.o vienna_qr.o vienna_stats.o vienna_svd.o -L/cm/shared/apps/cuda80/toolkit/8.0.44/lib64 -lOpenCL -Wl,-rpath,/cm/shared/apps/cuda80/toolkit/8.0.44/lib64
installing to /cm/shared/apps/R/R-3.4.3/lib64/R/library/gpuR/libs
** R
** inst
** preparing package for lazy loading
Creating a generic function for ‘eigen’ from package ‘base’ in package ‘gpuR’
Creating a generic function for ‘%o%’ from package ‘base’ in package ‘gpuR’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘gpuR’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘gpuR’
Creating a generic function for ‘crossprod’ from package ‘base’ in package ‘gpuR’
Creating a generic function for ‘tcrossprod’ from package ‘base’ in package ‘gpuR’
Creating a generic function for ‘cov’ from package ‘stats’ in package ‘gpuR’
Creating a generic function for ‘colSums’ from package ‘base’ in package ‘gpuR’
Creating a generic function for ‘rowSums’ from package ‘base’ in package ‘gpuR’
Creating a generic function for ‘colMeans’ from package ‘base’ in package ‘gpuR’
Creating a generic function for ‘rowMeans’ from package ‘base’ in package ‘gpuR’
Creating a generic function for ‘dist’ from package ‘stats’ in package ‘gpuR’
Creating a generic function for ‘diag’ from package ‘base’ in package ‘gpuR’
Creating a generic function for ‘diag<-’ from package ‘base’ in package ‘gpuR’
Creating a generic function for ‘det’ from package ‘base’ in package ‘gpuR’
Creating a generic function for ‘norm’ from package ‘base’ in package ‘gpuR’
Creating a generic function for ‘qr.R’ from package ‘base’ in package ‘gpuR’
Creating a generic function for ‘qr.Q’ from package ‘base’ in package ‘gpuR’
Creating a generic function for ‘typeof’ from package ‘base’ in package ‘gpuR’
Creating a generic function for ‘colnames<-’ from package ‘base’ in package ‘gpuR’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
Error: package or namespace load failed for ‘gpuR’:
 .onAttach failed in attachNamespace() for 'gpuR', details:
  call: initContexts()
  error: ViennaCL: FATAL ERROR: ViennaCL encountered an unknown OpenCL error. Most likely your OpenCL SDK or driver is not installed properly. In some cases, this error is due to an invalid global work size or several kernel compilation errors.
If you think that this is a bug in ViennaCL, please report it at viennacl-support@lists.sourceforge.net and supply at least the following information:
 * Operating System
 * Which OpenCL implementation (AMD, NVIDIA, etc.)
 * ViennaCL version
Many thanks in advance!
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/cm/shared/apps/R/R-3.4.3/lib64/R/library/gpuR’
* restoring previous ‘/cm/shared/apps/R/R-3.4.3/lib64/R/library/gpuR’

The downloaded source packages are in
        ‘/tmp/Rtmpj8u2rM/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages("gpuR") :
  installation of package ‘gpuR’ had non-zero exit status
cdeterman commented 6 years ago

@advocateddrummer odd... Let's try something else a little simpler. Can you compile the following small c++ script?

#include <iostream>
#define VIENNACL_WITH_OPENCL 1
#include "viennacl/ocl/platform.hpp"

int main(void) {
  std::cout << viennacl::ocl::get_platforms().size() << std::endl;
  return 0;
}
g++ platforms_vcl.cpp -o platforms_vcl -L/cm/shared/apps/cuda80/toolkit/8.0.44/lib64 -lOpenCL
./platforms_vcl

See what number this returns.

advocateddrummer commented 6 years ago

Please see below @cdeterman, I'm unable to get this to compile. There are libOpenCL.so files in the directory you specified so it's not that the library doesn't exisit. Furthermore, as you'll see, I had to do some exploring to get all the includes right. Clearly, my environment isn't set up quite right for this compile command. Does this mean that I don't have the proper version of OpenCL installed?

g++ platforms_vcl.cpp -o platforms_vcl -L /cm/shared/apps/cuda80/toolkit/8.0.44/lib64/ -l OpenCL -I/cm/shared/apps/R/R-3.4.3/lib64/R/library/RViennaCL/include/ -I/cm/shared/apps/R/R-3.4.3/lib64/R/library/Rcpp/include -I /cm/shared/apps/R/R-3.4.3/lib64/R/include/
/tmp/ccy17Cgk.o: In function `Rcpp::Rstreambuf<true>::xsputn(char const*, long)':
platforms_vcl.cpp:(.text._ZN4Rcpp10RstreambufILb1EE6xsputnEPKcl[_ZN4Rcpp10RstreambufILb1EE6xsputnEPKcl]+0x2a): undefined reference to `Rprintf'
/tmp/ccy17Cgk.o: In function `Rcpp::Rstreambuf<false>::xsputn(char const*, long)':
platforms_vcl.cpp:(.text._ZN4Rcpp10RstreambufILb0EE6xsputnEPKcl[_ZN4Rcpp10RstreambufILb0EE6xsputnEPKcl]+0x2a): undefined reference to `REprintf'
/tmp/ccy17Cgk.o: In function `Rcpp::Rstreambuf<true>::sync()':
platforms_vcl.cpp:(.text._ZN4Rcpp10RstreambufILb1EE4syncEv[_ZN4Rcpp10RstreambufILb1EE4syncEv]+0xd): undefined reference to `R_FlushConsole'
/tmp/ccy17Cgk.o: In function `Rcpp::Rstreambuf<false>::sync()':
platforms_vcl.cpp:(.text._ZN4Rcpp10RstreambufILb0EE4syncEv[_ZN4Rcpp10RstreambufILb0EE4syncEv]+0xd): undefined reference to `R_FlushConsole'
collect2: error: ld returned 1 exit status
cdeterman commented 6 years ago

@advocateddrummer my apologies, in my haste I overlooked that you would only have the viennacl headers in the RViennaCL package. Please try the following.

git clone https://github.com/viennacl/viennacl-dev.git
g++ platforms_vcl.cpp -o platforms_vcl -L/cm/shared/apps/cuda80/toolkit/8.0.44/lib64/ -lOpenCL -I/viennacl-dev/
./platforms_vcl
advocateddrummer commented 6 years ago

@cdeterman I'm confused; this package from github does not provide any of the headers I was missing (or had to find) nor does it seem to provide any missing libraries.

Am I missing something?

cdeterman commented 6 years ago

@advocateddrummer That is correct, the package I instructed you to clone is the original ViennaCL headers that don't have any of the R modifications and therefore won't require any of the extra dependencies. I want as trimmed down of any example to figure out exactly where the problem is. The platforms_vcl.cpp file should only contain C++ code and not require the other R libraries. The g++ call I provided should compile the script. Is if failing?

advocateddrummer commented 6 years ago

@cdeterman, I'm so sorry, that's my bad. I copied and pasted without paying enough attention. I didn't modify the new include to point proper directory (I didn't notice the leading /).

Now, I'm able to compile it, but this is what I get when I run the executable:

[root@os-hn tmp]# cat platforms_vcl.cpp 
#include <iostream>
#define VIENNACL_WITH_OPENCL 1
#include "viennacl/ocl/platform.hpp"

int main(void) {
  std::cout << viennacl::ocl::get_platforms().size() << std::endl;
  return 0;
}
[root@os-hn tmp]# g++ platforms_vcl.cpp -o platforms_vcl -L/cm/shared/apps/cuda80/toolkit/8.0.44/lib64/ -lOpenCL -I/tmp/viennacl-dev/
[root@os-hn tmp]# ./platforms_vcl 
terminate called after throwing an instance of 'viennacl::ocl::unknown_error'
  what():  ViennaCL: FATAL ERROR: ViennaCL encountered an unknown OpenCL error. Most likely your OpenCL SDK or driver is not installed properly. In some cases, this error is due to an invalid global work size or several kernel compilation errors.
If you think that this is a bug in ViennaCL, please report it at viennacl-support@lists.sourceforge.net and supply at least the following information:
 * Operating System
 * Which OpenCL implementation (AMD, NVIDIA, etc.)
 * ViennaCL version
Many thanks in advance!
Aborted (core dumped)
cdeterman commented 6 years ago

@advocateddrummer It does appear that your OpenCL installation is not correct then (at least in the 80 toolkit you are linking to). Perhaps you can try compiling against the other OpenCL libraries you initially found with the grep call above. Try the following call:

g++ platforms_vcl.cpp -o platforms_vcl -L/usr/lib64/nvidia/ -lOpenCL -I/tmp/viennacl-dev
./platforms_vcl
advocateddrummer commented 6 years ago

@cdeterman, This doesn't work either. I really think I must be missing something simple here and that we're making this more difficult than in should be.

I'm going to try to look into this further on my own so as to not waste more of your time. I have a feeling that there is a stupid environment issue going on here that you have no control over and only I will be able to figure out.

I'll close the issue if you'd like, or you can. Or, you can keep in open if you like.

Once again, I'm very sorry for wasting your time; I'll be looking into this further as I'm able.

cdeterman commented 6 years ago

@advocateddrummer I'm sorry to hear it is still a problem. We can leave the issue open for now and perhaps close at a later date. If you do happen to resolve the OpenCL configuration please report back here. I know OpenCL installs can be tricky and I want to always hear how people resolve different situations.

mjmg commented 6 years ago

I encountered a similar error on my CENTOS docker container a while ago.

You need to set a lot of environment variables, symlinks and fix the ICD loader. https://github.com/cdeterman/gpuR/issues/66

As mentioned here: https://github.com/cdeterman/gpuR/issues/117#issuecomment-375416987

echo /cm/shared/apps/cuda80/toolkit/8.0.44/lib64/libOpenCL.so | tee /etc/OpenCL/vendors/nvidia.icd

there is a correction. The nvidia icd loader should be: libnvidia-opencl.so.1 not libOpenCL.so

Here is an excerpt of my Dockerfile then to see if you missed anything:

# Setup NVIDIA CUDA runtime
# From https://gitlab.com/nvidia/cuda/blob/centos7/8.0/runtime/Dockerfile
# LABEL maintainer "NVIDIA CORPORATION <cudatools@nvidia.com>"

RUN NVIDIA_GPGKEY_SUM=d1be581509378368edeec8c1eb2958702feedf3bc3d17011adbf24efacce4ab5 && \
    curl -fsSL https://developer.download.nvidia.com/compute/cuda/repos/rhel7/x86_64/7fa2af80.pub | sed '/^Version/d' > /etc/pki/rpm-gpg/RPM-GPG-KEY-NVIDIA && \
    echo "$NVIDIA_GPGKEY_SUM  /etc/pki/rpm-gpg/RPM-GPG-KEY-NVIDIA" | sha256sum -c --strict -

COPY cuda.repo /etc/yum.repos.d/cuda.repo

ENV CUDA_VERSION 8.0.61

ENV CUDA_PKG_VERSION 8-0-$CUDA_VERSION-1

RUN yum install -y \
        cuda-nvrtc-$CUDA_PKG_VERSION \
        cuda-nvgraph-$CUDA_PKG_VERSION \
        cuda-cusolver-$CUDA_PKG_VERSION \
        cuda-cublas-8-0-8.0.61.2-1 \
        cuda-cufft-$CUDA_PKG_VERSION \
        cuda-curand-$CUDA_PKG_VERSION \
        cuda-cusparse-$CUDA_PKG_VERSION \
        cuda-npp-$CUDA_PKG_VERSION \
        cuda-cudart-$CUDA_PKG_VERSION && \
    ln -s cuda-8.0 /usr/local/cuda && \
    rm -rf /var/cache/yum/*

# nvidia-docker 1.0
LABEL com.nvidia.volumes.needed="nvidia_driver"
LABEL com.nvidia.cuda.version="${CUDA_VERSION}"

RUN echo "/usr/local/nvidia/lib" >> /etc/ld.so.conf.d/nvidia.conf && \
    echo "/usr/local/nvidia/lib64" >> /etc/ld.so.conf.d/nvidia.conf

ENV PATH /usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH}

# Library Path at RUN time
ENV LD_LIBRARY_PATH /usr/local/nvidia/lib:/usr/local/nvidia/lib64

# nvidia-container-runtime
ENV NVIDIA_VISIBLE_DEVICES all
ENV NVIDIA_DRIVER_CAPABILITIES all
#compute,utility
ENV NVIDIA_REQUIRE_CUDA "cuda>=8.0"

# Setup NVIDIA CUDA devel
# From https://gitlab.com/nvidia/cuda/blob/centos7/8.0/devel/Dockerfile
RUN yum install -y \
        cuda-core-$CUDA_PKG_VERSION \
        cuda-misc-headers-$CUDA_PKG_VERSION \
        cuda-command-line-tools-$CUDA_PKG_VERSION \
        cuda-license-$CUDA_PKG_VERSION \
        cuda-nvrtc-dev-$CUDA_PKG_VERSION \
        cuda-nvml-dev-$CUDA_PKG_VERSION \
        cuda-nvgraph-dev-$CUDA_PKG_VERSION \
        cuda-cusolver-dev-$CUDA_PKG_VERSION \
        cuda-cublas-dev-$CUDA_PKG_VERSION \
        cuda-cufft-dev-$CUDA_PKG_VERSION \
        cuda-curand-dev-$CUDA_PKG_VERSION \
        cuda-cusparse-dev-$CUDA_PKG_VERSION \
        cuda-npp-dev-$CUDA_PKG_VERSION \
        cuda-cudart-dev-$CUDA_PKG_VERSION \
        cuda-driver-dev-$CUDA_PKG_VERSION && \
    rm -rf /var/cache/yum/*

# Configure NVIDIA/CUDA OpenCL settings
RUN mkdir -p /etc/OpenCL/vendors && \
    echo "libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd

RUN \
    ln -s /usr/local/cuda/lib64/libOpenCL.so /usr/lib64/libOpenCL.so 

# Library Path at BUILD time
ENV LIBRARY_PATH /usr/local/cuda/lib64/stubs:${LIBRARY_PATH}

#RUN \
#  ln -s /usr/local/cuda/lib64/stubs/libcuda.so /usr/local/cuda/lib64/libcuda.so.1 && \
#  ldconfig

ENV CUDA_HOME /usr/local/cuda
ENV OPENCL_LIB /usr/local/cuda/lib64/

#install additional tools and library prerequisites for additional packages
RUN \
  yum install -y opencl-headers

cuda.repo contains:

[cuda]
name=cuda
baseurl=http://developer.download.nvidia.com/compute/cuda/repos/rhel7/x86_64
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-NVIDIA