All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] Add vulkan validation and improvements for headless devices
@ 2022-11-11 21:47 Jordan Crouse
  2022-11-11 21:47 ` [PATCH v2 1/3] spirv-tools: Correctly set the prefix in exported cmake packages Jordan Crouse
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Jordan Crouse @ 2022-11-11 21:47 UTC (permalink / raw)
  To: openembedded-core; +Cc: Khem Raj, Alexander Kanavin, Jordan Crouse

This small patchset has a few small fixes and a new recipe for the official
Vulkan validation layers from Khronos.

The first patch addresses a bug in the exported cmake packages from
spriv-tools to make sure that the library path is correctly set.  The
second patch enables vulkan-loader for "headless" devices that don't have
either X11 nor Wayland.  The third patch adds the vulkan-validation for the
same version level as the Vulkan headers and other packages.

Changes in v2:
- Don't change PR per Khem Raj
- Put DEPENDS all on one line
- Remove unused OEMAKE flags
- Force /usr/lib/*.so into ${PN} and remove INSANE_SKIP

Jordan Crouse (3):
  spirv-tools: Correctly set the prefix in exported cmake packages
  vulkan-loader: Allow headless targets to build the loader
  vulkan-validation: Add the official Vulkan validation layers

 meta/conf/distro/include/maintainers.inc      |  1 +
 .../spir/spirv-tools_1.3.231.1.bb             |  5 ++-
 .../vulkan/vulkan-loader_1.3.231.1.bb         |  2 -
 .../vulkan/vulkan-validation_1.3.231.1.bb     | 39 +++++++++++++++++++
 4 files changed, 43 insertions(+), 4 deletions(-)
 create mode 100644 meta/recipes-graphics/vulkan/vulkan-validation_1.3.231.1.bb

-- 
2.37.1



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2 1/3] spirv-tools: Correctly set the prefix in exported cmake packages
  2022-11-11 21:47 [PATCH v2 0/3] Add vulkan validation and improvements for headless devices Jordan Crouse
@ 2022-11-11 21:47 ` Jordan Crouse
  2022-11-11 21:47 ` [PATCH v2 2/3] vulkan-loader: Allow headless targets to build the loader Jordan Crouse
  2022-11-11 21:47 ` [PATCH v2 3/3] vulkan-validation: Add the official Vulkan validation layers Jordan Crouse
  2 siblings, 0 replies; 5+ messages in thread
From: Jordan Crouse @ 2022-11-11 21:47 UTC (permalink / raw)
  To: openembedded-core; +Cc: Khem Raj, Alexander Kanavin, Jordan Crouse

spirv-tools exports Cmake packages.  When they are installed the
INTERFACE_LINK_LIBRARIES variable is not correctly updated to use
_IMPORT_PREFIX like the other variables. This may have something to do with
the path to the sysroot being different than the source path.

The existing recipe recognizes that the sysroot path made it through to the
install and tries to get rid of it, but this just ends up with dependent
tools looking in vain for /usr/lib/librt.so.

Replace the INTERFACE_LINK_LIBRARIES value in SPIRV-ToolsTarget.cmake with
"${IMPORT_PREFIX}/lib".

Signed-off-by: Jordan Crouse <jorcrous@amazon.com>
---

Changes in v2:
- Don't change PR per Khem Raj

 meta/recipes-graphics/spir/spirv-tools_1.3.231.1.bb | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-graphics/spir/spirv-tools_1.3.231.1.bb b/meta/recipes-graphics/spir/spirv-tools_1.3.231.1.bb
index ea47796543..e175cde145 100644
--- a/meta/recipes-graphics/spir/spirv-tools_1.3.231.1.bb
+++ b/meta/recipes-graphics/spir/spirv-tools_1.3.231.1.bb
@@ -25,9 +25,10 @@ EXTRA_OECMAKE += "\
 "
 
 do_install:append:class-target() {
-    # reproducibility: remove build host path
+    # Properly set _IMPORT_PREFIX in INTERFACE_LINK_LIBRARIES so that dependent
+    # tools can find the right library
     sed -i ${D}${libdir}/cmake/SPIRV-Tools/SPIRV-ToolsTarget.cmake \
-        -e 's:${STAGING_DIR_HOST}::g'
+        -e 's:INTERFACE_LINK_LIBRARIES.*$:INTERFACE_LINK_LIBRARIES "\$\{_IMPORT_PREFIX\}/lib":'
 }
 
 # all the libraries are unversioned, so don't pack it on PN-dev
-- 
2.37.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v2 2/3] vulkan-loader: Allow headless targets to build the loader
  2022-11-11 21:47 [PATCH v2 0/3] Add vulkan validation and improvements for headless devices Jordan Crouse
  2022-11-11 21:47 ` [PATCH v2 1/3] spirv-tools: Correctly set the prefix in exported cmake packages Jordan Crouse
@ 2022-11-11 21:47 ` Jordan Crouse
  2022-11-11 21:47 ` [PATCH v2 3/3] vulkan-validation: Add the official Vulkan validation layers Jordan Crouse
  2 siblings, 0 replies; 5+ messages in thread
From: Jordan Crouse @ 2022-11-11 21:47 UTC (permalink / raw)
  To: openembedded-core; +Cc: Khem Raj, Alexander Kanavin, Jordan Crouse

vulkan-loader can build and work on headless targets without display
engines so there isn't any need for the ANY_OF_DISTRO_FEATURES restriction.

Signed-off-by: Jordan Crouse <jorcrous@amazon.com>
---

(no changes since v1)

 meta/recipes-graphics/vulkan/vulkan-loader_1.3.231.1.bb | 2 --
 1 file changed, 2 deletions(-)

diff --git a/meta/recipes-graphics/vulkan/vulkan-loader_1.3.231.1.bb b/meta/recipes-graphics/vulkan/vulkan-loader_1.3.231.1.bb
index 59c52c1db7..7aab7446f6 100644
--- a/meta/recipes-graphics/vulkan/vulkan-loader_1.3.231.1.bb
+++ b/meta/recipes-graphics/vulkan/vulkan-loader_1.3.231.1.bb
@@ -17,7 +17,6 @@ S = "${WORKDIR}/git"
 REQUIRED_DISTRO_FEATURES = "vulkan"
 
 inherit cmake features_check pkgconfig
-ANY_OF_DISTRO_FEATURES = "x11 wayland"
 
 DEPENDS += "vulkan-headers"
 
@@ -29,7 +28,6 @@ EXTRA_OECMAKE = "\
                  -DVulkanRegistry_DIR=${RECIPE_SYSROOT}/${datadir} \
                  "
 
-# must choose x11 or wayland or both
 PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'wayland x11', d)}"
 
 PACKAGECONFIG[x11] = "-DBUILD_WSI_XLIB_SUPPORT=ON -DBUILD_WSI_XCB_SUPPORT=ON, -DBUILD_WSI_XLIB_SUPPORT=OFF -DBUILD_WSI_XCB_SUPPORT=OFF, libxcb libx11 libxrandr"
-- 
2.37.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v2 3/3] vulkan-validation: Add the official Vulkan validation layers
  2022-11-11 21:47 [PATCH v2 0/3] Add vulkan validation and improvements for headless devices Jordan Crouse
  2022-11-11 21:47 ` [PATCH v2 1/3] spirv-tools: Correctly set the prefix in exported cmake packages Jordan Crouse
  2022-11-11 21:47 ` [PATCH v2 2/3] vulkan-loader: Allow headless targets to build the loader Jordan Crouse
@ 2022-11-11 21:47 ` Jordan Crouse
  2022-11-13 22:22   ` [OE-core] " Alexandre Belloni
  2 siblings, 1 reply; 5+ messages in thread
From: Jordan Crouse @ 2022-11-11 21:47 UTC (permalink / raw)
  To: openembedded-core; +Cc: Khem Raj, Alexander Kanavin, Jordan Crouse

Add a recipe to build the Khronos official Vulkan validation layers that can
assist developers in verifying that their applications correctly use the
Vulkan APIs.

USE_ROBIN_HOOD_HASHING=OFF disables a third party dependency on [1] which
is a performant reimplementation of std::unordered_map and
std::unordered_set that gives better performance when using validation for
extremely heavy workloads on a desktop. There isn't much benefit to
enabling it on most embedded systems so force it off for now but no bias
against making it optional if robin-hood-hashing is made available in the
metadata.

[1] https://github.com/martinus/robin-hood-hashing

Signed-off-by: Jordan Crouse <jorcrous@amazon.com>
---

Changes in v2:
- Put DEPENDS all on one line
- Remove unused OEMAKE flags
- Force /usr/lib/*.so into ${PN} and remove INSANE_SKIP

 meta/conf/distro/include/maintainers.inc      |  1 +
 .../vulkan/vulkan-validation_1.3.231.1.bb     | 39 +++++++++++++++++++
 2 files changed, 40 insertions(+)
 create mode 100644 meta/recipes-graphics/vulkan/vulkan-validation_1.3.231.1.bb

diff --git a/meta/conf/distro/include/maintainers.inc b/meta/conf/distro/include/maintainers.inc
index 5b7ce77c3c..8f319c63a7 100644
--- a/meta/conf/distro/include/maintainers.inc
+++ b/meta/conf/distro/include/maintainers.inc
@@ -810,6 +810,7 @@ RECIPE_MAINTAINER:pn-vulkan-headers = "Anuj Mittal <anuj.mittal@intel.com>"
 RECIPE_MAINTAINER:pn-vulkan-loader = "Anuj Mittal <anuj.mittal@intel.com>"
 RECIPE_MAINTAINER:pn-vulkan-samples = "Ross Burton <ross.burton@arm.com>"
 RECIPE_MAINTAINER:pn-vulkan-tools = "Anuj Mittal <anuj.mittal@intel.com>"
+RECIPE_MAINTAINER:pn-vulkan-validation = "Jordan Crouse <jorcrous@amazon.com>"
 RECIPE_MAINTAINER:pn-waffle = "Ross Burton <ross.burton@arm.com>"
 RECIPE_MAINTAINER:pn-watchdog = "Alexander Kanavin <alex.kanavin@gmail.com>"
 RECIPE_MAINTAINER:pn-watchdog-config = "Alexander Kanavin <alex.kanavin@gmail.com>"
diff --git a/meta/recipes-graphics/vulkan/vulkan-validation_1.3.231.1.bb b/meta/recipes-graphics/vulkan/vulkan-validation_1.3.231.1.bb
new file mode 100644
index 0000000000..37becb1d16
--- /dev/null
+++ b/meta/recipes-graphics/vulkan/vulkan-validation_1.3.231.1.bb
@@ -0,0 +1,39 @@
+SUMMARY = "Vulkan Validation layers"
+DESCRIPTION = "Khronos official Vulkan validation layers to assist developers \
+in verifying that their applications correctly use the Vulkan API"
+HOMEPAGE = "https://www.khronos.org/vulkan/"
+BUGTRACKER = "https://github.com/KhronosGroup/Vulkan-ValidationLayers"
+SECTION = "libs"
+
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=8df9e8826734226d08cb412babfa599c"
+SRC_URI = "git://github.com/KhronosGroup/Vulkan-ValidationLayers.git;branch=sdk-1.3.231;protocol=https"
+
+SRCREV="f489610de566df6a5c20de1a3e54776e0ad852e1"
+
+S = "${WORKDIR}/git"
+
+REQUIRED_DISTRO_FEATURES = "vulkan"
+
+inherit cmake features_check pkgconfig
+
+DEPENDS += "vulkan-headers spirv-headers spirv-tools vulkan-loader glslang"
+
+EXTRA_OECMAKE = "\
+                 -DBUILD_TESTS=OFF \
+                 -DPYTHON_EXECUTABLE=${HOSTTOOLS_DIR}/python3 \
+                 -DVULKAN_HEADERS_INSTALL_DIR=${STAGING_EXECPREFIXDIR} \
+                 -DGLSLANG_INSTALL_DIR=${STAGING_DATADIR} \
+                 -DSPIRV_HEADERS_INSTALL_DIR=${STAGING_EXECPREFIXDIR} \
+                 -DUSE_ROBIN_HOOD_HASHING=OFF \
+                 "
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'wayland x11', d)}"
+
+PACKAGECONFIG[x11] = "-DBUILD_WSI_XLIB_SUPPORT=ON -DBUILD_WSI_XCB_SUPPORT=ON, -DBUILD_WSI_XLIB_SUPPORT=OFF -DBUILD_WSI_XCB_SUPPORT=OFF, libxcb libx11 libxrandr"
+PACKAGECONFIG[wayland] = "-DBUILD_WSI_WAYLAND_SUPPORT=ON, -DBUILD_WSI_WAYLAND_SUPPORT=OFF, wayland"
+
+FILES:${PN} = "${libdir}/*.so ${datadir}/vulkan"
+FILES:${PN}-dev = ""
+
+UPSTREAM_CHECK_GITTAGREGEX = "sdk-(?P<pver>\d+(\.\d+)+)"
-- 
2.37.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [OE-core] [PATCH v2 3/3] vulkan-validation: Add the official Vulkan validation layers
  2022-11-11 21:47 ` [PATCH v2 3/3] vulkan-validation: Add the official Vulkan validation layers Jordan Crouse
