darktable icon indicating copy to clipboard operation
darktable copied to clipboard

[FR] Force only GPU in some modules if OpenCL is available

Open gi-man opened this issue 3 years ago • 4 comments

**Is your feature request related to a problem? I recently took multiple images during a sunset. I used the highlight recovery GL with nice results. When I'm editing, at most the image takes 2sec for [full] in GPU. This is fine by me.

But, I noticed when I switch to Lightview, culling/Fullscreen, darktable becomes very slow trying to process the [thumbnails]. Upon review, the CPU is 100%, while there is still plenty of memory (no tile). I used the -d perf to further evaluate and I noticed that some of the thumbnail processing is going into CPU. The ones in CPU path take 45 to 50sec just in the highlight recovery module vs 1s in GPU. The impact of CPU path is there also in the D&S module, but not at the same magnitude (~5sec vs 0.5s).

Describe the solution you'd like I would like to be able to force those two modules to use the GPU path in all cases and maybe other modules in the future. This should be a user selectable option.

Alternatives I switched to the Very Fast GPU and it avoids the CPU path, but I dont think it is ideal to then never use the CPU for the other modules.

Thoughts?

gi-man avatar Jun 01 '22 12:06 gi-man

Thoughts?

Yes. Indeed that's one more thing in the dt scheduler to be worked on. I will certainly get into this later, not sure if we a) can use a much better benchmark that allows us to calculate a valid performance ratio specific_gpu versus cpu to make a better decision how long we should wait for a device instead of cpu-fallback b) use something like process_cl_preferred like we already have process_cl_ready

don't know yet

jenshannoschwalm avatar Jun 01 '22 15:06 jenshannoschwalm

instead of switching to "Very fast GPU" better use default mode with custom opencl_device_priority=1,0,*/!1,0,*/1,0,*/1,0,*/* settings. you can set a default priority - i used it to prioritize the dedicated GPU (1) over the on CPU GPU (0) except for preview (the default setting prioritizes the first GPU but thats the slower one in my config). So whenever possible (and waiting for jobs) the fastest GPU is used and fallback to the slower GPU or CPU is just done if the fastest GPU is already in use. depending on your systems configuration you need to try to find the optimum configuration.

MStraeten avatar Jun 01 '22 18:06 MStraeten

I tried that option, but it still used the CPU. I prefer to wait for the GPU to be finished (in a few seconds) than using CPU (a lot of seconds).

The Very fast GPU worked for me.

gi-man avatar Jun 01 '22 19:06 gi-man

This issue did not get any activity in the past 60 days and will be closed in 365 days if no update occurs. Please check if the master branch has fixed it and report again or close the issue.

github-actions[bot] avatar Aug 01 '22 00:08 github-actions[bot]

This issue was closed because it has been inactive for 300 days since being marked as stale. Please check if the newest release or nightly build has it fixed. Please, create a new issue if the issue is not fixed.

github-actions[bot] avatar May 29 '23 00:05 github-actions[bot]