CYBERTEC PostgreSQL Logo

Testing GPU-accelerated PostgreSQL

09.2015 / Category: / Tags: |

NVIDIA's CUDA is definitely a great thing and I have to admit that I already got excited years ago when I first learned about it. For many operations a nicely optimized GPU implementation definitely seems the way to go. GPUs are traditionally used for scientific operations and massively parallel tasks. However, some important work is also going into the PGStrom project, which is all about bringing the power of modern GPUs to PostgreSQL: pgstrom documentation

Installing CUDA

At this point installing CUDA on Linux might be the hardest part of the entire undertaking. The CUDA installer only works nicely, when no X-server is running. A simple „init 1“ should solve this problem, however.

Before you get started with pgstrom, it is usually a good idea to check, if the GPU has been detected properly:

If the test is passed, CUDA is ready for PostgreSQL.

Installing PostgreSQL with CUDA

Installing pg_strom for PostgreSQL is basically not hard. Here is how it works:

What happened in my case was that I had to uncomment 3 lines in a pg_strom header file because my version of PostgreSQL was a bit more up to date than expected. However, this is nothing major. It is more of a small fix.

Once pg_strom has been added to shared_preload_libraries, the system is already ready for action. In my case starting the database shows the following listing:

The important point here is that during PostgreSQL startup the CUDA device has to be in the LOG message - otherwise there is a problem with the driver.

The beauty is that pgstrom automatically uses GPU code when it seems useful. The user does not have to worry about where the code is actually executed. The optimizer will make those decisions for your automatically.

So far pgstrom seems pretty promising. Of course, it is not ready for production yet, but it is definitely worth investigating the issue further and run tests next week.

9 responses to “Testing GPU-accelerated PostgreSQL”

  1. I saw this during PGCon this year. It's extremely exciting. Though AMD cards generally have more cores, so it makes me wonder if there will ever be an AMD equivalent to this.

  2. Maybe my expectations for this article were too high. But seeing real tests (CUDA vs non-CUDA) was my interest in it.
    Will wait a little more.

  3. After installing postgres and pgstrom, When I run '/usr/local/pgsql/bin/pgctl -D /usr/local/pgsql/data -l logfile start', the command works. But the output is just 'server starting'. How do I know that pg-strom is running or not?

  4. hi , you can start postgresql service with that gtx970 ? I try to install CUDA&pgstrom , and when I restart the postgresql service , there's some error messages in postgresql indicates that gtx970 is not supported.

Leave a Reply

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

CYBERTEC Logo white
Get the newest PostgreSQL Info & Tools


    This site is protected by reCAPTCHA and the Google Privacy Policy & Terms of Service apply.

    You need to load content from reCAPTCHA to submit the form. Please note that doing so will share data with third-party providers.

    More Information
    ©
    2024
    CYBERTEC PostgreSQL International GmbH
    phone-handsetmagnifiercrosscross-circle
    linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram