Skip to contentSkip to conversation

opencl-icd-loader: pull in ICD packages

PATCH In review Dmitry Baryshkov 2 participants 3 messages Sep 17, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 opencl-icd-loader: pull in ICD packages

Make the OpenCL ICD loader RRECOMMEND the virtual ICD (Installable Client Driver) package, making sure that the BSP can define the most suitable OpenCL driver.

---
 meta-oe/recipes-core/opencl/opencl-icd-loader_2024.05.08.bb | 1 +
 1 file changed, 1 insertion(+)
meta-oe/recipes-core/opencl/opencl-icd-loader_2024.05.08.bb +1 -0
index 2ff9a6ae7ea5..16c070e4b538 100644
@@ -52,3 +52,4 @@ FILES:libicdlog = "${libdir}/libIcdLog.so"
 FILES:libicdlog-dbg = "${libdir}/.debug/libIcdLog.so"
 
 RDEPENDS:${PN} = "libicdlog"
+RRECOMMENDS:${PN} = "virtual-opencl-icd"
Signature · 1 line
2.47.3
#1 lore raw

PATCH 2/2 opencl-icd-loader: make use of the 'opencl' DISTRO_FEATURE

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.

---

Note, this depends on https://lore.kernel.org/openembedded-core/[email protected]/

---
 meta-oe/recipes-core/opencl/opencl-icd-loader_2024.05.08.bb | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
meta-oe/recipes-core/opencl/opencl-icd-loader_2024.05.08.bb +3 -1
index 16c070e4b538..8c8f1ae7dbe0 100644
@@ -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"
 
Signature · 1 line
2.47.3
#2 lore raw

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

I think more recipes need this conditional.

ERROR: Nothing PROVIDES 'virtual/opencl-icd' (but /home/kraj200/yoe/sources/meta-openembedded/meta-oe/recipes-support/opencl/clinfo_3.0.23.01.25.bb, /home/kraj200/yoe/
↪ sources/meta-openembedded/meta-oe/recipes-core/opencl/clpeak_1.1.5.bb
DEPENDS on or otherwise requires it)
ocl-icd PROVIDES virtual/opencl-icd but was skipped:
PREFERRED_PROVIDER_virtual/opencl-icd set to opencl-icd-loader, not
ocl-icd
opencl-icd-loader PROVIDES virtual/opencl-icd but was skipped:
missing required distro feature 'opencl' (not in DISTRO_FEATURES)
ERROR: Nothing RPROVIDES 'clinfo' (but
/home/kraj200/yoe/sources/meta-openembedded/meta-oe/recipes-support/opencl/clinfo_3.0.23.01.25.bb RDEPENDS on or otherwise requires
↪ it)

Quoted 50 lines · Dmitry Baryshkov via lists.openembedded.org

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.

---

Note, this depends on https://lore.kernel.org/openembedded-core/[email protected]/

---
 meta-oe/recipes-core/opencl/opencl-icd-loader_2024.05.08.bb | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
meta-oe/recipes-core/opencl/opencl-icd-loader_2024.05.08.bb +3 -2
index 16c070e4b538..8c8f1ae7dbe0 100644
@@ -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"
 
--

2.47.3

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#119484): https://lists.openembedded.org/g/openembedded-devel/message/119484
Mute This Topic: https://lists.openembedded.org/mt/115291651/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-