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
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.
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.
it's openCL based, so should work with AMD too. CUDA provides OpenCL stack too and from what I understood PgStrom is OpenCL based.
Not anymore, it seems...
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.
Performance metrics start on slide 17. He showed this at PGCon in Ottawa this year:
http://www.slideshare.net/kaigai/gpgpu-accelerates-postgresql
Ugh CUDA is an NVidia product whole main purpose is proprietary lock-in. OpenCL solutions are generally preferable.
Sad thing is, OpenCL support was dropped some time 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?
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.