The very first 100% free GPU accelerated SPH simulation ever!

Gallium compute tools are constantly improving… So much… At a point that if you have an AMD graphic card you should consider stop using Catalyst (or even Crimson), and move to the free driver:

OpenCL man!!!

Of course AQUAgpusph must not be  unaware of this revolution. In the branch 2.2 I adapted the OpenCL tools to work smoothly with LLVM-CLang and libclc… Here what I get with my AMD R9 290:

Performance for the first 100% free GPU accelerated SPH example

In the previous image the performance for the 2D TLD example is shown. The grey line is the instantaneous time consumed per time step, the black solid line is the average value, while the dashed lines are denoting its variance.

I also added a red dashed line to represent the point of the simulation where I modified the working profile of the graphic card, an awesome superpower of the Open Source drivers:

echo "performance" > \
  /sys/class/drm/card0/device/power_dpm_state
echo "high" > \
  /sys/class/drm/card0/device/power_dpm_force_performance_level

As far as I know, this is the very first SPH simulation, accelerated with a GPU, carried out without a single line of non-free software!!! (not even the OS, the framework, the driver, or the ICD loader!!!)

In Ubuntu 15.10, If you have a relatively old hardware, you may use the launchpad repository of Oibaf, purging fglrx and installing LLVM, CLang, libclc (with libclc-r600), and  mesa-opencl-icd. Otherwise you should manually download and install them, something that can be done with the following bash script:

# =============================================================
#!/bin/bash

git clone http://llvm.org/git/llvm.git
cd llvm/tools
git clone http://llvm.org/git/clang.git
cd ../..
git clone http://llvm.org/git/libclc.git
git clone git://anongit.freedesktop.org/mesa/mesa

cd llvm/
mkdir build
cd build/
../configure --enable-targets=x86,amdgpu,r600 --enable-shared \
    --enable-optimized --prefix=/usr
make -j4
sudo make install
cd ../../

cd libclc/
./configure.py --prefix=/usr \
    --pkgconfigdir=/usr/share/pkgconfig/
make clean
make -j4
sudo make install
cd ..

cd mesa
PKG_CONFIG_PATH=/usr/share/pkgconfig/ ./autogen.sh \
    --prefix=/usr --with-dri-drivers="" \
    --with-gallium-drivers=r600,radeonsi \
    --with-egl-platforms=drm --enable-opencl \
    --enable-opencl-icd --disable-dri3
make -j4
sudo make install
# =============================================================

Probably several dependencies will be required to be installed during the process (all of them available trough apt-get).

In Ubuntu 16.04 all this process is probably becoming unnecessary, working “out of the box” with the packages included in the default repositories (it’s something to hope for).

SPHERIC 2015

As usual, in June I’m attending to SPHERIC workshop. This year we are presenting a very interesting coupled system.

You may find my slides here:

http://canal.etsin.upm.es/aquagpusph/gallery/index.php?/category/5


Also this year it is a little bit special, because while I’m presenting this work in the SPHERIC, Antonio Souto-Iglesias is presenting that in OMAE, and Gabriele Bulian in STAB!

Let’s get some feedback to publish something in a Journal!

Is not Version 2.0 ready for production??

To answer it is mandatory to say that AQUAgpusph-2.0 is widely different from the previous versions, moreover, it is extremely different from any other already existing SPH code (as far as I know). More specifically, AQUAgpusph-2.0 is designed as a sand box, where the behavior of the tool can be modified just typing a couple of lines in the simulation input files, and maybe some OpenCL kernels. It is not required anymore to modify the C++ kernel code, or to recompile the software either.

With the last changes committed the software is effective (almost all AQUAgpusph-1.5.4 features have been recovered), however the documentation and the helper tools are not ready yet.

Are you stopping the release just for the documentation?? Yes! The previous documentation is completely useless for this new version, which may have a hard first contact. Also in this new version the documentation will be probably moved to a Wiki.