unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#58887] [PATCH][staging] gnu: vulkan-loader: Add native-search-paths field.
@ 2022-10-30  5:41 Hilton Chain via Guix-patches via
  2022-12-01 15:49 ` Ludovic Courtès
  2023-06-18 16:31 ` Kaelyn via Guix-patches via
  0 siblings, 2 replies; 5+ messages in thread
From: Hilton Chain via Guix-patches via @ 2022-10-30  5:41 UTC (permalink / raw)
  To: 58887

* gnu/packages/vulkan.scm (vulkan-loader): Add native-search-paths field.
[source]: Change ICD and implicit layers looking up behaviour via snippet.
---
 gnu/packages/vulkan.scm | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/gnu/packages/vulkan.scm b/gnu/packages/vulkan.scm
index f5c619a2b2..1371860583 100644
--- a/gnu/packages/vulkan.scm
+++ b/gnu/packages/vulkan.scm
@@ -215,6 +215,22 @@ (define-public vulkan-loader
              (url "https://github.com/KhronosGroup/Vulkan-Loader")
              (commit (string-append "v" version))))
        (file-name (git-file-name name version))
+       (modules '((guix build utils)))
+       (snippet
+        '(substitute* "loader/loader.c"
+           ;; v1.3.207-
+           (("VK_ICD_FILENAMES_ENV_VAR, NULL")
+            "\"VK_ICD_PATH\", override_paths")
+           (("false, NULL, NULL")
+            "false, \"VK_ILAYER_PATH\", override_paths")
+           ;; v1.3.207+
+           (("VK_ICD_FILENAMES_ENV_VAR")
+            "\"VK_ICD_PATH\"")
+           (("relative_location = VK_ILAYERS_INFO_RELATIVE_DIR;" all)
+            (string-append "override_env = loader_secure_getenv"
+                           "(\"VK_ILAYER_PATH\", inst);" all))
+           (("\\(IMPLICIT_LAYER, \\)NULL" m)
+            (string-append m "override_paths"))))
        (sha256
         (base32
          "15gx9ab6w1sjq9hkpbas7z2f8f47j6mlln6p3w26qmydjj8gfjjv"))))
@@ -251,6 +267,13 @@ (define-public vulkan-loader
        ("wayland" ,wayland)))
     (inputs
      (list vulkan-headers))
