Continue Discussion 36 replies
December 2017

martin.scharnke Supporter

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.

1 reply
December 2017

LebedevRI

There is not enough opencl support in open drivers.
GalliumCompute says {2,3}D image {read, write} are all still TODO.

1 reply
January 2018 ▶ LebedevRI

martin.scharnke Supporter

Ah … thanks for this. NVIDIA closed source driver on my laptop worked - mostly. Is there an opencl solution using closed source drivers for AMD GPU?

1 reply
January 2018 ▶ martin.scharnke

paperdigits Supporter

The AMD GPU drivers are actually quite bad, aren’t they? A newer kernel should have the open drivers included

1 reply
January 2018 ▶ paperdigits

bminney Supporter

Hi
My output using 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: 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?

2 replies
January 2018

LebedevRI

That is what it told you.

1 reply
January 2018

asn

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:

$ find /opt/amdgpu-pro/lib64 -type f
/opt/amdgpu-pro/lib64/libOpenCL.so.1
/opt/amdgpu-pro/lib64/libamdocl12cl64.so
/opt/amdgpu-pro/lib64/libamdocl64.so
/opt/amdgpu-pro/lib64/libdrm.so.2.4.0
/opt/amdgpu-pro/lib64/libdrm_amdgpu.so.1.0.0
/opt/amdgpu-pro/lib64/libdrm_radeon.so.1.0.1
/opt/amdgpu-pro/lib64/libkms.so.1.0.0

and

cat /etc/OpenCL/vendors/amdocl64.icd
libamdocl64.so

This works fine with:

LD_LIBRARY_PATH=/opt/amdgpu-pro/lib64 darktable

to get OpenCL support it darktable.

P.S.: Midnight Commander is able to browse RPM files, so it is quite easy to copy out files from packages with it.

1 reply
January 2018 ▶ LebedevRI

bminney Supporter

Thanks. I was hoping there was a work around I was missing as exporting jpg files can be slow.

January 2018 ▶ asn

martin.scharnke Supporter

Andreas, could you please elaborate a little?

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?

2 replies
January 2018 ▶ martin.scharnke

asn

I did not install any package. I extracted the mentioned individual files from the packages (RPM). Midnight Command can simply open them …

I start darktable on the commandline. You can also add it to the desktop file …

January 2018

Daniel_Baak

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.

January 2018 ▶ martin.scharnke

martin.scharnke Supporter

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)

January 2018

asn

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 :slight_smile:

1 reply
January 2018 ▶ asn

martin.scharnke Supporter

Thanks for the tip. This has given me an extra 2x speedup. :slight_smile:
But when I set “multiple GPUs” I get much better … another 4x speedup.
Very happy with the results now!!! :smiley: :smiley:

March 2018 ▶ bminney

Paolo_Benvenuto

I’m getting the same result:

$ darktable -d opencl

** (darktable:13761): WARNING **: Couldn't connect to accessibility bus: Failed to connect to socket /tmp/dbus-qHQglvLNCi: Connessione rifiutata
7.369256 [opencl_init] opencl related configuration options:
7.369289 [opencl_init] 
7.369294 [opencl_init] opencl: 1
7.369299 [opencl_init] opencl_library: ''
7.369312 [opencl_init] opencl_memory_requirement: 768
7.369320 [opencl_init] opencl_memory_headroom: 300
7.369327 [opencl_init] opencl_device_priority: '*/!0,*/*/*'
7.369339 [opencl_init] opencl_mandatory_timeout: 200
7.369349 [opencl_init] opencl_size_roundup: 16
7.369357 [opencl_init] opencl_async_pixelpipe: 0
7.369362 [opencl_init] opencl_synch_cache: 0
7.369371 [opencl_init] opencl_number_event_handles: 25
7.369381 [opencl_init] opencl_micro_nap: 1000
7.369386 [opencl_init] opencl_use_pinned_memory: 0
7.369395 [opencl_init] opencl_use_cpu_devices: 0
7.369405 [opencl_init] opencl_avoid_atomics: 0
7.369413 [opencl_init] 
7.369671 [opencl_init] could not find opencl runtime library 'libOpenCL'
7.369760 [opencl_init] could not find opencl runtime library 'libOpenCL.so'
7.370507 [opencl_init] found opencl runtime library 'libOpenCL.so.1'
7.370562 [opencl_init] opencl library 'libOpenCL.so.1' found on your system and loaded
7.370896 [opencl_init] could not get platforms: -1001
7.370903 [opencl_init] FINALLY: opencl is NOT AVAILABLE on this system.
7.370906 [opencl_init] initial status of opencl enabled flag is OFF.

