Skip to content

AMD Rusticl OpenCL won't compile with llvm22 (upstream issue) #21662

Closed

Description

@segeeslice

(Original title: Unable to enable OpenCL in CachyOS, despite being installed)

Is there an existing issue for this?

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

Describe the bug

I'm on CachyOS, using Darktable 5.6.0

I have an AMD GPU (9070 XT) that is clearly recognized by my OS & used in other programs. I thought it was working in Darktable at some point, but I noticed a performance hit recently. This prompted me to check the settings, inside which the “GPU Acceleration” section is grayed out, showing it's “not available”

Image

Running darktable -d opencl from the command line shows a compiler error (shown in the logfile section). Per the documentation, this appears to fall under a "generic compiler error", and I was directed here.

The OpenCL installation came with the OS distro (chatting in a different forum separately just in case it's an OS issue). I have not modified OpenCL on my machine from the stock version that comes with CachyOS.

How can I enable GPU acceleration on my machine? It's noticeably slower without it.

Steps to reproduce

  1. Launch Darktable 5.6.0
  2. Open preferences
  3. Go to the "processing" tab
  4. Under "OpenCL GPU acceleration", attempt to check the box by "activate OpenCL support"

Expected behavior

Darktable should recognize my existing OpenCL installation and allow enabling GPU acceleration

Logfile | Screenshot | Screencast

❯ darktable -d opencl
darktable 5.6.0
Copyright (C) 2012-2026 Johannes Hanika and other contributors.

Compile options:
  Bit depth              -> 64 bit
  Exiv2                  -> 0.28.8
  Lensfun                -> 0.3.4
  Debug                  -> DISABLED
  SSE2 optimizations     -> ENABLED
  OpenMP                 -> ENABLED
  OpenCL                 -> ENABLED
  Lua                    -> ENABLED  - API version 9.7.0
  Colord                 -> ENABLED
  gPhoto2                -> ENABLED  - Camera tethering is available
  OSMGpsMap              -> ENABLED  - Map view is available
  GMIC                   -> ENABLED  - Compressed LUTs are supported
  GraphicsMagick         -> ENABLED
  ImageMagick            -> DISABLED
  libavif                -> ENABLED
  libheif                -> ENABLED
  libjxl                 -> ENABLED
  LibRaw                 -> ENABLED  - Version 0.22.0-Release
  OpenJPEG               -> ENABLED
  OpenEXR                -> ENABLED
  WebP                   -> ENABLED
  AI                     -> ENABLED

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

[dt starting] as : darktable -d opencl
Gtk-Message: 19:09:15.814: Failed to load module "appmenu-gtk-module"
[opencl_init] opencl disabled via darktable preferences
[opencl_init] opencl library 'libOpenCL' found on your system and loaded, preference 'default path'
[opencl_init] found 1 platform
[opencl_init] found 1 device

   DEVICE:                   0: 'AMD Radeon RX 9070 XT (radeonsi, gfx1201, ACO, DRM 3.64, 7.1.4-1-cachyos)'
   CONF KEY:                 cldevice_v6_rusticlamdradeonrx9070xt
   PLATFORM, VENDOR & ID:    rusticl, Mesa:Mesa/X.org, ID=4098
   CANONICAL NAME:           rusticlamdradeonrx9070xt
   DRIVER VERSION:           26.1.5-arch3.1
   DEVICE VERSION:           OpenCL 3.0  API=300
   DEVICE_TYPE:              GPU, dedicated mem
   GLOBAL MEM SIZE:          16384 MB
   MAX IMAGE ALLOC:          2048 MB
   MAX IMAGE SIZE:           65536 x 65536
   MAX CONSTANT BUFFER:      65536 KB
   LOCAL MEM SIZE:           64 KB
   ADDRESS ALIGN:            512 B
   COMPUTE UNITS:            64
   MAX WORK GROUP SIZE:      1024 (64)
   MAX WORK ITEM DIMENSIONS: 3 [ 1024 1024 1024 ]
   ASYNC PIXELPIPE:          NO
   PINNED MEMORY TILING:     NO
   SUPPORTED ATOMICS:        INT32 
   EVENTS HANDLED:           YES
   OPENCL FAST MODE:         NO
   TILING ADVANTAGE:         0.000
   DEFAULT DEVICE:           NO
   KERNEL BUILD DIRECTORY:   /usr/share/darktable/kernels
   KERNEL DIRECTORY:         /home/seg/.cache/darktable/cached_v6_kernels_for_rusticlAMDRadeonRX9070XT_2615arch31
   CL COMPILER COMMAND:      -w  -DAMD=1 -I"/usr/share/darktable/kernels"
[opencl_build_program] could not build program: CL_BUILD_PROGRAM_FAILURE
[dt_opencl_device_init] failed to compile program `basic.cl'
[opencl_init] no suitable devices found.
[opencl_init] FINALLY: opencl PREFERENCE=NO is NOT AVAILABLE and NOT ENABLED

Commit

No response

Where did you obtain darktable from?

darktable.org / GitHub release

darktable version

5.6.0

What OS are you using?

Linux

What is the version of your OS?

CachyOS

Describe your system

Arch Linux via CachyOS with AMD GPU - a 9070 XT. Wholly up-to-date as of the time this ticket is being posted.

❯ fastfetch
           .-------------------------:                    seg@lilith
          .+=========================.                    ----------
         :++===++==================-       :++-           OS: CachyOS x86_64
        :*++====+++++=============-        .==:           Host: X570 AORUS ELITE WIFI (-CF)
       -*+++=====+***++==========:                        Kernel: Linux 7.1.4-1-cachyos
      =*++++========------------:                         Uptime: 3 hours, 15 mins
     =*+++++=====-                     ...                Packages: 1522 (pacman)
   .+*+++++=-===:                    .=+++=:              Shell: fish 4.8.1
  :++++=====-==:                     -*****+              Display (Sceptre Y27): 2560x1440 @ 1.15x in 27", 165 Hz [External] *
 :++========-=.                      .=+**+.              Display (Sceptre Y27): 2560x1440 @ 1.15x in 27", 165 Hz [External]
.+==========-.                          .                 DE: KDE Plasma 6.7.3
 :+++++++====-                                .--==-.     WM: KWin (Wayland)
  :++==========.                             :+++++++:    WM Theme: Layan
   .-===========.                            =*****+*+    Theme: Breeze (Layan) [Qt], Breeze-Dark [GTK2], Breeze [GTK3]
    .-===========:                           .+*****+:    Icons: Tela [Qt], Tela [GTK2/3/4]
      -=======++++:::::::::::::::::::::::::-:  .---:      Font: Noto Sans (10pt) [Qt], Noto Sans (10pt) [GTK2/3/4]
       :======++++====+++******************=.             Cursor: Layan-white (24px)
        :=====+++==========++++++++++++++*-               Terminal: konsole 26.4.3
         .====++==============++++++++++*-                CPU: AMD Ryzen 7 5800X (16) @ 4.85 GHz
          .===+==================+++++++:                 GPU: AMD Radeon RX 9070 XT [Discrete]
           .-=======================+++:                  Memory: 6.16 GiB / 31.26 GiB (20%)
             ..........................                   Swap: 6.45 MiB / 31.26 GiB (0%)
                                                          Disk (/): 593.05 GiB / 929.51 GiB (64%) - btrfs
                                                          Local IP (enp5s0): 131.241.136.160/24
                                                          Locale: en_US.UTF-8

Are you using OpenCL GPU in darktable?

None

If yes, what is the GPU card and driver?

No response

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

No response

Activity

  1. gi-man commented on Jul 28, 2026

    @gi-man
    Contributor

    This looks like a driver issue. You are in 26.1.5, which is fairly recent. We might need to ping Karol.

  2. Jedek-Selera commented on Jul 29, 2026

    @Jedek-Selera

    Hi, I also have a 9070 XT and run Slackware64-current. After upgrading to Mesa 26.1.5, OpenCL (Rusticl) stopped working in darktable 5.6.0. I also tried mesa-26.2.0_rc2, but darktable still doesn't detect OpenCL. Additionally, I tested kernels 6.18.40 and 7.1.5, but it makes no difference. When I downgrade back to 26.1.4, Rusticl works fine again. Curiously, running clinfo on all of these Mesa versions shows that OpenCL is present and available.

  3. karolherbst commented on Jul 29, 2026

    @karolherbst

    Huh, so 26.1.5 regressed things?

  4. karolherbst commented on Jul 29, 2026

    @karolherbst

    What libclc version is installed? Because the llvm-22 one is broken

  5. Jedek-Selera commented on Jul 29, 2026

    @Jedek-Selera

    libclc-22.1.8

  6. karolherbst commented on Jul 29, 2026

    @karolherbst

    libclc-22.1.8

    yeah, that's broken, needs llvm/llvm-project#207264, which upstream won't merge, because llvm-22 is EoL, so every distribution has to patch now.

    Or download the binaries from https://gitlab.freedesktop.org/karolherbst/mesa-libclc/-/releases And use them instead. There is no override, so would have to overwrite the package files.

  7. Jedek-Selera commented on Jul 29, 2026

    @Jedek-Selera

    Thanks, Karol. I will forward this to Patrick Volkerding so he can merge the patch into -current.

  8. gi-man commented on Jul 29, 2026

    @gi-man
    Contributor

    I think we should change the title of this issue to: AMD Rusticl OpenCL won't compile with llvm22 (upstream issue) or some similar wording.

  9. changed the title [-]Unable to enable OpenCL in CachyOS, despite being installed[/-] [+]AMD Rusticl OpenCL won't compile with llvm22 (upstream issue)[/+] on Jul 29, 2026
  10. karolherbst commented on Jul 30, 2026

    @karolherbst

    Fyi, Arch picked the patch. Not sure if that also will fix cachyos tho. But Arch should be fine. I've also pinged Fedora maintainers to backport it.

  11. segeeslice commented on Jul 30, 2026

    @segeeslice
    Author

    @karolherbst to clarify: there is something the CachyOS maintainers need to do here to get this working, not something that is fixed in the Darktable code?

    Do they need to upgrade to llvm23, for OpenCL to work?

  12. karolherbst commented on Jul 30, 2026

    @karolherbst

    @karolherbst to clarify: there is something the CachyOS maintainers need to do here to get this working, not something that is fixed in the Darktable code?

    Do they need to upgrade to llvm23, for OpenCL to work?

    please don't update to llvm23

    For this to be fixed, this PR needs to be added to the libclc build: llvm/llvm-project#207264

  13. gi-man commented on Jul 30, 2026

    @gi-man
    Contributor

    It issue is at the llvm22 code and it will need to be patched there and not on dt. llvm23 is not released yet.

  14. segeeslice commented on Aug 1, 2026

    @segeeslice
    Author

    The issue is fixed in CachyOS! Thanks for the help & insight - feel free to modify / close the ticket as necessary

  15. added
    OpenCL
    on Aug 7, 2026
  16. 8 remaining items

  17. karolherbst commented on Aug 8, 2026

    @karolherbst

    Yes, also dnf clean all befor doing so

    Name                : libclc-spirv
    Epoch               : 0
    Version             : 22.1.8
    Release             : 1.fc44
    Architektur         : x86_64
    Installationsgröße  : 13.5 MiB
    Quelle              : libclc-22.1.8-1.fc44.src.rpm
    Aus der Paketquelle : @commandline
    Zusammenfassung     : Spirv subset of libclc
    URL                 : https://libclc.llvm.org
    Lizenz              : Apache-2.0 WITH LLVM-exception OR NCSA OR MIT
    Beschreibung        : The libclc-spirv package contains the spirv*-mesa3d-.spv files only,
                        : which are the subset required for upstream Mesa OpenCL support with RustiCL.
    Anbieter            : Fedora Project
    
    * it seems it's only 'extended.cl' failing to compile ???
    
    [opencl_build_program] could not build program: CL_BUILD_PROGRAM_FAILURE
    [opencl_build_program] BUILD STATUS: -2
    BUILD LOG:
    Internal compilation error: nir_shader not fully linked
    [dt_opencl_device_init] failed to compile program `extended.cl'
    

    Does it work with the MESA_SHADER_CACHE_DISABLE=1 env variable? I thought I fixed the caching issue for 26.1.6.. let me double check

    Yeah... looks like there is still a bug lurking somewhere. I'll dig into it. You can workaround that by deleting ~/.cache/mesa_shader_cache/ once. You shouldn't have to delete it afterwards.

  18. karolherbst commented on Aug 8, 2026

    @karolherbst

    Okay.. rusticl would try to load, parse and compile libclc again if the mtime of the installed file is different... sadly, with the rpm from the scratch build it's not, guess I'll change that to check for the actual content instead.

  19. jenshannoschwalm commented on Aug 9, 2026

    @jenshannoschwalm
    Collaborator

    Yeah... looks like there is still a bug lurking somewhere. I'll dig into it. You can workaround that by deleting ~/.cache/mesa_shader_cache/ once.

    Confirming, dt rusticl works fine now after doing so.

  20. added
    bug: upstream
    on Aug 10, 2026
  21. jenshannoschwalm commented on Aug 11, 2026

    @jenshannoschwalm
    Collaborator

    @karolherbst just saw we will soon have atomic floats :-) thanks multiple lots!

  22. karolherbst commented on Aug 11, 2026

    @karolherbst

    @karolherbst just saw we will soon have atomic floats :-) thanks multiple lots!

    not on AMD, but uhm.. should be trivial to hook up... are you interested more in add/sub or max/min or just having them at all?

  23. jenshannoschwalm commented on Aug 11, 2026

    @jenshannoschwalm
    Collaborator

    What we are missing in current code is the float atomic add(). see the workaround in data/kernels/common.h

  24. karolherbst commented on Aug 11, 2026

    @karolherbst

    What we are missing in current code is the float atomic add(). see the workaround in data/kernels/common.h

    okay, I see. Yeah I think that should be fairly trivial to add to all drivers

  25. github-actions commented on Oct 11, 2026

    @github-actions

    This issue has been marked as stale due to inactivity for the last 60 days. It will be automatically closed in 300 days if no update occurs. Please check if the master branch has fixed it and report again or close the issue.

  26. Ruanjoma commented on Dec 1, 2026

    @Ruanjoma

    The patch #21662 (comment) fixed it for me on two notebooks

    a) Fedora 44 Lenovo with [AMD/ATI] Rembrandt [Radeon 660M / 680M] ,
    libclc.x86_64 22.1.8-1.fc44
    b) Fedora 45 with Intel Corporation WhiskeyLake-U GT2 [UHD Graphics 620] (rev 02),
    libclc.x86_64/ libclc-spirv.x86_64 23.1.6-1 + libclc22.x86_64/libclc22-spirv.x86_64 22.1.8-3

  27. jenshannoschwalm commented on Dec 1, 2026

    @jenshannoschwalm
    Collaborator

    What patch exactly?

  28. Ruanjoma commented on Dec 1, 2026

    @Ruanjoma

    What patch exactly?

    The two binary files for libclc22 from Karol Herbst

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    OpenCLRusticlbug: upstreamno-issue-activity

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions