diff mbox series

[meta-oe,2/2] opencl-icd-loader: make use of the 'opencl' DISTRO_FEATURE

Message ID 20250917140203.895760-2-dmitry.baryshkov@oss.qualcomm.com
State Under Review
Headers show
Series [meta-oe,1/2] opencl-icd-loader: pull in ICD packages | expand

Commit Message

Dmitry Baryshkov Sept. 17, 2025, 2:02 p.m. UTC
Currently packages like Mesa list 'opengl' and 'vulkan' as required
DISTRO_FEATURES, disabling GPU support for non-graphics-enabled cases.
However in the modern world it's a perfectly fine usecase to have a
headless box with GPU being used by OpenCL only. The OE-Core has added
the 'opencl' DISTRO_FEATURE, making it possible to specify whether
OpenCL is enabled or not and also making it possible to enable GPU
packages if only OpenCL is required.

Follow the example of GLVND and vulkan-loader and disable OpenCL ICD
loader if corresponding feature is not enabled.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>

---

Note, this depends on https://lore.kernel.org/openembedded-core/20250915232557.536762-1-dmitry.baryshkov@oss.qualcomm.com/

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
 meta-oe/recipes-core/opencl/opencl-icd-loader_2024.05.08.bb | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta-oe/recipes-core/opencl/opencl-icd-loader_2024.05.08.bb b/meta-oe/recipes-core/opencl/opencl-icd-loader_2024.05.08.bb
index 16c070e4b538..8c8f1ae7dbe0 100644
--- a/meta-oe/recipes-core/opencl/opencl-icd-loader_2024.05.08.bb
+++ b/meta-oe/recipes-core/opencl/opencl-icd-loader_2024.05.08.bb
@@ -4,7 +4,9 @@  LICENSE = "Apache-2.0"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
 SECTION = "base"
 
-inherit pkgconfig cmake
+inherit pkgconfig cmake features_check
+
+REQUIRED_DISTRO_FEATURES = "opencl"
 
 DEPENDS += "opencl-headers"