What does “could not get platforms: -1001” mean?

2 replies
March 2018 ▶ Paolo_Benvenuto

martin.scharnke Supporter

Hi Paolo,

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.

1 reply
March 2018 ▶ Paolo_Benvenuto

martin.scharnke Supporter

Sorry, an actual answer to your question:

Blockquote
What does “could not get platforms: -1001” mean?

-1001 is an error code, and it means that opencl_init was unable to find a GPU enabled for opencl :sob:

March 2018 ▶ martin.scharnke

Paolo_Benvenuto

I’m thinking about trying the latest (update as at 20 March 2018) here

That’s the “Radeon Pro Software Enterprise Edition”. The support site isn’t clear about what that means: The page https://support.amd.com/en-us/download/workstation?os=Linux%20x86_64#release-notes says:

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…

1 reply
March 2018

asn

March 2018

martin.scharnke Supporter

Paolo, it seems to me that there is rebranding going on. “Radeon Pro Software Enterprise Edition 18.Q1.1” is obviously the more recent iteration. (The other is referencing December 2017). As I mentioned, the most recent update is 20 March this year. It’s obviously disappointing that neither give you what you want - a stable, usable display output and provision of opencl using your AMD GPU(s).

You may find that using Andreas’ method works for you; it’s a case of your mileage may vary because of the huge number of variables: which exact hardware, which Linux distro, and sometimes the way you hold your mouth :stuck_out_tongue_winking_eye:

Good luck, and please do share any success stories.

1 reply
May 2018 ▶ martin.scharnke

martin.scharnke Supporter

Good luck, and please do share any success stories.

Heeding my own request, I am hapy to report that while the mid-April release of the Radeon Pro software resulted in instability and much flickering on my Kubuntu 18.04 official release installation, the May 3 release (definitively after the April 26 official Ubuntu 18.04 and flavours release date) - installed flawlessly and I have only noticed one glitch, that have not since been able to reproduce - a slowing to a crawl of darktable (but no other running applications).

So, I am happy to recommend downloading and installing from here the amdgpu-pro-18.20-579836 version.

I’m running AMD A12-9800 (APU with Radeon R7 Graphics - 8 graphics cores). Your mileage may vary.

June 2018

vakulenko

Hi to all! I’m planning to buy new PC. What graphic card should I choose to have easy opencl setup and effective use in DT in ubuntu based distribution? Now I select nvidia gt1030 with 1Gb Ram. Am I right?

2 replies
June 2018 ▶ vakulenko

paperdigits Supporter

As I mentioned in another thread, if you’re after OpenCL performance, the “best” card you can buy is the one that doesn’t break your wallet. The more compute power you can throw at OpenCL, the faster it’ll go, generally.

If you want to go the nVidia router, and don’t mind the proprietary driver, have a look at using the Ubuntu Graphics Drivers PPA, I’m using it on my KDE neon computer get the the freshest drivers. It has worked very well for me on this computer.

However, if you want an out-of-the-box experience, I believe that AMD will soon be the better route.

If you want libre drivers, AMD is the only route.

As always, research carefully and make sure the driver you want to use supports the hardware you’re going to buy.

1 reply
June 2018 ▶ paperdigits

vakulenko

