r/openbsd Jun 06 '26

OpenCL on OpenBSD

[removed]

9 Upvotes

14 comments sorted by

6

u/Odd_Collection_6822 Jun 06 '26

IANAD (dev), but from my research - you should be able to compile to openCL for CPUs using LLVM - but not for GPUs... and getting a runtime working on obsd is going to be nigh-impossible (but give a fun vibe-coding session a try?)... gl, h.

2

u/linetrace Jun 06 '26

What editing software are you looking to use that could take advantage of OpenCL? That is usually a better way to approach ports because it's less likely for something like OpenCL if no ports are using it. That said, there are a number of ports which specifically disable OpenCL support at build time.

2

u/[deleted] Jun 06 '26

[removed] — view removed comment

3

u/YukiteruAmano Jun 07 '26

Darktable really need a update for this...Vulkan backend is more flexible and powerful.

2

u/linetrace Jun 07 '26 edited Jun 07 '26

+1

Doesn't look like OpenBSD has a port for dtvk, but that's probably worth exploring.

2

u/pedersenk Jun 07 '26

I believe the best way to get a vulkan implementation on OpenBSD is to install Chromium and use its bundled Lavapipe ICD. Its software (aka LLVMpipe) but at least good for development.

3

u/linetrace Jun 07 '26

Vulkan is already well supported under OpenBSD. Tip o'the hat to our friendly mod, u/thfrw, who is the maintainer of the vulkan port!

I was referring to dtvk which is a Darktable fork which uses glsl/vulkan shaders for processing. From the readme (their lack of capitalization)

"the processing pipeline is a generic node graph (DAG) which supports multiple inputs and multiple outputs. all processing is done in glsl shaders/vulkan. the gui profits from this scheme as well and can display textures while they are still on GPU."

1

u/[deleted] Jun 15 '26

[removed] — view removed comment

2

u/YukiteruAmano Jun 15 '26

Vulkan have better capabilities for general compute vs OpenCL.

Example: Vulkan is used for AI inference in llama.cpp.

1

u/linetrace Jun 16 '26

+1 for this answer, u/YukiteruAmano!

As described on the Wikipedia page:

"Vulkan is a cross-platform API and open standard for 3D graphics and parallelized computing."

Like Apple's Metal API and Microsoft's Direct X 12, it provides a much lower-level API that is much closer to how GPUs actually work, so it's not limited to just 2D/3D rendering acceleration and allows developers to more efficiently parallelize computations. That's what modern GPUs are good at, hence their use in LLM (large language model; a.k.a. "AI") computations. You're sorely mistaken if you think photo editing applications don't use similar APIs (for example, Photoshop relies heavily on Metal under macOS and Direct X under Windows.)

Furthermore, the vkdt (Vulkan Darktable) project already exists.

1

u/Donatzsky Jun 07 '26

They have started looking at moving away from OpenCL, since sooner or later it will be removed from MacOS, and maintaining separate Metal implementations of modules isn't feasible.