OpenCL (Open Computing Language) is an interface for non-uniform parallel computing units, e.g. main, graphic or signal processors. With RealFlow 2013 we added OpenCL support for Hybrido simulations. Other RealFlow solvers (SPH, HySPH, Caronte and RealWave) are currently not supported and do not provide interfaces to OpenCL. One huge advantage of the OpenCL system is that it is platform-independent and available for all major operating systems.
The minimum requirement for GPU support is a graphic device with OpenCL 1.1. Due to the almost infinite number of hardware configurations, drivers and system specifications it is actually impossible to guarantee that every graphic device can be used for Hybrido simulations. To check whether your device is supported by RealFlow, please open the “Simulation Options” panel (it can be opened when you click on the little triangle next to the “Simulate” button), under “Hybrido” you will find a section called “OpenCL”.
RealFlow provides support for CPU-, GPU-based and OpenCL accelerator devices. By default, RealFlow detects these devices automatically and activates their associated checkboxes. More information about the specifications can be found when you click on the “System information…” button. The window which opens contains detailed information about the detected devices and their computation capabilities.
There is one important note about RealFlow's OpenCL implementation: At the moment, this technology should be considered experimental and it strongly depends on the used hardware, drivers, and operating system. There might be cases where GPUs are not taken into account and in this case you will most probably see a slight increase of simulation time – typically a few seconds per frame. Even if RealFlow's “System information...” button suggests that your graphic board can be used, there is unfortunately no guarantee that it will contribute to a simulation.
How to Use RealFlow’s OpenCL Implementation
There are two main methods to activate RealFlow OpenCL support. The first, is to enable the available OpenCL devices globally under
Preferences > Simulation > Hybrido
“Globally” means that this feature will always be enabled and you do not have to activate it when you create a new project. The second method is to choose whether you want to use OpenCL or not for each scene individually with the previously mentioned “Simulation Options”. The settings here will overwrite your adjustments from the “Preferences”, so even if you have activated OpenCL globally, you can turn it off for the currently loaded scene.
Another important step is to activate the Hybrido domain's “Dense” mode which is perfectly suited and optimised for GPU-based simulations. “Dense” will require more memory than the “Adaptive” or “Sparse” modes, but it is also significantly faster (20-35%). You can change the mode here:
HY_Domain > Grid > Creation mode > Dense
This is already the entire procedure and once OpenCL is enabled, RealFlow will use the appropriate devices for your Hybrido simulation. To mention it again: other simulations, e.g. standard particles or body dynamics, do not profit from this feature.
The Impact of OpenCL
Of course, the main reason for OpenCL-supported simulations is to increase simulation speed. The real influence of OpenCL can be seen in processes where Hybrido particles are involved: simulations with a high number of particles (compared to the number of cells) will normally perform better than scenes with small “Cell size” and low “Particle sampling” values. Generally, the final influence of the OpenCL device strongly depends on your scene setup and settings and it is not possible to predict the effect on simulation times globally.
Other Hybrido processes, like the creation of the fluid’s distance field or displacement are not accelerated by your computer’s OpenCL devices – this also applies for the generation of Hybrido secondary elements (splash, foam, mist). This is, aside from the used hardware, another reason for a limited impact of graphic boards.