darktable-org / darktable-org/darktable

RustiCL/OpenCL not consistently using GPU

Open
#19,150 34 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

no-issue-activity OpenCL understood: unclear
Dominant language
C
Stars
13.1k
Forks
1.4k
Avg merge
22h 14m
Merged PRs (30d)
198

Description

Here's a concise summary of my Darktable OpenCL issues and troubleshooting steps, by gemini which helped me so far e.g. for the better drivers for my system.

Darktable Version: 5.2.0

Intel i7 8550U (8th gen)

20 GB RAM

Integrated GPU (iGPU): Intel UHD Graphics 620 (KBL GT2)

Dedicated GPU (dGPU): AMD Radeon R5 M445 Series

Graphics Driver: Mesa 25.1.6 (from kisak/kisak-mesa PPA)

OpenCL Backend: Rusticl (primary focus), Clover (tested)

Display Server: X.Org

Core Problem
When attempting to use the Intel UHD Graphics 620 for OpenCL processing in Darktable, the application experiences severe instability and performance degradation. Over 94% of OpenCL events fail on the GPU, leading to a massive fallback to the CPU for image processing tasks. This results in extremely slow export times, with CPU processing time far exceeding the total export duration (e.g., 454 seconds of CPU time for a 71-second export).

Key Error Observed
The primary error consistently observed is CL_OUT_OF_RESOURCES. This indicates that the Intel UHD 620 (an iGPU relying on shared system memory) cannot allocate or manage sufficient memory resources for complex Darktable modules (e.g., "diffuse and sharpen") sent via OpenCL. When this occurs, Darktable reverts to CPU processing for that module.

Troubleshooting Steps & Findings
Intel UHD 620 with Rusticl:

Attempt: Launching Darktable targeting Intel GPU with RUSTICL_ENABLE=true (or iris).

Result: 22 out of 407 events were successful on the Intel GPU. Persistent CL_OUT_OF_RESOURCES errors for modules like 'diffuse', causing CPU fallback.

Intel UHD 620 with Clover:

Attempt: Launching Darktable targeting Intel GPU with RUSTICL_ENABLE=false to use the older Clover backend.

Result: While no specific CL_OUT_OF_RESOURCES logs from this direct attempt were provided, the general issue of low successful events and CPU fallback with the Intel card suggests Clover did not fundamentally resolve the resource limitation.

AMD Radeon R5 M445 Series:

Finding: System correctly identifies both GPUs under X.Org (xrandr --listproviders showed Provider 0: Intel, Provider 1: AMD).

Attempt: Launching Darktable explicitly targeting the AMD GPU (e.g., DRI_PRIME=1 LIBVA_DRIVER_NAME=amdgpu RUSTICL_ENABLE=true).

Result: 1336 out of 1336 events were successful on the AMD GPU. This indicates 100% successful OpenCL event execution. A warning *** Warning, slots > 1024 was present, suggesting a high pipeline complexity, but no CL_OUT_OF_RESOURCES errors or CPU fallbacks due to OpenCL failure.

Conclusion: The AMD GPU functions correctly with OpenCL, but its inherent lower performance (being an entry-level dGPU) means overall export times are still slower than desired. However, it's the only GPU on this system that reliably completes OpenCL tasks.

Current Status
The system is unable to effectively leverage the Intel UHD Graphics 620 for OpenCL acceleration in Darktable due to consistent CL_OUT_OF_RESOURCES errors, forcing extensive CPU usage. While the AMD dGPU can fully utilize OpenCL, its performance is insufficient. The user's goal is to make the Intel UHD Graphics 620 work reliably for OpenCL.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported Darktable 5.2.0 behavior with the Intel UHD 620 using the listed Rusticl and Clover launch settings, then compare it with the AMD command that completes all events. Done means Intel OpenCL processing reliably completes without repeated CL_OUT_OF_RESOURCES errors or extensive CPU fallback.

Written by the indexing model from the issue text.

Assessment

Domain
backend, performance
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.