Darktable OpenCL performance with NVidia GTX1650 Super

You had to tweak correctly the 2 darktablerc. My card use for opencl more than 80% of his memory

Which card and which tweaks?

AMD or nvidia. In .config, there is darktablerc, the configuration file for darktable and in the filesystem. https://www.darktable.org/usermanual/en/darktable_and_opencl_amd.html

1 Like

Your link discusses OpenCL settings for AMD cards. This thread is discussing the behavior of a specific Nvidia card–the 1650 Super. Are you saying that the settings for AMD in your link will increase the OpenCL memory used for the 1650 Super?

The link is the darktable usermanual, if you go down the page, you will see the next chapter about “OpenCL performance optimization”…

Ah, sorry, I didn’t realize that you meant the link to be a generic link to the manual. I’m familiar with the manual. I’m also familiar with the optimization for OpenCL as I’m a long time user of darktable. However, none of changes I make seem to affect the reported memory used. Perhaps I’m reading the recommendations in the manual a bit too literally. However,since you seem to have found the correct optimization to allow 80% OpenCL memory usage with the 1650 Super I’m wondering if you might share them. Thanks.

I have a gtx 1050 Ti 4Gb. My tweaks follow the usermanual:
opencl_async_pixelpipe=true
opencl_avoid_atomics=false
opencl_mandatory_timeout=200
opencl_memory_headroom=1024
opencl_memory_requirement=2048
opencl_micro_nap=10
opencl_number_event_handles=1000
opencl_scheduling_profile=very fast GPU
opencl_size_roundup=16
opencl_synch_cache=false
opencl_use_cpu_devices=false
opencl_use_pinned_memory=false
opencl_memory_requirement=2048
I tweak the 2 darktablerc. Each time, you upgrade, reinstall, compile darktable, you had to tweak again the 2 darktablerc. Only the darktablerc in the …/.config/darktable had to be tweaked

1 Like

Thanks! I appreciate it. I’ll give these settings a go and see how it turns out.

Interesting, I thought that bashrc settings (I read the manual in the past) can affect how Darktable initializes and treats the “top layer” of the OpenCL API, but it can not affect the amount of memory which OpenCL offers for processing - I would think that allowing to change this limit via a public interface is not very safe and reasonable. I may be wrong though. @Frank_Lepore, could you please report if you have successfully changed the amount of memory available?
Also, please notice that in the tweaks from @dim, the “opencl_memory_requirement” is set twice, which is not necessary and may be confusing.

I have to admit that I gave up and got back to the Radeon GPU - simply because the Nvidia was cca 30% slower in my tests (and it’s not sure if increasing the amount of max memory allocations would improve the performance). but I still am curious if one can change the amount of memory available.

1 Like

I make a mistake, i have done a quick copy-paste, my bad, without other consequences that is a redundancy. The mistake is evident! To improve the performance, you need to tweak the darktablerc’s parameters as explain in " OpenCL performance optimization" which are different from a nvidia to an amd graphic card. Not only the amount of memory, which differs as the total amount of memory & the brand! You mentioned a public interface, which one?!

you have to test each parameters, one by one & backuped the original darktablerc before

I do apologize dim, definitely did not want to make you mad with my comment :wink:
With the public interface I meant the one on top of the OpenCL stack - i.e. the one which is used by Darktable (or any OpenCL based application). It was not meant as “public to Darktable users”, I was trying to look at it from the view of the OpenCL developers. Like “the memory allocation parameter might be something which is set internally and shall not be messed with, hence we will not allow the applications on top of OpenCL to change it.”

1 Like

No offense at all! I want to reassure you & i’m curious!

I have an intermittent problem that I don’t see discussed in this thread or in the above referenced article. I will be using openCL, successfully, but I go back and re-check, and it is off. Nothing notifies me, I just think to re-check it. Sometimes it is still working, and sometimes not. I may have seen others mention this, too.

I’m running a new PC with an nVidia RTX 2060 card, on Arch Linux. I had the same problem on openSUSE Linux, too.

We need more details about your configuration: laptop or not, archlinux version, kernel, graphic driver version, packages opencl related installed, and run in a terminal: darktable-cltest or darktable -d opencl

1 Like

When I had a similar issue the only thing that worked was downgrading to one of the legacy-series nVidia drivers.

Desktop PC, AMD 3900X, ASUS TUF X570 motherboard, 16 GB RAM

