Many readers will have already heard about GPU processing and the fact that darktable can make use of OpenCL to improve performance. As we still lack a detailed documentation of that topic, please find here a few explanations and howtos.
The Background
Processing high resolution images belongs to the more demanding tasks in modern computing. Both, in terms of memory requirements and in terms of CPU power, getting the best out of a typical 15, 20 or 25 Megapixel image can quickly bring your computer to its limits.
There also exist a few on-CPU implementations of OpenCL. These come as drivers provided by INTEL or AMD. We observed that they do not give us any speed gain versus our hand-optimized CPU code. Therefore we simply discard these devices.
Does this include GPU on the same die as CPU? My AMD A12 (id Carrizo) comes with 8 compute units according to clinfo, but is not usable?
Again - I have a separate Radeon R5230 (id Caicos) with 2 compute units but this is not used either.
darktable-cltest output pasted below:
Performance using just my CPU (and with 16GB DDR4 RAM) isnāt bad; but it would be nice to have the ability to use the silicon that could make the performance fantastic.
darktable-cltest
[opencl_init] opencl related configuration options:
[opencl_init]
[opencl_init] opencl: 1
[opencl_init] opencl_library: āā
[opencl_init] opencl_memory_requirement: 768
[opencl_init] opencl_memory_headroom: 300
[opencl_init] opencl_device_priority: ā/!0,//ā
[opencl_init] opencl_mandatory_timeout: 200
[opencl_init] opencl_size_roundup: 16
[opencl_init] opencl_async_pixelpipe: 0
[opencl_init] opencl_synch_cache: 0
[opencl_init] opencl_number_event_handles: 25
[opencl_init] opencl_micro_nap: 1000
[opencl_init] opencl_use_pinned_memory: 0
[opencl_init] opencl_use_cpu_devices: 0
[opencl_init] opencl_avoid_atomics: 0
[opencl_init]
[opencl_init] found opencl runtime library ālibOpenCLā
[opencl_init] opencl library ālibOpenCLā found on your system and loaded
amdgpu_parse_asic_ids: Cannot parse ASIC IDs: Resource temporarily unavailable
[opencl_init] found 1 platform
[opencl_init] found 2 devices
[opencl_init] discarding device 0 AMD CAICOS (DRM 2.50.0 / 4.13.0-21-lowlatency, LLVM 6.0.0)' due to missing image support. [opencl_init] discarding device 1 AMD CARRIZO (DRM 3.18.0 / 4.13.0-21-lowlatency, LLVM 6.0.0)ā due to missing image support.
[opencl_init] no suitable devices found.
[opencl_init] FINALLY: opencl is NOT AVAILABLE on this system.
[opencl_init] initial status of opencl enabled flag is OFF.
[opencl_init] opencl related configuration options:
[opencl_init]
[opencl_init] opencl: 1
[opencl_init] opencl_library: āā
[opencl_init] opencl_memory_requirement: 768
[opencl_init] opencl_memory_headroom: 300
[opencl_init] opencl_device_priority: ā/!0,//ā
[opencl_init] opencl_mandatory_timeout: 200
[opencl_init] opencl_size_roundup: 16
[opencl_init] opencl_async_pixelpipe: 0
[opencl_init] opencl_synch_cache: 0
[opencl_init] opencl_number_event_handles: 25
[opencl_init] opencl_micro_nap: 1000
[opencl_init] opencl_use_pinned_memory: 0
[opencl_init] opencl_use_cpu_devices: 0
[opencl_init] opencl_avoid_atomics: 0
[opencl_init]
[opencl_init] could not find opencl runtime library ālibOpenCLā
[opencl_init] could not find opencl runtime library ālibOpenCL.soā
[opencl_init] found opencl runtime library ālibOpenCL.so.1ā
[opencl_init] opencl library ālibOpenCL.so.1ā found on your system and loaded
[opencl_init] could not get platforms: -1001
[opencl_init] FINALLY: opencl is NOT AVAILABLE on this system.
[opencl_init] initial status of opencl enabled flag is OFF.
wait time 0.167082s
wait time 0.108670s
Iām using A10-7870K APU with built in R7 graphics. Does this mean OpenCL support is not available?
My system is using the Open Source AMD GPU driver. However for darktable I use the closed source opencl compiler. Iāve just extracted the required individual files from the closed source driver packages (RPM) for that:
I trashed my driver installation trying to set up amdgpu-pro and had to reinstall my OS files, and wish to avoid going through that pain again.
Did you use the AMD supplied script, or (as I think you imply) selectively install just some of the .deb packages?
Or did you not install .deb packages but merely extract the files you list in /opt/amdgpu-pro/lib64 fom the packages?
Your last line suggests having to call darktable from a terminal. Is it possible to set LD_LIBRARY_PATH in my envionment, or does it need to be set as a commandline option?
Hi All. Iām having issues with getting darktable to use opencl on my system. After having reinstalled my nvidia-387 driver.
Iām getting the following output:
ā ~ darktable -d opencl
[opencl_init] opencl related configuration options:
[opencl_init]
[opencl_init] opencl: 1
[opencl_init] opencl_library: ''
[opencl_init] opencl_memory_requirement: 768
[opencl_init] opencl_memory_headroom: 4000
[opencl_init] opencl_device_priority: '*/!0,*/*/*'
[opencl_init] opencl_mandatory_timeout: 200
[opencl_init] opencl_size_roundup: 16
[opencl_init] opencl_async_pixelpipe: 0
[opencl_init] opencl_synch_cache: 0
[opencl_init] opencl_number_event_handles: 25
[opencl_init] opencl_micro_nap: 1000
[opencl_init] opencl_use_pinned_memory: 0
[opencl_init] opencl_use_cpu_devices: 0
[opencl_init] opencl_avoid_atomics: 0
[opencl_init]
[opencl_init] found opencl runtime library 'libOpenCL'
[opencl_init] opencl library 'libOpenCL' found on your system and loaded
[opencl_init] found 1 platform
[opencl_init] could not get device id size: -1
[opencl_init] found 0 device
[opencl_init] FINALLY: opencl is NOT AVAILABLE on this system.
[opencl_init] initial status of opencl enabled flag is OFF.
The device itās not detecting is a nvidia GeForce 1070 GTX. The driver is functional in so far as itās running cuda code correctly.
The system is linuxmint 18.2.
Any advice in how to debug this problem is greatly appreciated.
Finally managed to get opencl support in darktable;
@asn, although I made progress following your tips, ultimately I got stalled on version number of the DRM.
I bit the bullet and installed amdgpu-pro version 17.50 using the install script, which built a new kernel and ramdisk image.
I followed the directions on this page
The speed-up factor in use on darktable is only slight over 2, however, which is considerably less than the factor I achieved using my corei7 CPU laptop with opencl. I donāt know the exact factor, but I do know that I was exporting a jpg for a 4000x6000 image in about 8 seconds. Unfortunately, exports using my new computer are still taking nearly a minute each.
Interestingly my stand-alone video card (yes a pretty low-spec Radeon R5 230 was not detected as a usable device at all. Given it has but two GPU units (versus 8 on the CPU die - I have an AMD A12) means this is a moot point.
Mileage _will vary, but maybe this tale will help someone with similar hardware & OS version (Ubuntu Studio 17.10)
I have a Radeon RX 470, so the GPU is pretty strong. I needed to set āOpenCL scheduling profile: Very fast GPUā. With that everything is working much faster
Thanks for the tip. This has given me an extra 2x speedup.
But when I set āmultiple GPUsā I get much better ⦠another 4x speedup.
Very happy with the results now!!!
did you download and install the amdgpu-pro package?
It is a bit of a āheart in your mouthā moment, because for me there is the fear of making my system unusable, and hard to return to its previous state.
However I have had success in Ubuntu and Manjaro with the -pro package. It is, unfortunately, not FOSS.
Iām thinking about trying the latest (update as at 20 March 2018) here because I do have some flicker issues that - once they start (sometimes after half an hour, sometimes never) - only a reboot solves.
Radeon Pro Software Enterprise Edition 18.Q1.1 for Linux Highlights
Radeon⢠Pro Software Enterprise Edition 18.Q1.1 for Linux delivers enterprise-level support for RHEL 7.4 and CentOS 7.4.
āDownload Full Release Notāeās
Radeon Pro Software Adrenalin Edition 17.12.1 for Linux Highlights
Radeon⢠Pro Software Adrenalin Edition 17.12.1 for Linux delivers amdgpu-pro and amdgpu-open stack using the same packaging infrastructure and introduces support for RHEL 7.4 and CentOS 7.4.
Download Full Release Notes
I cannot understand if I must use āRadeon Pro Software Enterprise Edition 18.Q1.1ā or āRadeon Pro Software Adrenalin Edition 17.12.1ā, they do not explain what is each for. I actually trying installing both, the first makes my system unusable, the second works but doesnāt make openocl worksā¦