Version of openpiv-python with the addition of GPU-accelerated functions. Compared to the CPU-bound functions, the GPU-accelerated modules perform much faster, making them suitable for large datasets. The GPU-acceleration is done using Nvidia's CUDA platform, so it can run only on machines with Nvidia GPUs.
OpenPIV-Python consists of Python modules for scripting and executing the analysis of a set of PIV image pairs. In addition, a Qt and Tk graphical user interfaces are in development, to ease the use for those users who don't have python skills.
The GPU functions of OpenPIV-Python is still in pre-beta state. This means that it still might have some bugs and the API may change. However, testing and contributing is welcome, especially if you can contribute with new algorithms and features.
Validation of the code for instantaneous and time averaged flow has been done, and a paper on that topic has been published.
Try the GPU functionality on Google Colab: Basic Tutorial. When viewing the file on GitHub there will be a link to view the notebook with Google Colab. Click the link to load the notebook into Colaboratory where you can test the GPU capabilities.
The GPU functions require the Nvidia CUDA toolkit, which is available for Windows or supported Linux kernels only.
Depending on your platform, the CUDA toolkit or the CUDA-related python packages (PyCUDA, scikit-cuda
) could be
problematic to install.
See the procedure in the last section for hel installing CUDA.
Install from GitHub using pip:
pip install git+https://github.com/OpenPIV/openpiv-python-gpu.git
To do a local installation, do:
git clone https://github.com/OpenPIV/openpiv-python-gpu.git
pip install -e path/to/openpiv-python-gpu
The OpenPIV documentation is available on the project web page at https://openpiv.readthedocs.org. For documentation of the GPU-accelerated modules, see API reference or the tutorial notebooks below.
Two tutorial notebooks demonstrate the usage of the GPU-accelerated functions:
Notebooks containing examples for non-GPU PIV functions are available in the base repository: OpenPIV-Python-Examples
Copyright statement: smoothn.py
is a Python version of smoothn.m
originally created by D. Garcia, written by Prof. Lewis and available on Github.
We include a version of it in the openpiv
folder for convenience and preservation. We are thankful to the original authors for releasing their work as an open source. OpenPIV license does not relate to this code. Please communicate with the authors regarding their license.
Dallas CA, Wu M, Chou VP, Liberzon A, Sullivan PE. GPU Accelerated Open Source Particle Image Velocimetry Software for High Performance Computing Systems. ASME. J. Fluids Eng. 2019. doi:10.1115/1.4043422.
Follow the instructions for installation at:
An easy way to get a working install of CUDA is to use Ubuntu 20.04 LTS, then install CUDA by:
sudo apt install nvida-cuda-toolkit
Note that CUDA toolkit installed on unsupported Linux kernels (i.e. not on this list) might not work correctly, even if PyCUDA appears to install without problems.
Update to the latest supported drivers:
https://www.nvidia.com/Download/index.aspx
Download CUDA from Nvidia website:
https://developer.nvidia.com/cuda-downloads
Visual Studio C++ compiler with CLI support needs to be installed before CUDA. It can be downloaded from:
https://visualstudio.microsoft.com/visual-cpp-build-tools/
Ensure that cl.exe is on your Windows PATH.
Follow the instructions for installation at: