new laptop - annoying darktable surprise

I thought it was time for a new laptop and found a good deal for a Thinkbook16p Gen 5 IRX. Intel(R) Core™ i9-14900HX, NVIDIA GeForce RTX 4060 Max-Q - a neat upgrade from my HP Omen 15 with RTX 2060 with a much nicer 3200x2000 screen; running on 165hz and 160% scaling everything is sharp, smooth and beautiful.

But…why does darktable feel choppy and slower? Panning is much choppier then on the old machine, edits feel slower, much more “working…”, even the UI animations are choppy!

Some trials later: At 100% and 200% scaling everything is buttersmooth, at an uneven factor darktable becomes chop-suey.

After searching for a while there seems to be no fix, just annoying compromises like running at 200% scaling…

(If anyone has any ideas I’m all ears :slight_smile: ).

Is there a term for GAS-Regret…?

4 Likes

Which GPU is used by darktable? From what I can see, the Intel has an integrated GPU, so you have two.

Also, I suppose the “165Hz” is screen refresh? Is any rate over 30Hz really useful?

1 Like

it actually defaulted to the integrated intel graphics but I took care of that already. 165Hz is the screen refresh rate, yes. I find the jump from 60 to 144 Hz I had with the HP Omen 15 before VERY noticable. I don’t percieve a difference between 144 and 165 Hz though.

1 Like

30Hz or “movie” 24fps values applies mainly to non-interactive cases - e.g. watching a movie. As soon as there is an interaction involved the “action-to-manifestation” latency factor goes in.

1 Like

I dont want this to turn into a framerate convo but I dont think I have seen a screen with a 30hz refresh rate.

1 Like

I can’t remember if they are different pipelines ie the 100 percent and multiples vs other. If so you might still need to tune the setting so that all pipelines use the dedicated cpu

I can’t recall so I could be wrong but I know that sometime back @kofa explained the different pipelines…

Yeah you can set priorities for what GPU to use for what pipe. But the real problem is: GTK3 only supports non-fractional scaling. At any scale between 101-199% it will render at 2x and be downsampled by the compositor to the specific scale. At 150% this leads to sliiight blurriness but far worse to mean frame pacing and (though I don’t get why) degraded performance while editing…

keeping my fingers crossed for the GTK4 migration, whenever that will be ready to go…

1 Like

That wasn’t my intention either, but 165Hz seemed a touch excessive for most uses, I think screens are usualy around 60 or 75 Hz.

But using an excessively high framerate does require processor resources (CPU or GPU), better used elsewhere.

But apparently the cause was found, so that’s good.

This is probably also part of the problem here. Possibly if the GPU wouldn’t have to churn out so many pixels so many times per second the issue would be less relevant.

In older video’s AP used to have both the scaling choices set to bilateral in preferences…I am not sure if the default Lanczos or whatever is any slower or faster but I suppose you could see…

I’m not sure the scaling we’re talking about here is under darktable’s control. Sounds like it’s an OS/desktop issue.

Well I am not a software engineer and AI could make things up but at least one report stated that Lanczos due to the fact that it uses something like a 6x6 or even 8x8 sampling vs 2x2 for bilinear was 4 to 9 times slower… Quality might suffer I suppose.

It also stated that if the OS was set to scale at other than 100 say maybe 150 that there could be an extra processing hit…

So I don’t know. I think AP had issues making the videos and running DT so I think he likely did it to optimize…its worth a shot to try it…

Also I guess updating the GPU driver and checking all the options there… I know that GPU’s have some scaling settings as well and maybe those could be optimized for DT…again just thinking out loud…

1 Like

maybe have a look at Testers wanted: experimental Slang GPU path for darktable (Metal/Vulkan)

even on my windows laptop there’s a significant speedup when using slang/vulkan over opencl

I just submitted a pull request to update the logic that selects the default device. Would love any input on the proposed approach: opencl: number discrete GPUs first and skip CPU devices by default by nicknezis · Pull Request #22946 · darktable-org/darktable · GitHub

I now settled on 175% scaling - things on the laptop screen are still a bearable size and darktable seems to behave better that way.

That CPU is a banger though. compiling dt’s Appimage used to take about 8 min on my old machine, here it just took 3 minutes without the fans spinning up much.

Possibly screen resolution increase + scaling. Assuming its using the correct GPU

It is funny to see so many wild guess instead of asking for a log file. -d common can help identify the root cause.

1 Like

If you find something that’d make me happy but I’d be surprised. I did extensive testing and digging already. It’s not the pipe speed. I benchmarked that between the new machine and the old:

4060 hybrid, “default” 4060 discrete, “very fast GPU” 2060 (OMEN)
Pipe total 0,577 s 0,597 s 0,592 s
GPU-Queue 0,383 s 0,400 s 0,531 s
Read Image (device→host) 0,098 s 0,094 s 0,132 s

It seems to be a frame-pacing issue stemming from the compositor doing downscaling to 150% after GTK3 rendered darktable at 200%. But maybe there is something else afoot after all aswell.

Here’s a -d common: log.txt (152.1 KB)

1 Like

It sure requires more power to refresh the screen more often, but surely it’s not that bad right? I mean to the point that it would make Darktable process stuff much slower (the cause has apparently been identified, but I wanna know your opinion) –

DT is crunching stuff in the pixelpipe and meanwhile it’s just the GUI and a low-res placeholder image that are rendered at those high Hz, which should not hinder the performance much… but correct me if I’m wrong.

Thanks for the log, it’s very helpful. I agree the pipe itself isn’t what got slower. Your timings match across both machines, so the 200% GTK → 150% compositor rescale still looks like the best explanation for the frame pacing.

The log did turn up something else that affects everyone on current master with a discrete GPU. When you pan at 100%, demosaic is a cache hit, but the new post-demosaic downscale step (demosaicscale) still asks for the full image. darktable then copies the whole cached demosaic output (6048x4024, about 390 MB of float RGBA) to the GPU to cut out a 1481x1139 window:

8.5351 pipe data: cache HIT   demosaic       6048x4024
8.6206 process CL1            demosaicscale  6048x4024 --> 1484x1143     (~85 ms: the upload)
8.6659 process CL1            denoiseprofile 1484x1143                  (~45 ms more)
8.7468 process_image_job done  took 211ms

So about 130 ms of each 211 ms pan step is moving pixels that never reach the screen. Your machines are equally affected, so this doesn’t explain the difference between them, but it does make panning feel heavier than it needs to. I’ve opened a draft PR that does the crop on the CPU when the demosaiced image is already in host memory: pixelpipe: crop cached demosaic output on the host at 100% zoom by nicknezis · Pull Request #22952 · darktable-org/darktable · GitHub. In a first test that step drops from hundreds of ms to about 7 ms, with an identical result on screen. I’m testing it on real GPUs now, and if you can build from a branch, a pan log from your 4060 with the PR applied would be very welcome.

If you want to check whether the scaling is the culprit, it would help to run once with the desktop at 100% or 200% integer scaling and compare how panning feels.

2 Likes