Thanks for reply! But I think with Amd you still need to use proprietary drivers (at least part of it) to enable opencl in dt…

1 reply
June 2018 ▶ vakulenko

kevin_tee

Do you mean AMDGPU-pro driver? I wonder what is missing in Mesa that dt cannot use opencl?

June 2018

vakulenko

I’m not a pro in Linux gpu drivers world. I just heard that open Amd drivers are garbage (maybe I wrong).

2 replies
June 2018 ▶ vakulenko

CarVac

You are wrong. They’re far better than they used to be, and nearly on par with the Nvidia drivers for performance.

June 2018 ▶ vakulenko

paperdigits Supporter

Its the free nVidia drivers that are not great, because nVidia does not help the people who write the free driver, while AMD at least answers questions about their hardware for those writing the free driver.

Pharonix actually has good coverage of all the video card driver stuff.

June 2018

afre

Yes, from what I have read, AMD has been working hard to bridge the gap. A good attitude to have. :sunny:

June 2018

vakulenko

Thanks to all for explanation!

June 2018

pk5dark

The problem with low bugdet nvidia cards I had in the past was there weak performance with the equalizier and the profiled denoise. Please correct me if I’m wrong, but OpenCl is still not fully supported by the opensource AMD drivers. There are several descriptions howto extract the OpenCl libraries from the proprietary drivers and use them with the opensource AMD drivers. So, for both vendors you need at least some parts (for AMD) of the proprietary drivers.

Since 2003 proprietary nvidia drivers are working for me. Whereas AMD proprietary drivers dropped support in AMDgpu-pro two years after I bought a R9 270X. And frglx is not working on newer LInux distributions. You will find some discussions about this “issues” on the darktable mailing lists. My R9 270X performed very well with mentioned moduls, which made it even more annoying. :disappointed_relieved:

You can find benchmarks for opencl here:

and here:
https://math.dartmouth.edu/~sarunas/darktable_bench.html

My only advice I can give is to carefully check the driver situation for your case.

1 reply
June 2018 ▶ pk5dark

CarVac

The new way to use OpenCL with AMD cards on the open source drivers is ROCm, but it only supports recent CPUs (needs PCIe atomics) and certain versions of Linux. I’m not sure when it’s going to be mainlined…

1 reply
June 2018 ▶ CarVac

asn

I have ROCm for OpenCL running. However the RHEL packages seem to not exist for ROCm 1.8.1 yet. I’ve just extract the needed libs from there.

September 2020

Qba

Hi, I’m suing Intel’s HD under Arch Linux. It used to work perfect few months ago, but with updates it stopped. Anybody has an idea how can I fix it?

Here are the logs.

Huge thanks in advance!

darktable_bt_I6ZMR0.txt (6.1 KB)
clinfo.txt (11.6 KB)

February 2021

Colourimeter

Searching the web, I noticed that a number of people had problems implementing OpenCL with their AMD card. Many prefer the display drivers that come with their Linux distribution (in my case Mint), but would like to add OpenCL support through the proprietory AMD drivers provided on the AMD support page https://www.amd.com/en/support .
There is a way to do this for your card (in my case an AMD RX 570, but I am sure it will also work for AMD RX 580, 590, Vega and many others). After unpacking the drivers, open a terminal in that directory and type (or copy from here):

./amdgpu-pro-install --headless --opencl=legacy,rocr

OpenCL installation will start after you approve through sudo (enter password).
The --headless option will keep the display drivers of your Linux distribution, but still add OpenCL. When I rebooted and started Darktable the next time, OpenCL support was automatically activated. I found the AMD drivers to be very reliable. Speed improvements are really nice, especially with ‘fast GPU’ on.
I hope this helps a few AMD graphics card users out there.

1 reply
February 2021 ▶ Colourimeter

Brian_Innes

That’s how I installed OpenCL when I was running an AMD RX580 GPU. Sadly I found it unstable in other software which used heavy OpenCL calculations, so I eventually returned it and bought an Nvidia GTX 1660!