@ 2022-11-13 22:22   ` Alexandre Belloni
  0 siblings, 0 replies; 5+ messages in thread
From: Alexandre Belloni @ 2022-11-13 22:22 UTC (permalink / raw)
  To: jorcrous; +Cc: openembedded-core, Khem Raj, Alexander Kanavin

Hello,

This was actually the version I tested and that failed on the
autobuilders.

On 11/11/2022 21:47:14+0000, Jordan Crouse via lists.openembedded.org wrote:
> Add a recipe to build the Khronos official Vulkan validation layers that can
> assist developers in verifying that their applications correctly use the
> Vulkan APIs.
> 
> USE_ROBIN_HOOD_HASHING=OFF disables a third party dependency on [1] which
> is a performant reimplementation of std::unordered_map and
> std::unordered_set that gives better performance when using validation for
> extremely heavy workloads on a desktop. There isn't much benefit to
> enabling it on most embedded systems so force it off for now but no bias
> against making it optional if robin-hood-hashing is made available in the
> metadata.
> 
> [1] https://github.com/martinus/robin-hood-hashing
> 
> Signed-off-by: Jordan Crouse <jorcrous@amazon.com>
> ---
> 
> Changes in v2:
> - Put DEPENDS all on one line
> - Remove unused OEMAKE flags
> - Force /usr/lib/*.so into ${PN} and remove INSANE_SKIP
> 
>  meta/conf/distro/include/maintainers.inc      |  1 +
>  .../vulkan/vulkan-validation_1.3.231.1.bb     | 39 +++++++++++++++++++
>  2 files changed, 40 insertions(+)
>  create mode 100644 meta/recipes-graphics/vulkan/vulkan-validation_1.3.231.1.bb
> 
> diff --git a/meta/conf/distro/include/maintainers.inc b/meta/conf/distro/include/maintainers.inc
> index 5b7ce77c3c..8f319c63a7 100644
> --- a/meta/conf/distro/include/maintainers.inc
> +++ b/meta/conf/distro/include/maintainers.inc
> @@ -810,6 +810,7 @@ RECIPE_MAINTAINER:pn-vulkan-headers = "Anuj Mittal <anuj.mittal@intel.com>"
>  RECIPE_MAINTAINER:pn-vulkan-loader = "Anuj Mittal <anuj.mittal@intel.com>"
>  RECIPE_MAINTAINER:pn-vulkan-samples = "Ross Burton <ross.burton@arm.com>"
>  RECIPE_MAINTAINER:pn-vulkan-tools = "Anuj Mittal <anuj.mittal@intel.com>"
> +RECIPE_MAINTAINER:pn-vulkan-validation = "Jordan Crouse <jorcrous@amazon.com>"
>  RECIPE_MAINTAINER:pn-waffle = "Ross Burton <ross.burton@arm.com>"
>  RECIPE_MAINTAINER:pn-watchdog = "Alexander Kanavin <alex.kanavin@gmail.com>"
>  RECIPE_MAINTAINER:pn-watchdog-config = "Alexander Kanavin <alex.kanavin@gmail.com>"
> diff --git a/meta/recipes-graphics/vulkan/vulkan-validation_1.3.231.1.bb b/meta/recipes-graphics/vulkan/vulkan-validation_1.3.231.1.bb
> new file mode 100644
> index 0000000000..37becb1d16
> --- /dev/null
> +++ b/meta/recipes-graphics/vulkan/vulkan-validation_1.3.231.1.bb
> @@ -0,0 +1,39 @@
> +SUMMARY = "Vulkan Validation layers"
> +DESCRIPTION = "Khronos official Vulkan validation layers to assist developers \
> +in verifying that their applications correctly use the Vulkan API"
> +HOMEPAGE = "https://www.khronos.org/vulkan/"
> +BUGTRACKER = "https://github.com/KhronosGroup/Vulkan-ValidationLayers"
> +SECTION = "libs"
> +
> +LICENSE = "Apache-2.0"
> +LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=8df9e8826734226d08cb412babfa599c"
> +SRC_URI = "git://github.com/KhronosGroup/Vulkan-ValidationLayers.git;branch=sdk-1.3.231;protocol=https"
> +
> +SRCREV="f489610de566df6a5c20de1a3e54776e0ad852e1"
> +
> +S = "${WORKDIR}/git"
> +
> +REQUIRED_DISTRO_FEATURES = "vulkan"
> +
> +inherit cmake features_check pkgconfig
> +
> +DEPENDS += "vulkan-headers spirv-headers spirv-tools vulkan-loader glslang"
> +
> +EXTRA_OECMAKE = "\
> +                 -DBUILD_TESTS=OFF \
> +                 -DPYTHON_EXECUTABLE=${HOSTTOOLS_DIR}/python3 \
> +                 -DVULKAN_HEADERS_INSTALL_DIR=${STAGING_EXECPREFIXDIR} \
> +                 -DGLSLANG_INSTALL_DIR=${STAGING_DATADIR} \
> +                 -DSPIRV_HEADERS_INSTALL_DIR=${STAGING_EXECPREFIXDIR} \
> +                 -DUSE_ROBIN_HOOD_HASHING=OFF \
> +                 "
> +
> +PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'wayland x11', d)}"
> +
> +PACKAGECONFIG[x11] = "-DBUILD_WSI_XLIB_SUPPORT=ON -DBUILD_WSI_XCB_SUPPORT=ON, -DBUILD_WSI_XLIB_SUPPORT=OFF -DBUILD_WSI_XCB_SUPPORT=OFF, libxcb libx11 libxrandr"
> +PACKAGECONFIG[wayland] = "-DBUILD_WSI_WAYLAND_SUPPORT=ON, -DBUILD_WSI_WAYLAND_SUPPORT=OFF, wayland"
> +
> +FILES:${PN} = "${libdir}/*.so ${datadir}/vulkan"
> +FILES:${PN}-dev = ""
> +
> +UPSTREAM_CHECK_GITTAGREGEX = "sdk-(?P<pver>\d+(\.\d+)+)"
> -- 
> 2.37.1
> 

> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#173144): https://lists.openembedded.org/g/openembedded-core/message/173144
> Mute This Topic: https://lists.openembedded.org/mt/94969329/3617179
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alexandre.belloni@bootlin.com]
> -=-=-=-=-=-=-=-=-=-=-=-
> 


-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-11-13 22:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-11 21:47 [PATCH v2 0/3] Add vulkan validation and improvements for headless devices Jordan Crouse
2022-11-11 21:47 ` [PATCH v2 1/3] spirv-tools: Correctly set the prefix in exported cmake packages Jordan Crouse
2022-11-11 21:47 ` [PATCH v2 2/3] vulkan-loader: Allow headless targets to build the loader Jordan Crouse
2022-11-11 21:47 ` [PATCH v2 3/3] vulkan-validation: Add the official Vulkan validation layers Jordan Crouse
2022-11-13 22:22   ` [OE-core] " Alexandre Belloni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.