darktable-org / darktable-org/darktable
Darktable crashes with multiple OpenCL ICD files
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 13.1k
- Forks
- 1.4k
- Avg merge
- 22h 14m
- Merged PRs (30d)
- 198
Description
Is there an existing issue for this?
- I checked and did not find my issue in the already reported ones
Describe the bug
I've been running Darktable with OpenCL disabled for ages on my desktop system after some updates months ago prevented it from starting. I've finally found the culprit for crashing.
I discovered multiple .icd files in /etc/OpenCL/vendors/ from previous ROCM installations dating back to ~2021. Deleting everything but the current .icd file finally allowed Darktable to pass the OpenCL test (darktable-cltest -d verbose).
Other OpenCL applications such as DaVinci Resolve have worked flawlessly with multiple .icd files this entire time.
Possibly related to #19519.
My .icd vendor list (before deleting):
ll /etc/OpenCL/vendors/
total 28
-rw-r--r-- 1 root root 15 Apr 12 2021 amdocl64_40100.icd
-rw-r--r-- 1 root root 15 Jun 6 2021 amdocl64_40200.icd
-rw-r--r-- 1 root root 15 Sep 16 2021 amdocl64_40300.icd
-rw-r--r-- 1 root root 15 Nov 2 2021 amdocl64_40500.icd
-rw-r--r-- 1 root root 15 Feb 10 2022 amdocl64_50000.icd
-rw-r--r-- 1 root root 15 Mar 31 2022 amdocl64_50100.icd
-rw-r--r-- 1 root root 15 Sep 30 12:29 amdocl64_70002_sles156_56.icd
Steps to reproduce
- Launch Darktable with multiple
.icdfiles.
Expected behavior
No response
Logfile | Screenshot | Screencast
Darktable crash with multiple .icd files:
darktable-cltest -d verbose
darktable 5.2.1
Copyright (C) 2012-2025 Johannes Hanika and other contributors.
Compile options:
Bit depth -> 64 bit
Exiv2 -> 0.28.3
Lensfun -> 0.3.4
Debug -> DISABLED
SSE2 optimizations -> ENABLED
OpenMP -> ENABLED
OpenCL -> ENABLED
Lua -> ENABLED - API version 9.5.0
Colord -> ENABLED
gPhoto2 -> ENABLED
OSMGpsMap -> ENABLED - map view is available
GMIC -> ENABLED - Compressed LUTs are supported
GraphicsMagick -> DISABLED
ImageMagick -> DISABLED
libavif -> ENABLED
libheif -> ENABLED
libjxl -> ENABLED
LibRaw -> ENABLED - Version 0.21.4-Release
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.3650 [dt_dlopencl_init] found default opencl runtime library 'libOpenCL'
0.3651 [opencl_init] opencl library 'libOpenCL' found on your system and loaded, preference 'default path'
0.3995 [opencl_init] found 7 platforms
0.3995 [opencl_init] possibly a multiple platform problem for `AMD Accelerated Parallel Processing'
0.3995 [opencl_init] possibly a multiple platform problem for `AMD Accelerated Parallel Processing'
0.3995 [opencl_init] possibly a multiple platform problem for `AMD Accelerated Parallel Processing'
0.3995 [opencl_init] possibly a multiple platform problem for `AMD Accelerated Parallel Processing'
0.3995 [opencl_init] possibly a multiple platform problem for `AMD Accelerated Parallel Processing'
0.3995 [opencl_init] possibly a multiple platform problem for `AMD Accelerated Parallel Processing'
0.3995 [opencl_init] possibly a multiple platform problem for `AMD Accelerated Parallel Processing'
0.3995 [opencl_init] possibly a multiple platform problem for `AMD Accelerated Parallel Processing'
0.3995 [opencl_init] possibly a multiple platform problem for `AMD Accelerated Parallel Processing'
0.3995 [opencl_init] possibly a multiple platform problem for `AMD Accelerated Parallel Processing'
This GDB supports auto-downloading debuginfo from the following URLs:
<https://debuginfod.opensuse.org/>
Enable debuginfod for this session? (y or [n]) [answered N; input not from terminal]
Debuginfod has been disabled.
To make this setting permanent, add 'set debuginfod enabled off' to .gdbinit.
[New LWP 40193]
[New LWP 40192]
[New LWP 40191]
[New LWP 40190]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
0x00007f3386ca4812 in __syscall_cancel_arch () from /lib64/libc.so.6
warning: Currently logging to /tmp/darktable_bt_IOQJF3.txt. Turn the logging off and on to make the new setting effective.
#0 0x00007f3386ca4812 in __syscall_cancel_arch () at /lib64/libc.so.6
#1 0x00007f3386c98008 in __internal_syscall_cancel () at /lib64/libc.so.6
#2 0x00007f3386c98061 in __syscall_cancel () at /lib64/libc.so.6
#3 0x00007f3386d090fb in wait4 () at /lib64/libc.so.6
#4 0x00007f33871a0e16 in ??? () at /usr/bin/../lib64/darktable/libdarktable.so
#5 0x00007f3386c42910 in <signal handler called> () at /lib64/libc.so.6
#6 0x00007f337c2f3903 in clGetPlatformInfo () at /lib64/libOpenCL.so
#7 0x00007f3387181d46 in dt_opencl_init () at /usr/bin/../lib64/darktable/libdarktable.so
#8 0x00007f33870f0746 in dt_init () at /usr/bin/../lib64/darktable/libdarktable.so
#9 0x000056412c56414f in ??? ()
#10 0x00007f3386c2b2fb in __libc_start_call_main () at /lib64/libc.so.6
#11 0x00007f3386c2b3cb in __libc_start_main_impl () at /lib64/libc.so.6
#12 0x000056412c5641a5 in ??? ()
=========
Id Target Id Frame
* 1 Thread 0x7f3380051140 (LWP 40189) "darktable-cltes" 0x00007f3386ca4812 in __syscall_cancel_arch () from /lib64/libc.so.6
2 Thread 0x7f33753ff6c0 (LWP 40193) "darktable-cltes" 0x00007f3386d1c3ff in ioctl () from /lib64/libc.so.6
3 Thread 0x7f337ebfd6c0 (LWP 40192) "gdbus" 0x00007f3386ca4812 in __syscall_cancel_arch () from /lib64/libc.so.6
4 Thread 0x7f337f3fe6c0 (LWP 40191) "gmain" 0x00007f3386ca4812 in __syscall_cancel_arch () from /lib64/libc.so.6
5 Thread 0x7f337fbff6c0 (LWP 40190) "pool-spawner" 0x00007f3386d1e80d in syscall () from /lib64/libc.so.6
=========
Thread 5 (Thread 0x7f337fbff6c0 (LWP 40190) "pool-spawner"):
#0 0x00007f3386d1e80d in syscall () at /lib64/libc.so.6
#1 0x00007f3386ee081e in g_cond_wait () at /lib64/libglib-2.0.so.0
#2 0x00007f3386e765b4 in ??? () at /lib64/libglib-2.0.so.0
#3 0x00007f3386ee1224 in ??? () at /lib64/libglib-2.0.so.0
#4 0x00007f3386ee0f6d in ??? () at /lib64/libglib-2.0.so.0
#5 0x00007f3386c9bdf1 in start_thread () at /lib64/libc.so.6
#6 0x00007f3386d20c8c in __clone3 () at /lib64/libc.so.6
Thread 4 (Thread 0x7f337f3fe6c0 (LWP 40191) "gmain"):
#0 0x00007f3386ca4812 in __syscall_cancel_arch () at /lib64/libc.so.6
#1 0x00007f3386c98008 in __internal_syscall_cancel () at /lib64/libc.so.6
#2 0x00007f3386c98061 in __syscall_cancel () at /lib64/libc.so.6
#3 0x00007f3386d12f32 in ppoll () at /lib64/libc.so.6
#4 0x00007f3386eaf75f in ??? () at /lib64/libglib-2.0.so.0
#5 0x00007f3386eafeac in g_main_context_iteration () at /lib64/libglib-2.0.so.0
#6 0x00007f3386eafef1 in ??? () at /lib64/libglib-2.0.so.0
#7 0x00007f3386ee0f6d in ??? () at /lib64/libglib-2.0.so.0
#8 0x00007f3386c9bdf1 in start_thread () at /lib64/libc.so.6
#9 0x00007f3386d20c8c in __clone3 () at /lib64/libc.so.6
Thread 3 (Thread 0x7f337ebfd6c0 (LWP 40192) "gdbus"):
#0 0x00007f3386ca4812 in __syscall_cancel_arch () at /lib64/libc.so.6
#1 0x00007f3386c98008 in __internal_syscall_cancel () at /lib64/libc.so.6
#2 0x00007f3386c98061 in __syscall_cancel () at /lib64/libc.so.6
#3 0x00007f3386d12f32 in ppoll () at /lib64/libc.so.6
#4 0x00007f3386eaf75f in ??? () at /lib64/libglib-2.0.so.0
#5 0x00007f3386eb00c7 in g_main_loop_run () at /lib64/libglib-2.0.so.0
#6 0x00007f33860f2e76 in ??? () at /lib64/libgio-2.0.so.0
#7 0x00007f3386ee0f6d in ??? () at /lib64/libglib-2.0.so.0
#8 0x00007f3386c9bdf1 in start_thread () at /lib64/libc.so.6
#9 0x00007f3386d20c8c in __clone3 () at /lib64/libc.so.6
Thread 2 (Thread 0x7f33753ff6c0 (LWP 40193) "darktable-cltes"):
#0 0x00007f3386d1c3ff in ioctl () at /lib64/libc.so.6
#1 0x00007f337592e330 in ??? () at /opt/rocm-7.0.2/lib/libhsa-runtime64.so.1
#2 0x00007f3375925877 in ??? () at /opt/rocm-7.0.2/lib/libhsa-runtime64.so.1
#3 0x00007f33758b17d7 in ??? () at /opt/rocm-7.0.2/lib/libhsa-runtime64.so.1
#4 0x00007f3375895ce8 in ??? () at /opt/rocm-7.0.2/lib/libhsa-runtime64.so.1
#5 0x00007f3375832ebd in ??? () at /opt/rocm-7.0.2/lib/libhsa-runtime64.so.1
#6 0x00007f3386c9bdf1 in start_thread () at /lib64/libc.so.6
#7 0x00007f3386d20c8c in __clone3 () at /lib64/libc.so.6
Thread 1 (Thread 0x7f3380051140 (LWP 40189) "darktable-cltes"):
#0 0x00007f3386ca4812 in __syscall_cancel_arch () at /lib64/libc.so.6
#1 0x00007f3386c98008 in __internal_syscall_cancel () at /lib64/libc.so.6
#2 0x00007f3386c98061 in __syscall_cancel () at /lib64/libc.so.6
#3 0x00007f3386d090fb in wait4 () at /lib64/libc.so.6
#4 0x00007f33871a0e16 in ??? () at /usr/bin/../lib64/darktable/libdarktable.so
#5 0x00007f3386c42910 in <signal handler called> () at /lib64/libc.so.6
#6 0x00007f337c2f3903 in clGetPlatformInfo () at /lib64/libOpenCL.so
#7 0x00007f3387181d46 in dt_opencl_init () at /usr/bin/../lib64/darktable/libdarktable.so
#8 0x00007f33870f0746 in dt_init () at /usr/bin/../lib64/darktable/libdarktable.so
#9 0x000056412c56414f in ??? ()
#10 0x00007f3386c2b2fb in __libc_start_call_main () at /lib64/libc.so.6
#11 0x00007f3386c2b3cb in __libc_start_main_impl () at /lib64/libc.so.6
#12 0x000056412c5641a5 in ??? ()
[Inferior 1 (process 40189) detached]
backtrace written to /tmp/darktable_bt_IOQJF3.txt
Segmentation fault (core dumped) darktable-cltest -d verbose
Commit
No response
Where did you obtain darktable from?
distro packaging
darktable version
5.2.1
What OS are you using?
Linux
What is the version of your OS?
OpenSUSE Tumbleweed
Describe your system
OS: OpenSUSE Tumbleweed
CPU: AMD Ryzen 5950X
GPU: AMD 6800XT
OpenCL: ROCM 7.02
Are you using OpenCL GPU in darktable?
Yes
If yes, what is the GPU card and driver?
AMD 6800XT, ROCM 7.02
Please provide additional context if applicable. You can attach files too, but might need to rename to .txt or .zip
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the crash with darktable-cltest -d verbose and the multiple .icd files listed under /etc/OpenCL/vendors/. Start at dt_opencl_init and the clGetPlatformInfo call shown in the backtrace, then verify behavior with the ROCm setup. Done means OpenCL initialization no longer crashes when multiple ICD files are present.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, linux
- Domain
- computer-graphics, desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100