Seems a bit passé right? Well apparently not. Apparently using the GPU to do all the heavy lifting isn’t something that the popular photography applications do. Lightroom and Photoshop have some GPU acceleration, but apparently Lightroom doesn’t really benefit unless you have a big display (I guess they do all their rendering on a smaller view of the picture).
On Linux the use of the GPU in the most popular photo suites is spotty at best. RawTherapee doesn’t seem to do it at all, and Darktable’s is flaky. In fairness to Darktable, they do support OpenCL in some circumstances , but if it doesn’t work on the GPUs I have (2x Radeon R9 290x), which are now fairly old and have reasonably good driver support, you have to question whether it is worth it. In fact, even on my laptop, which has a Broadwell (ie 5th generation intel Core) series CPU in it, Darktable didn’t want to work with OpenCL.
What I’m wondering is, why OpenCL? OpenGL has a shader pipeline that is pretty much purpose built for processing 2D images, and for the slightly more complex tasks (like generating the histogram) it has had compute shaders since v4.3. Also, it has much better driver support than OpenCL, especially on linux, thanks to Valve’s work on SteamOS.
So, over the Christmas break I started working on an OpenGL-based, GPU-first photo editor (I’m calling it Monet). I didn’t get very far, and haven’t done much since, but I did just recently get the Demosaic operation to work correctly (Read more about that here , I based what I did on this article). So, I did a fairly non-scientific comparison of a very simple action: resizing the window, and monitored the CPU and memory usage while I was at it.
My method was simple: open both programs, and let them idle long enough that all CPUs and memory were mostly stable. Then resize each program’s window up and down by dragging the resize handle in and out so that the image goes from about 2cm wide to about 15cm wide and back, at a frequency of around 2Hz, for about 10 seconds. You can see from the image that Darktable had to work the CPU (in fact all of them) quite hard do do this. Monet is barely distinguishable from idle. There is a small increase in memory usage while resizing Darktable, and none for Monet. Note that in Darktable I turned off all the processing modules except Demosaic and White-balance, because that’s all Monet can do right now.
This has, at least, motivated me to push on with this project, because there are some real gains to be had.
Monet is Open Source, and available at github: https://github.com/guysherman/monet
- Adobe Community Forums: “What graphics card for Lightroom in July 2017”. https://forums.adobe.com/thread/2354015
- Darktable: “Darktable and OpenCL (updated)”. https://www.darktable.org/2012/03/darktable-and-opencl
- Max Smolens: “COMP 238: Advanced Image Generation: Assignment 4: Programmable Shading”. http://msmolens.github.io/bayer-pattern-demosaicing/