Skip to content

opencl crash when demosaicing with markesteijn an x-trans raw (X-T20) #18652

Open
@aefkha

Description

@aefkha

Is there an existing issue for this?

  • I checked and did not find my issue in the already reported ones

Describe the bug

Opencl multiple crashes when attempting to edit an X-T20 raw with markesteijn set as demosaicing algorithm.

At some point, darktable disables opencl and use only CPU: an alert is shown. I tested with a fresh clean config folder and no sidecar file associated.

Happens on all my X-T20 raw, but not on X-M1 files. Never with frequential chroma domain (is that it in english?). Can't be sure with VNG.

Steps to reproduce

  1. With a clean config folder, add the attached X-T20 picture to the library
  2. Open darkroom to start editing the file and look at opencl going mad

The bug triggers inconsistently: sometimes, you need to have edited at least one time the file, close darktable, open and edit again. Can also be triggered randomly when editing or almost always when displaying a snapshot taken a few clicks ago. I could not find any pattern linked to a particular module

Expected behavior

opencl should run smoothly with no hickups

Logfile | Screenshot | Screencast

Output of darktable -d opencl

darktable 5.0.1
Copyright (C) 2012-2025 Johannes Hanika and other contributors.

Compile options:
  Bit depth              -> 64 bit
  Debug                  -> DISABLED
  SSE2 optimizations     -> ENABLED
  OpenMP                 -> ENABLED
  OpenCL                 -> ENABLED
  Lua                    -> ENABLED  - API version 9.4.0
  Colord                 -> ENABLED
  gPhoto2                -> ENABLED
  GMIC                   -> ENABLED  - Compressed LUTs are supported
  GraphicsMagick         -> ENABLED
  ImageMagick            -> DISABLED
  libavif                -> ENABLED
  libheif                -> ENABLED
  libjxl                 -> ENABLED
  LibRaw                 -> ENABLED  - Version 0.22.0-Devel202403
  OpenJPEG               -> ENABLED
  OpenEXR                -> ENABLED
  WebP                   -> ENABLED

See https://www.darktable.org/resources/ for detailed documentation.
See https://github.com/darktable-org/darktable/issues/new/choose to report bugs.

     0.0001 [dt starting]
 darktable -d opencl
     0,1859 [dt_get_sysresource_level] switched to 1 as `default'
     0,1859   total mem:       15933MB
     0,1859   mipmap cache:    1991MB
     0,1859   available mem:   7966MB
     0,1859   singlebuff:      124MB
     0.2150 [opencl_init] opencl library 'libOpenCL' found on your system and loaded, preference 'default path'
     0.2510 [opencl_init] found 2 platforms
     0.2511 [opencl_init] possibly a multiple platform problem for `AMD Accelerated Parallel Processing'
     0.2511 [opencl_init] no devices found for Advanced Micro Devices, Inc. (vendor) - AMD Accelerated Parallel Processing (name)
[opencl_init] found 1 device

[dt_opencl_device_init]
   DEVICE:                   0: 'Ellesmere'
   CONF KEY:                 cldevice_v5_amdacceleratedparallelprocessingellesmere
   PLATFORM, VENDOR & ID:    AMD Accelerated Parallel Processing, Advanced Micro Devices, Inc., ID=4098
   CANONICAL NAME:           amdacceleratedparallelprocessingellesmere
   DRIVER VERSION:           3380.4 (PAL,HSAIL)
   DEVICE VERSION:           OpenCL 2.0 AMD-APP (3380.4)
   DEVICE_TYPE:              GPU, dedicated mem
   GLOBAL MEM SIZE:          4096 MB
   MAX MEM ALLOC:            3264 MB
   MAX IMAGE SIZE:           16384 x 16384
   MAX WORK GROUP SIZE:      256
   MAX WORK ITEM DIMENSIONS: 3
   MAX WORK ITEM SIZES:      [ 1024 1024 1024 ]
   ASYNC PIXELPIPE:          NO
   PINNED MEMORY TRANSFER:   NO
   AVOID ATOMICS:            NO
   MICRO NAP:                250
   ROUNDUP WIDTH & HEIGHT    16x16
   CHECK EVENT HANDLES:      128
   TILING ADVANTAGE:         0.000
   DEFAULT DEVICE:           NO
   KERNEL BUILD DIRECTORY:   /usr/share/darktable/kernels
   KERNEL DIRECTORY:         /home/denis/.cache/darktable/cached_v5_kernels_for_AMDAcceleratedParallelProcessingEllesmere_33804PALHSAIL
   CL COMPILER OPTION:       -cl-fast-relaxed-math
   CL COMPILER COMMAND:      -w -cl-fast-relaxed-math -DAMD=1 -I"/usr/share/darktable/kernels"
   KERNEL LOADING TIME:       0.0740 sec
