handmade.network » Forums » GPGPU - for non graphics apps
msmshazan
Shazan Shums
161 posts

Some day I will make quality software.
Programming FTW.

#11827 GPGPU - for non graphics apps
3 months, 3 weeks ago

Is using GPU for non graphics intense apps worth like database related apps for use in integrated gpu containing laptops.

Just being curious on programming....
marcc
Marc Costa
21 posts
#11828 GPGPU - for non graphics apps
3 months, 3 weeks ago

GPGPU is literally using the GPU for General Programming (i.e. non graphics work) :)

In terms of application, they're used in areas where high levels of parallelism, higher memory throughput and compute power are going to give an advantage over low parallelism / deep pipelined CPUs. I guess databases are not in these areas, since they're probably limited by storage size (both HDD & RAM), of which GPUs have even less, and memory latency.

Here's an idea of some of the problems better suited for GPUs.
timothy.wright
Timothy Wright
75 posts
1 project
#11829 GPGPU - for non graphics apps
3 months, 3 weeks ago

I am currently processing research data with the GPU. The original algorithm took about 45 minutes to do the calculations. We optimized it down to about 2 minutes with caches and things.

Then I moved it over to the GPU with OpenGL compute shaders and go it down to 9 seconds. This can be a lot faster with a high-end card, but I only have a crappy one with a linux driver.

The main problem with using this for regular algorithms with the huge amount of time it takes to get the data into the GPU and to get the data out. In my case it's a small amount of data and a large amount of math. Given the complexity of debugging it and the lack of consistency between computers, it still isn't practical for regular stuff.
ratchetfreak
294 posts
#11830 GPGPU - for non graphics apps
3 months, 3 weeks ago

timothy.wright
I am currently processing research data with the GPU. The original algorithm took about 45 minutes to do the calculations. We optimized it down to about 2 minutes with caches and things.

Then I moved it over to the GPU with OpenGL compute shaders and go it down to 9 seconds. This can be a lot faster with a high-end card, but I only have a crappy one with a linux driver.

The main problem with using this for regular algorithms with the huge amount of time it takes to get the data into the GPU and to get the data out. In my case it's a small amount of data and a large amount of math. Given the complexity of debugging it and the lack of consistency between computers, it still isn't practical for regular stuff.


the bandwidth over the PCIe bus (what connects the GPU and RAM) is on the order of 20 GB/s.

Bottleneck with database application is more likely the harddrive whose Sata connection is on the order of 2 GB/s.

This is still a lot of data that can be moved around per time unit. Though managing the in-RAM and on GPU cache will become important.
msmshazan
Shazan Shums
161 posts

Some day I will make quality software.
Programming FTW.

#11833 GPGPU - for non graphics apps
3 months, 3 weeks ago Edited by Shazan Shums on May 4, 2017, 5:15 p.m.

I was thinking is it better to use opengl or opencl. Is there a difference. Or should i use SIMD instead.

Just being curious on programming....
mmozeiko
Mārtiņš Možeiko
1441 posts
1 project
#11834 GPGPU - for non graphics apps
3 months, 3 weeks ago Edited by Mārtiņš Možeiko on May 4, 2017, 5:52 p.m.

There is a difference. OpenGL exposes a bit more graphics related functionality which OpenCL doesn't have access to. But OpenCL has nicer API which is easier to use when doing compute-only work. Latest OpenGL versions have also compute shaders which can be easily used for arbitrary computations, although you'll still need to some crazy glue code for setting up context & stuff. If you target only Windows then DirectCompute is also an option.

And CPU SIMD is completely on different level.