Arch is a rolling release, always up-to-date. Kernel 5.8.7. nVidia 450.66, opencl-nvidia 450.66-1, ocl-icd 2.2.12-4

darktable -d opencl

(darktable:2113): libsecret-CRITICAL **: 19:44:36.207: secret_service_load_collections_sync: assertion ‘paths != NULL’ failed
0.076897 [opencl_init] opencl related configuration options:
0.076901 [opencl_init]
0.076903 [opencl_init] opencl: 1
0.076904 [opencl_init] opencl_scheduling_profile: ‘default’
0.076905 [opencl_init] opencl_library: ‘’
0.076908 [opencl_init] opencl_memory_requirement: 768
0.076910 [opencl_init] opencl_memory_headroom: 400
0.076913 [opencl_init] opencl_device_priority: ‘/!0,///!0,*’
0.076914 [opencl_init] opencl_mandatory_timeout: 200
0.076916 [opencl_init] opencl_size_roundup: 16
0.076917 [opencl_init] opencl_async_pixelpipe: 0
0.076919 [opencl_init] opencl_synch_cache: active module
0.076922 [opencl_init] opencl_number_event_handles: 25
0.076923 [opencl_init] opencl_micro_nap: 1000
0.076926 [opencl_init] opencl_use_pinned_memory: 0
0.076928 [opencl_init] opencl_use_cpu_devices: 0
0.076930 [opencl_init] opencl_avoid_atomics: 0
0.076932 [opencl_init]
0.077051 [opencl_init] found opencl runtime library ‘libOpenCL’
0.077063 [opencl_init] opencl library ‘libOpenCL’ found on your system and loaded
0.108340 [opencl_init] found 1 platform
0.108356 [opencl_init] found 1 device
0.108537 [opencl_init] device 0 GeForce RTX 2060' has sm_20 support. 0.108672 [opencl_init] device 0 GeForce RTX 2060’ supports image sizes of 32768 x 32768
0.108674 [opencl_init] device 0 GeForce RTX 2060' allows GPU memory allocations of up to 1482MB [opencl_init] device 0: GeForce RTX 2060 GLOBAL_MEM_SIZE: 5931MB MAX_WORK_GROUP_SIZE: 1024 MAX_WORK_ITEM_DIMENSIONS: 3 MAX_WORK_ITEM_SIZES: [ 1024 1024 64 ] DRIVER_VERSION: 450.66 DEVICE_VERSION: OpenCL 1.2 CUDA 0.187766 [opencl_init] options for OpenCL compiler: -w -DNVIDIA_SM_20=1 -DNVIDIA=1 -I"/usr/share/darktable/kernels" 0.188581 [opencl_init] compiling program demosaic_ppg.cl’ …
0.189547 [opencl_load_program] loaded cached binary program from file ‘/home/tim/.cache/darktable/cached_kernels_for_GeForceRTX2060_45066/demosaic_ppg.cl.bin’ MD5: ‘a639d79d954ba682d8c8508916a9728a’
0.189552 [opencl_load_program] successfully loaded program from ‘/usr/share/darktable/kernels/demosaic_ppg.cl’ MD5: ‘a639d79d954ba682d8c8508916a9728a’
0.192011 [opencl_build_program] successfully built program
0.192016 [opencl_build_program] BUILD STATUS: 0
0.192018 BUILD LOG:
0.192019

I think we need to better understand what you mean by “…it is off”. Do you mean that the setting in the preferences has simply changed itself from “checked” to “unchecked”? Or do you mean that in the preference settings the opencl options become “greyed out”?

Maybe the nvidia drivers are no longer loaded, eg. due to a suspend/wake-up operation? When the opencl has “turned itself off”, what sort of output do you get from the nvidia-smi command?

I mean the openCL settings in darktable are unselected and unselectable, and then if I go to a terminal and run clinfo, it responds that there are 0 platforms. openCL will be working, then openCL itself seems to crash.

My response to @dim shows it in a working state.

I think the problem is with openCL itself, not darktable. I was just wondering whether anyone else has encountered it. Apparently, @elstoc has.

Right, that’s what I suspected. I’ve seen the same thing happen on my laptop with GTX1650 running Manjaro (based on Arch Linux). It doesn’t seem to be frequent, and I haven’t go to the bottom of why it happens yet.

1 Like