|
1 | | -# rindow-clblast-ffi |
| 1 | +The CLBlast interface for FFI on PHP |
| 2 | +==================================== |
| 3 | +Status: |
| 4 | +[](https://github.com/rindow/rindow-clblast-ffi/actions) |
| 5 | +[](https://packagist.org/packages/rindow/rindow-clblast-ffi) |
| 6 | +[](https://packagist.org/packages/rindow/rindow-clblast-ffi) |
| 7 | +[](https://packagist.org/packages/rindow/rindow-clblast-ffi) |
| 8 | + |
| 9 | +"The CLBlast ffi" is a interface for the CLBlast library. Available in libraries with FFI interface. |
| 10 | + |
| 11 | +Please see the documents about Buffer objects on [Rindow Mathematics](https://rindow.github.io/mathematics/acceleration/opencl.html#rindow-clblast-ffi) web pages. |
| 12 | + |
| 13 | +Requirements |
| 14 | +============ |
| 15 | + |
| 16 | +- PHP 8.1 or PHP8.2 or PHP8.3 |
| 17 | +- CLBlast 1.5.1 or later |
| 18 | + |
| 19 | +How to setup OpenCL & CLBlast |
| 20 | +============================= |
| 21 | +You can download and setup pre-built CLBlast binaries. |
| 22 | +Please download the binaries for your platform. |
| 23 | + |
| 24 | +- https://github.com/CNugteren/CLBlast/releases |
| 25 | + |
| 26 | + |
| 27 | +### Windows |
| 28 | +CLBlast and OpenBLAS DLL's path to Windows PATH environment variable. |
| 29 | + |
| 30 | +```shell |
| 31 | +C:\tmp>PATH %PATH%;/path/to/OpenBLAS/bin;/path/to/CLBlast-Library/lib |
| 32 | +C:\tmp>cd /some/app/directory |
| 33 | +C:\app\dir>composer require rindow/rindow-clblast-ffi |
| 34 | +``` |
| 35 | + |
| 36 | +### Ubuntu |
| 37 | +On Linux, you first need to set up OpenCL. |
| 38 | + |
| 39 | +For example, in the case of Ubuntu standard AMD driver, install as follows |
| 40 | +```shell |
| 41 | +$ sudo apt install clinfo |
| 42 | +$ sudo apt install mesa-opencl-icd |
| 43 | +$ sudo mkdir -p /usr/local/usr/lib |
| 44 | +$ sudo ln -s /usr/lib/clc /usr/local/usr/lib/clc |
| 45 | +``` |
| 46 | +Ubuntu standard OpenCL drivers include: |
| 47 | +- mesa-opencl-icd |
| 48 | +- beignet-opencl-icd |
| 49 | +- intel-opencl-icd |
| 50 | +- nvidia-opencl-icd-xxx |
| 51 | +- pocl-opencl-icd |
| 52 | + |
| 53 | + |
| 54 | +Next, download and set up clbast. |
| 55 | + |
| 56 | +Download and Extract Archive file and Pack to deb |
| 57 | +```shell |
| 58 | +$ cd /some/app/directory |
| 59 | +$ composer require rindow/rindow-clblast-ffi |
| 60 | +$ cp vendor/rindow/rindow-clblast-ffi/clblast-packdeb.sh . |
| 61 | +$ sh ./clblast-packdeb.sh |
| 62 | +$ sudo apt install ./clblast_X.X.X-X+ubuntuXX.XX_amd64.deb |
| 63 | +``` |
| 64 | + |
0 commit comments