How to enable OpenCL under Ubuntu 24.04?

Which Linux distro &version are you using? → Ubuntu 24.04.1 LTS
Which kernel are you using? → Linux 6.8.0-50-generic
Which BIOS version are you using? → 03.05
Which Framework Laptop 16 model are you using? (AMD Ryzen™ 7040 Series) → AMD Ryzen™ 9 7940HS w/ Radeon™ 780M Graphics × 16 with dGPU (AMD Radeon™ RX 7700S)

I’m completely new to OpenCL and currently $ clinfo --list gives me an empty output. I’d like to get OpenCL running to use it with darktable (deb installation). I understood, that there are (at least) three ways to use OpenCL:

So what is the recommended way to enable OpenCL? Any good tutorial you can suggest as a starting point? Thx for any support!

To reply to myself, over at pixls.us I got recommended to use rocm.

I don’t really mess with OpenCL - but for some LLM workloads I did install ROCm.

Here is my output:

$ clinfo --list
Platform #0: AMD Accelerated Parallel Processing
 +-- Device #0: gfx1102
 `-- Device #1: gfx1103
1 Like

From you post over there:

iGPU (as `device 1: gfx1103`) and the dGPU (as `device 0: gfx1102`)\

I want to let you know I am fairly certain this is backwards. Device 1 should be the dGPU.

Well, not sure if the device numbering is consistent, but in case it is, it seems to be different for me:

$ clinfo --list
Platform #0: AMD Accelerated Parallel Processing
 +-- Device #0: gfx1102
 `-- Device #1: gfx1103

nvtop outputs:

Device 0 [AMD Radeon™ RX 7700S]   PCIe GEN 4@ 8x RX: N/A TX: N/A
Device 1 [AMD Radeon Graphics]    Integrated GPU RX: N/A TX: N/A

And darktable-cltest (which I initially referred to) outputs:

   DEVICE:                   0: 'gfx1102'
   DEVICE_TYPE:              GPU, dedicated mem
   DEVICE:                   1: 'gfx1103'
   DEVICE_TYPE:              GPU, unified mem

it is correct,

  • the gfx1103 is the iGPU:

(without dgpu:)

clinfo --list
Platform #0: AMD Accelerated Parallel Processing
 `-- Device #0: gfx1103
1 Like

Awesome, I actually discovered the same.

Interestingly, for OpenCL its 7700s first, but for Vulkan its opposite:

OpenCL
0 0 AMD Radeon RX 7700S
0 1 AMD Radeon 780M
Vulkan
0 0 AMD Radeon 780M (RADV GFX1103_R1)
0 1 AMD Radeon RX 7700S (RADV NAVI33)
0 2 llvmpipe (LLVM 19.1.0, 256 bits)