Bug #11702

Cannot use opencl on Cape Verde: [opencl_init] could not create command queue for device 0: -6

Added by Nick Kachulin almost 3 years ago. Updated 12 months ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:
Affected Version:
other GNU/Linux
hardware architecture:


After discontinuing fglrx I was left without fast darktable for more than half a year on my 7770 Cape Verde...
The last attempt to make it working was the closest: I could install opencl blob and it is visible with clinfo but is still inoperable.
I've opened a bug @ gentoo bugzilla
but the maintainers asked me for more info I can not provide.

I do realize that most probably it's not darktable issue at all (other apps seem not to work either) but I ask somebody who can help to participate in the discussion over there to triangle the problem and possibly find a solution.

clinfo.txt (8.03 KB) clinfo.txt Nick Kachulin, 08/18/2017 04:34 PM
darktable-cltest.txt (1.43 KB) darktable-cltest.txt Nick Kachulin, 08/18/2017 04:34 PM
20170923_0024.jpg (8.23 MB) 20170923_0024.jpg Nick Kachulin, 09/23/2017 10:25 PM


#1 Updated by Ulrich Pegelow almost 3 years ago

From darktable-cltest's output:

[opencl_init] could not create command queue for device 0: -6

Error code -6 relates to CL_OUT_OF_HOST_MEMORY. And that's what the docs tell us about this error during command queue creation:

CL_OUT_OF_HOST_MEMORY if there is a failure to allocate resources required by the
OpenCL implementation on the host.

I guess it's a driver bug.

#2 Updated by Nick Kachulin almost 3 years ago

Thank you Ulrich. This definitely gives a direction.

#3 Updated by Josep V. Moragues almost 3 years ago

I get the same error with my Radeon R7 250 (GCN 1.0) on a clean install of Ubuntu GNOME 16.04.3, and the newest AMDGPU-PRO driver (17.30)

[opencl_init] opencl related configuration options:
[opencl_init] opencl: 1
[opencl_init] opencl_library: ''
[opencl_init] opencl_memory_requirement: 512
[opencl_init] opencl_memory_headroom: 100
[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] found opencl runtime library 'libOpenCL'
[opencl_init] opencl library 'libOpenCL' found on your system and loaded
[opencl_init] found 1 platform
[opencl_init] found 1 device
[opencl_init] device 0 `Capeverde' supports image sizes of 16384 x 16384
[opencl_init] device 0 `Capeverde' allows GPU memory allocations of up to 332MB
[opencl_init] device 0: Capeverde 
     GLOBAL_MEM_SIZE:          518MB
     MAX_WORK_GROUP_SIZE:      256
     MAX_WORK_ITEM_SIZES:      [ 256 256 256 ]
     DRIVER_VERSION:           2442.7
     DEVICE_VERSION:           OpenCL 1.2 AMD-APP (2442.7)
[opencl_init] could not create command queue for device 0: -6
[opencl_init] FINALLY: opencl is NOT AVAILABLE on this system.
[opencl_init] initial status of opencl enabled flag is OFF.

Darktable's OpenCL works fine with this card on Ubuntu GNOME 14.04 with the discontinued fglrx driver.

#4 Updated by Josep V. Moragues almost 3 years ago

I get a similar error using LuxMark v.3.1:

OpenCL ERROR: clCreateCommandQueue(-6)

So it seems the issue is not Darktable related, there is something wrong with OpenCL implementation on AMDGPU-PRO drivers for Cape Verde GPUs

#5 Updated by Nick Kachulin almost 3 years ago

Now I'm sure it is not. I opened a bug @ kernel bugzilla so it might be a solution soon... Hopefully... I'll keep this bug open, too, to keep you guys informed.

#6 Updated by Fernando Iguacel over 2 years ago

Just tried the solution on

export GPU_FORCE_64BIT_PTR=1
export GPU_MAX_HEAP_SIZE=100

and darktable-cltest just worked

#7 Updated by Nick Kachulin over 2 years ago

I can confirm that darktable-cltest reports okay.
However, darktable produces artifacts on the screen when working with such setup. When I tried to export something it stucks the kernel. Lovering percentage from 100 to 80 did the trick but with artifacts, too.
One step further but not there yet...

UPD: Actually only GPU_FORCE_64BIT_PTR=1 is enough but it produces artifacts.
UPD1: Tried other program -- artifacts are produced, too. So it's still an opencl issue.

#8 Updated by Kevin Scott 12 months ago

In auto mode at maximum load, the temperature of the graphics core did not exceed 74 degrees, which is a good, but not outstanding result, taking into account the low heat dissipation of the 28-nm graphics chip Cape Verde XT.

buy personal statement

Also available in: Atom PDF

Go to top