+    (native-search-paths
+     (list (search-path-specification
+            (variable "VK_ICD_PATH")
+            (files '("share/vulkan/icd.d")))
+           (search-path-specification
+            (variable "VK_ILAYER_PATH")
+            (files '("share/vulkan/implicit_layer.d")))))
     (home-page
      "https://github.com/KhronosGroup/Vulkan-Loader")
     (synopsis "Khronos official ICD loader and validation layers for Vulkan")

base-commit: 63bf06013820aa26aca7dc8f18cb79403b94e9a5
-- 
2.38.0





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

* [bug#58887] [PATCH][staging] gnu: vulkan-loader: Add native-search-paths field.
  2022-10-30  5:41 [bug#58887] [PATCH][staging] gnu: vulkan-loader: Add native-search-paths field Hilton Chain via Guix-patches via
@ 2022-12-01 15:49 ` Ludovic Courtès
  2022-12-23  7:53   ` Hilton Chain via Guix-patches via
  2023-06-18 16:31 ` Kaelyn via Guix-patches via
  1 sibling, 1 reply; 5+ messages in thread
From: Ludovic Courtès @ 2022-12-01 15:49 UTC (permalink / raw)
  To: Hilton Chain; +Cc: 58887

Hi,

Hilton Chain <hako@ultrarare.space> skribis:

> * gnu/packages/vulkan.scm (vulkan-loader): Add native-search-paths field.
> [source]: Change ICD and implicit layers looking up behaviour via snippet.

One comment:

[...]

> +    (native-search-paths
> +     (list (search-path-specification
> +            (variable "VK_ICD_PATH")
> +            (files '("share/vulkan/icd.d")))
> +           (search-path-specification
> +            (variable "VK_ILAYER_PATH")
> +            (files '("share/vulkan/implicit_layer.d")))))

Should these read “lib” rather than “share”, given that they contain
binaries if I’m not mistaken?

Should it be versioned too, like “lib/vulkan/3.0/icd.d”?

Other than that it LGTM.

Thanks,
Ludo’.




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

* [bug#58887] [PATCH][staging] gnu: vulkan-loader: Add native-search-paths field.
  2022-12-01 15:49 ` Ludovic Courtès
@ 2022-12-23  7:53   ` Hilton Chain via Guix-patches via
  0 siblings, 0 replies; 5+ messages in thread
From: Hilton Chain via Guix-patches via @ 2022-12-23  7:53 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 58887

Hi Ludo,

> Should these read “lib” rather than “share”, given that they contain
> binaries if I’m not mistaken?

Actually they don't contain binaries, they are configuration files.

FYI, you can take a look at "$(guix build mesa)/share/vulkan/".

As it's been some time since I submitted the patch, I'll dive into the docs again to find out if
adjustments are needed.

Thanks!




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

* [bug#58887] [PATCH][staging] gnu: vulkan-loader: Add native-search-paths field.
  2022-10-30  5:41 [bug#58887] [PATCH][staging] gnu: vulkan-loader: Add native-search-paths field Hilton Chain via Guix-patches via
  2022-12-01 15:49 ` Ludovic Courtès
@ 2023-06-18 16:31 ` Kaelyn via Guix-patches via
  2023-06-19  6:14   ` bug#58887: " Hilton Chain via Guix-patches via
  1 sibling, 1 reply; 5+ messages in thread
From: Kaelyn via Guix-patches via @ 2023-06-18 16:31 UTC (permalink / raw)
  To: 58887@debbugs.gnu.org

While the original patch description doesn't mention why the native-search-paths variables and associated snippet are needed, if they are to fix error messages like:


  !! validation layer: libVkLayer_MESA_device_select.so: cannot open shared object file: No such file or directory

when running Vulkan programs including vulkaninfo, then this issue can be closed. Commit 61a326442442f9b09911d35b3a3a48cf5335d7d7 fixed the remaining Vulkan layer manifest files to include the full paths to the shared libraries, which resolved the error messages like the one above about not finding the shared object files for layers without introducing new environment variables.




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

* bug#58887: [PATCH][staging] gnu: vulkan-loader: Add native-search-paths field.
  2023-06-18 16:31 ` Kaelyn via Guix-patches via
@ 2023-06-19  6:14   ` Hilton Chain via Guix-patches via
  0 siblings, 0 replies; 5+ messages in thread
From: Hilton Chain via Guix-patches via @ 2023-06-19  6:14 UTC (permalink / raw)
  To: Kaelyn; +Cc: 58887-close

On Mon, 19 Jun 2023 00:31:25 +0800,
Kaelyn via Guix-patches via wrote:
> 
> While the original patch description doesn't mention why the native-search-paths variables and associated snippet are needed, if they are to fix error messages like:
> 
> 
>   !! validation layer: libVkLayer_MESA_device_select.so: cannot open shared object file: No such file or directory
> 
> when running Vulkan programs including vulkaninfo, then this issue can be closed. Commit 61a326442442f9b09911d35b3a3a48cf5335d7d7 fixed the remaining Vulkan layer manifest files to include the full paths to the shared libraries, which resolved the error messages like the one above about not finding the shared object files for layers without introducing new environment variables.

Thank you!




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

end of thread, other threads:[~2023-06-19 13:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-30  5:41 [bug#58887] [PATCH][staging] gnu: vulkan-loader: Add native-search-paths field Hilton Chain via Guix-patches via
2022-12-01 15:49 ` Ludovic Courtès
2022-12-23  7:53   ` Hilton Chain via Guix-patches via
2023-06-18 16:31 ` Kaelyn via Guix-patches via
2023-06-19  6:14   ` bug#58887: " Hilton Chain via Guix-patches via

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).