OpenCL Accelerated SQL Database with ARM Mali GPU Compute Capabilities

We’ve previously seen GPU compute on ARM could improve performance for mobile, automotive and consumer electronics application. GPU compute offload CPU task that can be parallelized to the GPU using APIs such as OpenCL or RenderScript. Most applications that can leverage GPU compute are related to media processing (video decoding, picture processing, audio decoding, image reconigion, etc…), but one thing I did not suspect could be improve is database access. That’s what Tom Gall, Linaro, has achieved in a side project by using OpenCL to accelerate SQLite database operations by around 4 times for a given benchmark.

SQLite Architecture and "Attack Point" for OpenCL Implementation
SQLite Architecture and “Attack Point” for OpenCL Implementation

The hardware used was a Samsung Chromebook with an Exynos 5250 SoC featurig a dual core Cortex A15 processor and an ARM Mali T604 GPU. CPU compute is only possible on ARM Mali T6xx and greater, and won’t work on Mali 400 / 450 GPUs. Other GPU vendors such as Vivante and Imagination technologies also support GPU compute in their latest processors.

As a first implementation, he added an API to SQLite, but eventually the code may be merged inside SQLite, as it would also to accelerate existing applications using SQLite. This type of acceleration will work best with large tables, and parallel tasks.  For benchmark purpose, Tom used a 100,000 row database with 7 columns and ran the same query (select * from testdb) using the SQLite C API and his OpenCL accelerated API. Here are the results:

  • SQLite C API – 420.274 milliseconds
  • OpenCL accelerated SQLite API – 110.289 milliseconds

The first test ran fully on the Cortex A15 cores @ 1.7 GHz, whereas the OpenCL test mostly ran on the Mali-T604 GPU clocked at 533 MHz (TBC). The time includes both the running of the OpenCL kernel and the data transfer from the result buffer.

More work is needed, but that seems like an interesting application for GPU compute in some use cases. I would expect to see no gain for query performed in small tables for example. The modified OpenCL code does not appear to be available right now, but you may want to read GPGPU on ARM presentation at Linaro Connect Asia 2014 for a few more details about the implementation, and if you want to play around OpenCL 1.1 (or OpenGL ES) in Linux on a Chromebook, you can follow those instructions.

Share this:
FacebookTwitterHacker NewsSlashdotRedditLinkedInPinterestFlipboardMeWeLineEmailShare

Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress

ROCK 5 ITX RK3588 mini-ITX motherboard

6 Replies to “OpenCL Accelerated SQL Database with ARM Mali GPU Compute Capabilities”

  1. in related news Khronos Releases Wave of New Standards and Initiatives for 3D Graphics, Heterogeneous Computing and API Interop

    OpenGL ES 3.1 Specification Released – The next leap in mobile & embedded graphics
    EGL 1.5 Specification Released – The essential glue for secure, integrated API rendering
    WebCL 1.0 Specification Released – Browser-based heterogeneous compute acceleration
    SYCL 1.2 Provisional Specification Released – Enabling high-level C++ tools for OpenCL

    OpenCL 2.0 Adopters Program Launched – Driving OpenCL 2.0 conformance

  2. The popular cross-platform XBMC media center uses SQLite databases, so if someone could write a proof of concept for this concept using XBMC on ARM then this might get some great attention from more developers!

Leave a Reply

Your email address will not be published. Required fields are marked *

Khadas VIM4 SBC
Khadas VIM4 SBC