Download the PHP package rindow/rindow-math-matrix-matlibffi without Composer
On this page you can find all versions of the php package rindow/rindow-math-matrix-matlibffi. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package rindow-math-matrix-matlibffi
Rindow Math Matrix's Drivers for Matlib with PHP FFI
This package is matlib drivers for Rindow-math-matrix. These drivers act as adapters to drive PHP FFI. Each PHP C Libraries requires a separate download and installation of a binary file appropriate for your environment's PHP version and OS version.
Rindow Math Matrix is the fundamental package for scientific matrix operation
- A powerful N-dimensional array object
- Sophisticated (broadcasting) functions
- Tools for integrating C/C++ through the FFI
- Useful linear algebra and random number capabilities
Please see the documents on Rindow mathematics projects web pages.
Rindow Math Matrix's repository is here.
Requirements
- PHP 8.1 or PHP8.2 or PHP8.3
- Rindow Math Matrix v2.0.0
- Rindow Matlib 1.0.0 or later
- OpenBLAS 0.3.20 or later
- OpenCL 1.1 or later
- CLBlast 1.5.2 or later
- Windows 10/11 or Linux(Ubuntu 20.04 or Debian 12 or later)
Download pre-build binaries from each projects
You can perform very fast N-dimensional array operations in conjunction. Download the pre-build binary files from each project's release page.
- Pre-build binaries
Setup for Windows
Download the binary file, unzip it, and copy it to the execution directory.
- rindow-matlib-X.X.X-win64.zip
- OpenBLAS-X.X.X-x64.zip
- CLBlast-X.X.X-windows-x64.zip
Add FFI extension to php.ini
The OpenCL 1.2 environment is already set up if you are using the Windows standard driver.
If you add the -v option as shown below, the driver loading status at boot time will be displayed. It will help with troubleshooting.
Setup for Linux
Install each library using the apt command.
Make sure FFI extension is enabled.
Download the pre-build binary file.
Please install using the apt command.
Since rindow-matlib currently uses OpenMP, choose the OpenMP version for OpenBLAS as well.
Using the pthread version of OpenBLAS can cause conflicts and become unstable and slow. This issue does not occur on Windows.
If you want to use GPU, install the OpenCL environment. In addition, there are the following drivers.
- mesa-opencl-icd
- beignet-opencl-icd
- intel-opencl-icd
- nvidia-opencl-icd-xxx
- pocl-opencl-icd
And then, Install the fast matrix calculation library for OpenCL. If you use Ubuntu22.04 or Debian 12 or later, You can install it from distribution packages.
If You use Ubuntu20.04 or Debian 11, You need to download clblast from Github and make deb file. Please download the CLBlast installation script from the rindow-clblast-ffi release page.
And then, Install the rindow-math-matrix on your project directory.
If you add the -v option as shown below, the driver loading status at boot time will be displayed. It will help with troubleshooting.
Check driver status
You can check the driver settings by running the sample below.
Troubleshooting for Linux
Since rindow-matlib currently uses OpenMP, choose the OpenMP version for OpenBLAS as well.
Using the pthread version of OpenBLAS can cause conflicts and become unstable and slow. This issue does not occur on Windows.
If you have already installed the pthread version of OpenBLAS,
But if you can't remove it, you can switch to it using the update-alternatives command.
If you really want to use the pthread version of OpenBLAS, please switch to the serial version of rindow-matlib.
There are no operational mode conflicts with OpenBLAS on Windows.
But, If you really want to use the pthread version of OpenBLAS, please switch to the serial version of rindow-matlib.
Choose the "rindowmatlib-serial".
Acceleration with GPU
You can use GPU acceleration on OpenCL.
Note:
This OpenCL support extension works better in your environment and helps speed up your laptop environment without n-NVIDIA.
Tested on Ivy-bridge and AMD's Bobcat architecture APU.
In the Windows environment, Integrated GPU usage was more effective than CPU, and it worked comfortably.
However, OLD AMD APU on Linux, libclc used in linux standard mesa-opencl-icd is very buggy and slow. If you have testable hardware, please test using the proprietary driver.
On the other hand, I tested with Ivy-bridge of Intel CPU and Integrated GPU.
It now works comfortably with various adjustments on Windows 10 Standard OpenCL Driver. However, the old Intel Integrated GPU is not very high compared to its CPU performance, so please use the right person in the right place.
And it worked fine and fast in Ubuntu 20.04 + beignet-opencl-icd environment.
All versions of rindow-math-matrix-matlibffi with dependencies
ext-ffi Version *
interop-phpobjects/polite-math Version ~1.0.7
rindow/rindow-math-matrix Version ~2.0.4
rindow/rindow-math-buffer-ffi Version ~1.0.2
rindow/rindow-openblas-ffi Version ~1.0.3
rindow/rindow-matlib-ffi Version ~1.0.1
rindow/rindow-opencl-ffi Version ~1.0.2
rindow/rindow-clblast-ffi Version ~1.0.2