Solved : git master and release-4.2.0 : Amaze demosaic on CPU only

Darktable performance is affected when I select AMaZE or AMaZE + VNG4 demosaic algorithm, making several darktable operations slow.

  • Opening pictures in lighttable moving to darktable (if picture use AMaZE) is slow
  • Toggle gamut check is slow
  • Toggle clipping indication is slow.

I know from documentation that:
**Note:** The performance of the demosaic algorithms differs significantly, *AMaZE* being by far the slowest.

However I also notice when running darktable that AMaZE demosaic never use my GPU only CPU.

Entering darktable and executing toggle gamut check with AMaZE selected, I get only CPU:

./darktable -d perf | grep demosaic
[dev_pixelpipe] took 1.254 secs (9.626 CPU) [full] processed `demosaic' on CPU, blended on CPU

Entering darktable and executing toggle gamut check with RCD selected I get GPU:

./darktable -d perf | grep demosaic
[dev_pixelpipe] took 0.098 secs (0.074 CPU) [full] processed `demosaic' on GPU, blended on GPU

This makes opening pictures in lighttable moving to darktable, switching to next picture (if also AMaZE), toggle gamut check and toggle clipping indication slow, when AMaZE is selected.

Is this intended? I mean neither release-4.2.0 nor git master code executes AMaZE demosaic on my GPU (whilst RCD is fine running on GPU all the time). Is it so that focus is on RCD, since that is default and it has never been intended to let AMaZE run on GPU? Is it planned to allow AMaZE to run on GPU in future (feature), or is this a bug?

I compile from git source in this system:

  • OS : Linux debian 5.10.0-21-amd64 SMP Debian 5.10.162-1 (2023-01-21) x86_64 GNU/Linux

  • Linux - Distro : Debian 11.6

  • Memory : 16 GB

  • Graphics card : NVIDIA Corporation TU104GL [Quadro RTX 4000]

  • Graphics driver : Nvidia Driver Version: 470.161.03

  • OpenCL installed : Yes, OpenCL 3.0 CUDA 11.4.309

  • OpenCL activated : Yes

  • Xorg : X11

  • Desktop : Gnome 3.38.5

  • GTK+ : 3.24.24

  • gcc : gcc (GCC) 12.2.0

  • cflags :

  • CMAKE_BUILD_TYPE : release.

There simply is no GPU implementation for AMaZE. And as i have been the only dt dev for some years working on the demosaicers, there is no plan to implement it.

OK, I see. That is fine. I was unaware of Amaze on CPU only and had Amaze + VNG4 as my default. I have switched to RCD + VNG4 now. That is much better.

You may do as you like but plain RCD is mostly fine especially for low-ISO images.

Also: in some cases VNG leads to some color shift (although that has been improved with current master).

For high-ISO images LMMSE is often the best solution.

A last point, for RCD and LMMSE i am absolutely sure they are perfect with the new highlights algos, not so sure about amaze. I don’t understand some of it’s internals but for high signals (like happening in HLR) there might be some wrongful correction.

2 Likes

Thank you for the feedback. I will consider it. In the end I do want to maximize picture rendering quality. At this stage, I am after max performance, for the default setting, since I have a fairly powerful GPU.

Edit: I noticed LMMSE is also off the GPU, but VNG is on GPU making RCD+VNG a good combination for me (modulo the color shifts).

Thanks for the very informative information about the demosaicing options. Is the difference very much for high ISO images as I often put the iso to capture the ambient lighting of street scenes when travelling.

  1. I would have said better “for high chroma noise” images.
  2. Not so much. Otherwise i would have implemented an OpenCL version. :slight_smile:
2 Likes