CYBERTEC 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.

0 0 votes
Article Rating
Subscribe
Notify of
guest
9 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Shaun Thomas
8 years ago

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.

Krzysztof Nienartowicz
Krzysztof Nienartowicz
8 years ago
Reply to  Shaun Thomas

it's openCL based, so should work with AMD too. CUDA provides OpenCL stack too and from what I understood PgStrom is OpenCL based.

⚡ ⚕ Ayy LOLz LMAO ⚕ ⚡
⚡ ⚕ Ayy LOLz LMAO ⚕ ⚡
7 years ago

Not anymore, it seems...

Vincenzo Romano
Vincenzo Romano
8 years ago

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.

Shaun Thomas
8 years ago

Performance metrics start on slide 17. He showed this at PGCon in Ottawa this year:

http://www.slideshare.net/kaigai/gpgpu-accelerates-postgresql

ri_s
ri_s
8 years ago

Ugh CUDA is an NVidia product whole main purpose is proprietary lock-in. OpenCL solutions are generally preferable.

⚡ ⚕ Ayy LOLz LMAO ⚕ ⚡
⚡ ⚕ Ayy LOLz LMAO ⚕ ⚡
7 years ago
Reply to  ri_s

Sad thing is, OpenCL support was dropped some time ago...

MKan
MKan
7 years ago

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?

Chang Eric
Chang Eric
4 years ago

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.

CYBERTEC Logo white
CYBERTEC PostgreSQL International GmbH
Römerstraße 19
2752 Wöllersdorf
Austria

+43 (0) 2622 93022-0
office@cybertec.at

Get the newest PostgreSQL Info & Tools


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

    ©
    2024
    CYBERTEC PostgreSQL International GmbH
    phone-handsetmagnifiercrosscross-circle
    9
    0
    Would love your thoughts, please comment.x
    ()
    x
    linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram