cdeterman / gpuR

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

Installing on Ubuntu 16.04 ppc64le #81

Open nasica88 opened 7 years ago

nasica88 commented 7 years ago

Hello,

I see that gpuR is not yet formally ported on ppc64le (IBM POWER8), but I am giving it a try. The initial effort ended in an error like below.

../inst/include/CL/cl_platform.h:390:12: error: ‘vector’ does not name a type typedef vector unsigned char __cl_uchar16; ^

This error was easily solved by changing "typedef vector" in gpuR/inst/include/CL/cl_platform.h into "typedef __vector".

However, I ran into another trouble now after this stage, like below. Can you help me thru this, please ?

/usr/include/c++/5/bits/cpp_type_traits.h:98:24: error: expected primary-expression before ‘attribute’ enum { value = bool(_Sp::__value) || bool(_Tp::value) }; ^

Cheers,

cdeterman commented 7 years ago

@nasica88 I am actually in the process of getting gpuR portable to power8. You are correct to note the typedef vector problem. I have gotten the package to build successfully but the OpenCL library on those systems (which comes from NVIDIA) is not fully functional so unfortunately this is at a standstill at the moment. From what I have understood from those at IBM is that NVIDIA never fully implemented their OpenCL library for power8 as I guess they assumed everyone would just use CUDA. I am currently waiting to hear back again now as they were reaching out to their NVIDIA contacts. I will provide any further updates here.

cdeterman commented 7 years ago

@nasica88 I have just heard back and the OpenCL library on the systems is an artifact and therefore not functional. I am also told that NVIDIA has no intention of porting their OpenCL to those systems. As such, gpuR cannot be installed on there until such a time that a OpenCL platform is installed such as pocl.

Note, I do have my companion gpuRcuda package but it isn't ready for release or much use yet at this time. It still needs quite a bit of work as I have spent most of my time working on the most portable package.

nasica88 commented 7 years ago

What a sad finding ! I hope your gpuRcuda should be ready soon and rule the town.

cdeterman commented 7 years ago

@nasica88 an update regarding this. I have been working with people at IBM and we have discovered that we can leverage pocl to utilize OpenCL with the NVIDIA devices. I have just recently confirmed that the gpuR objects work as expected. They are currently working on a cluster wide install. Will update once have further updates.

nasica88 commented 7 years ago

@cdeterman It's great to hear that. Looking forward to seeing your update soon. Thanks.

cdeterman commented 7 years ago

@nasica88 I have been informed that it is now globally installed. You should now be able to load the package when you open an R session. A quick point, be sure to note which context you are using because the default with the pocl implementation is using the CPU. Please confirm if you are successful so I may close this issue.

nasica88 commented 7 years ago

@cdeterman Can you describe the prerequisites for the installation more in detail, pls ? I tested just now on Ubuntu 16.04 LTS ppc64le, but it seems it fails in the same location.

$ R

R version 3.3.2 (2016-10-31) -- "Sincere Pumpkin Patch"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: powerpc64le-unknown-linux-gnu (64-bit)

> install.packages("gpuR")
Installing package into ‘/usr/local/lib/R/site-library’
...
In file included from ../inst/include/CL/cl.h:35:0,
                 from /usr/local/lib/R/site-library/RViennaCL/include/viennacl/ocl/context.hpp:28,
                 from /usr/local/lib/R/site-library/RViennaCL/include/viennacl/ocl/backend.hpp:26,
                 from chol.cpp:5:
../inst/include/CL/cl_platform.h:390:12: error: ‘vector’ does not name a type
    typedef vector unsigned char     __cl_uchar16;
            ^
...

I tried installing pocl first, but pocl itself fails with the following messages.

~/pocl/build$ make
...
In file included from /usr/lib/llvm-3.8/include/llvm/Support/DataTypes.h:35:0,
                 from /usr/lib/llvm-3.8/include/llvm/ADT/Hashing.h:48,
                 from /usr/lib/llvm-3.8/include/llvm/ADT/ArrayRef.h:13,
                 from /usr/lib/llvm-3.8/include/llvm/IR/IRBuilder.h:18,
                 from /home/mirhenge/pocl/lib/llvmopencl/Kernel.cc:31:
/usr/include/c++/5/cmath: In function ‘constexpr __vector(4) __bool int std::isfinite(float)’:
/usr/include/c++/5/cmath:587:34: error: cannot convert ‘int’ to ‘__vector(4) __bool int’ in return
   { return __builtin_isfinite(__x); }
                                  ^

Thanks in advance.

cdeterman commented 7 years ago

I was told by the staff that the user needs to simply load the R module (module load R) and then the package should be available and installed correctly. You should not need to install it yourself.

nasica88 commented 7 years ago

@cdeterman Perhaps it's just me, but it might be there is some misunderstanding. As far as I understand, 'module load R' simply provides for the dynamic modification of the user's environment, which has to be defined by the user. It does not do anything fundamental or incorporates pocl into R by itself.
I'd be much obliged if you can communicate with the IBM staff on the detailed procedure on how to make gpuR work, with or without installing pocl. Thanks !

ironv commented 7 years ago

I too would like to use gpuR on a IBM Minsky box; I am getting the exact same errors that @nasica88 has been reporting. Note sure how to use the module load R approach suggested by @cdeterman. Thx.

cdeterman commented 7 years ago

To all those interested, I have recently heard from IBM they will be publishing how to setup the servers to allow the use of gpuR. They haven't committed to a timeline but as soon as they provide this documentation I will be sure to link to it here.

nasica88 commented 6 years ago

@cdeterman Any progress with gpuR on ppc64le ?

cdeterman commented 6 years ago

@nasica88 I never heard back from IBM. I just sent out another email reaching back out to them to inquire about the status of this. I will report back when I hear anything.

cdeterman commented 6 years ago

@nasica88 IBM has notified me that no progress was made as the department shifted focus. The recommendation is to simply build pocl yourself for the install to work properly. The pocl install docs can be found here. Sorry it came to a rather unexciting conclusion.