[opencl_init] OpenCL successfully initialized. internal numbers and names of available devices:
[opencl_init]		0	'AMD Accelerated Parallel Processing Ellesmere'
     0.5136 [opencl_init] FINALLY: opencl PREFERENCE=ON is AVAILABLE and ENABLED.
[opencl_init] opencl_scheduling_profile: 'default'
[opencl_init] opencl_device_priority: '*/!0,*/*/*/!0,*'
[opencl_init] opencl_mandatory_timeout: 1000
[opencl_update_priorities] these are your device priorities:
[opencl_update_priorities] 		image	preview	export	thumbs	preview2
[dt_opencl_update_priorities]		0	-1	0	0	-1
[opencl_update_priorities] show if opencl use is mandatory for a given pixelpipe:
[opencl_update_priorities] 		image	preview	export	thumbs	preview2
[opencl_update_priorities]		0	0	0	0	0
[opencl_synchronization_timeout] synchronization timeout set to 200
[opencl_update_priorities] these are your device priorities:
[opencl_update_priorities] 		image	preview	export	thumbs	preview2
[dt_opencl_update_priorities]		0	-1	0	0	-1
[opencl_update_priorities] show if opencl use is mandatory for a given pixelpipe:
[opencl_update_priorities] 		image	preview	export	thumbs	preview2
[opencl_update_priorities]		0	0	0	0	0
[opencl_synchronization_timeout] synchronization timeout set to 200
     1,6618 [lib_load_module] failed to open `midi': libportmidi.so.2: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou dossier de ce nom
     2,3160 [dt_opencl_check_tuning] use 2389MB (headroom=OFF, pinning=OFF) on device `AMD Accelerated Parallel Processing Ellesmere' id=0
     5,7278 [opencl_events_flush] execution of '[Read Image (from device to host)]' failed: -59
     5,7279 pipe aborts               CL0 [full]           demosaic                800 (   0/   0) 6032x4011 scale=1,0000 --> (   0/   0) 1284x 854 scale=0,2129  couldn't run module on GPU, falling back to CPU
     6,8030 pipe aborts               CL0 [full]           exposure               2400 (   0/   0) 1284x 854 scale=0,2129 --> (   0/   0) 1284x 854 scale=0,2129  couldn't run module on GPU, falling back to CPU
     6,8378 pipe aborts               CL0 [full]           colorin                3200 (   0/   0) 1284x 854 scale=0,2129 --> (   0/   0) 1284x 854 scale=0,2129  couldn't run module on GPU, falling back to CPU
     6,9024 pipe aborts               CL0 [full]           colorequal             5100 (   0/   0) 1284x 854 scale=0,2129 --> (   0/   0) 1284x 854 scale=0,2129  couldn't run module on GPU, falling back to CPU
     7,1855 pipe aborts               CL0 [full]           colorbalancergb        5200 (   0/   0) 1284x 854 scale=0,2129 --> (   0/   0) 1284x 854 scale=0,2129  couldn't run module on GPU, falling back to CPU
     7,3575 pipe aborts               CL0 [full]           colorout               8300 (   0/   0) 1284x 854 scale=0,2129 --> (   0/   0) 1284x 854 scale=0,2129  couldn't run module on GPU, falling back to CPU
     7,3758 pipe restarting on CPU    CL0 [full]                                       (   0/   0) 1284x 854 scale=0,2129 --> (   0/   0) 1284x 854 scale=0,2129  ID=11
 [opencl_summary_statistics] device 'AMD Accelerated Parallel Processing Ellesmere' (0): 485 out of 486 events were successful and 0 events lost. max event=245

Commit

No response

Where did you obtain darktable from?

distro packaging

darktable version

5.1.0

What OS are you using?

Linux

What is the version of your OS?

Arch (endeavourOS)

Describe your system

No response

Are you using OpenCL GPU in darktable?

Yes

If yes, what is the GPU card and driver?

radeon RX 480 ellesmere (polaris 10) 4GB; driver: AMDGPU via package vulkan-radeon; ROCm v6.3.2-1 for opencl

Please provide additional context if applicable. You can attach files too, but might need to rename to .txt or .zip

  • Happens also with 5.0.1 and 4.8.1 appimage
  • X-T20 raw only, tested with X-M1 no problem, as for the rest...?
  • yes, happens with fresh edit, but not always
  • yes with a new config dir
  • no lua

Attached raw:
DSCF9118.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions