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:

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
Subscribe
Notify of
guest
The comment form collects your name, email and content to allow us keep track of the comments placed on the website. Please read and accept our website Terms and Privacy Policy to post a comment.
6 Comments
oldest
newest
Harley
Harley
10 years ago

in related news Khronos Releases Wave of New Standards and Initiatives for 3D Graphics, Heterogeneous Computing and API Interop
https://www.khronos.org/news/press/2014/03

OpenGL ES 3.1 Specification Released – The next leap in mobile & embedded graphics
https://www.khronos.org/news/press/khronos-releases-opengl-es-3.1-specification

https://www.khronos.org/news/press/khronos-releases-opengl-es-3.1-specification
EGL 1.5 Specification Released – The essential glue for secure, integrated API rendering

https://www.khronos.org/news/press/khronos-releases-egl-1.5-specification
WebCL 1.0 Specification Released – Browser-based heterogeneous compute acceleration

https://www.khronos.org/news/press/khronos-releases-webcl-1.0-specification
SYCL 1.2 Provisional Specification Released – Enabling high-level C++ tools for OpenCL
https://www.khronos.org/news/press/khronos-releases-sycl-1.2-provisional-specification

OpenCL 2.0 Adopters Program Launched – Driving OpenCL 2.0 conformance
https://www.khronos.org/news/press/khronos-launches-opencl-2.0-adopters-program

Hedda
Hedda
10 years ago

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!

m][sko
10 years ago

arm made pretty nice manual how to install ubuntu on samsung chromebook
http://malideveloper.arm.com/develop-for-mali/features/graphics-and-compute-development-on-samsung-chromebook/

Khadas VIM4 SBC