Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 619124 - media-libs/vulkan-loader: support building layers and demos
Summary: media-libs/vulkan-loader: support building layers and demos
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal enhancement
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-05-20 23:32 UTC by Niklas Haas
Modified: 2018-04-22 23:06 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Example of a vulkan loader ebuild that supports building layers and demos (vulkan-base-9999.ebuild,3.14 KB, text/plain)
2017-05-20 23:32 UTC, Niklas Haas
Details
fix for wrong install folder for vulkan loader conf files (vulkan-layer-conf-dir-install-fix.patch,500 bytes, patch)
2018-04-21 07:57 UTC, stephan wezel
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Niklas Haas 2017-05-20 23:32:12 UTC
Created attachment 473558 [details]
Example of a vulkan loader ebuild that supports building layers and demos

From the current ebuild, we can see that it sets:

multilib_src_configure() {
	local mycmakeargs=(
		-DCMAKE_SKIP_RPATH=True
		-DBUILD_TESTS=False
		-DBUILD_LAYERS=False
		-DBUILD_DEMOS=False
		-DBUILD_VKJSON=False
		-DBUILD_LOADER=True
		-DBUILD_WSI_MIR_SUPPORT=False
		-DBUILD_WSI_WAYLAND_SUPPORT=$(usex wayland)
		-DBUILD_WSI_XCB_SUPPORT=$(usex X)
		-DBUILD_WSI_XLIB_SUPPORT=$(usex X)
	)
	cmake-utils_src_configure
}

It would be great if you could also build DEMOS and LAYERS (perhaps controllable via USE flags). These are extremely important for vulkan development, since the layers allow you to debug vulkan code and the ‘demos’ include tools such as `vulkaninfo`.

It's worth pointing out that some of the ebuilds I found online support this. In particular, the one I'm using right now (attached) builds both.
Comment 1 Niklas Haas 2017-05-20 23:40:32 UTC
Instead of my attachment, a better reference would be the `gentoo-gpu` overlay, which has versions of `media-libs/vulkan-loader` packaged that support building vulkaninfo + layers.

It also has SPIRV-Tools and glslang packaged separately.
Comment 2 mercuriete 2017-07-22 12:58:21 UTC
Hi

I want to have vulkaninfo to check the capabilities of a vulkan driver.

I think vulkaninfo is part of DEMOS

Can you create something like vulkaninfo package that force a USE flag "DEMOS" in vulkan-loader?

Thanks for your awesome work!
Comment 3 Peter Asplund 2018-03-10 21:21:42 UTC
I also think that this bug is a very good request. I'm lacking the layers and utilities as a Vulkan developer.
Comment 4 Nick Sarnie gentoo-dev 2018-03-10 21:29:39 UTC
I have had a PR open for this for a very long time. Hopefully a developer can take a look and give me feedback.

https://github.com/gentoo/gentoo/pull/6300

Thanks
Sarnex
Comment 5 Larry the Git Cow gentoo-dev 2018-03-12 17:41:18 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8bf0ace101e40ed165cb86bd0d1998da966a62bf

commit 8bf0ace101e40ed165cb86bd0d1998da966a62bf
Author:     Nick Sarnie <commendsarnex@gmail.com>
AuthorDate: 2017-11-25 21:36:10 +0000
Commit:     Matt Turner <mattst88@gentoo.org>
CommitDate: 2018-03-12 17:41:02 +0000

    media-libs/vulkan-loader: Add demos USE flag
    
    USE=demos builds vulkaninfo and vulkan demos.
    
    Bug: https://bugs.gentoo.org/619124
    Closes: https://github.com/gentoo/gentoo/pull/6300
    Signed-off-by: Nick Sarnie <commendsarnex@gmail.com>

 .../vulkan-loader-9999-no-external-sources.patch   | 33 ++++++++++++++++++++++
 media-libs/vulkan-loader/metadata.xml              |  3 ++
 media-libs/vulkan-loader/vulkan-loader-9999.ebuild |  7 +++--
 3 files changed, 41 insertions(+), 2 deletions(-)}
Comment 6 Nick Sarnie gentoo-dev 2018-03-13 03:32:38 UTC
Hi all,

The demos USE has been added, which includes vulkaninfo. I have submitted another PR today to package SPIRV-Headers and SPIRV-Tools which are required for the layers USE.

Once those are in tree, I will submit another PR for the layers USE.

Thanks,
Sarnex
Comment 7 Simon 2018-04-14 18:13:52 UTC
Just tried to emerge vulkan-loader-9999 and got the following error

CMake Error at demos/CMakeLists.txt:29 (message):
  Selected XCB for demos build but not building Xcb support


-- Configuring incomplete, errors occurred!


Any chance the demo USE flag could be added to one of the releases?
I'm actually only interested in vulkaninfo, so a separate USE flag for that (or just enabling it by default) would also work :)
Comment 8 Nick Sarnie gentoo-dev 2018-04-14 18:59:55 UTC
(In reply to Simon from comment #7)
> Just tried to emerge vulkan-loader-9999 and got the following error
> 
> CMake Error at demos/CMakeLists.txt:29 (message):
>   Selected XCB for demos build but not building Xcb support
> 
> 
> -- Configuring incomplete, errors occurred!
> 
> 
> Any chance the demo USE flag could be added to one of the releases?
> I'm actually only interested in vulkaninfo, so a separate USE flag for that
> (or just enabling it by default) would also work :)

Hi Simon,

You need to enable the X USE flag. I will send a patch to make it required to have X if you enable demos.

I have an open PR to add layers, which also adds version 1.1.70 with the demos USE. I'm waiting for someone to take a look.

Thanks,
Sarnex
Comment 9 Larry the Git Cow gentoo-dev 2018-04-14 19:50:37 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7b7094dde1494d5a38fdc6b8bdb207e8a2d8a0d3

commit 7b7094dde1494d5a38fdc6b8bdb207e8a2d8a0d3
Author:     Nick Sarnie <commendsarnex@gmail.com>
AuthorDate: 2018-03-24 01:57:37 +0000
Commit:     Matt Turner <mattst88@gentoo.org>
CommitDate: 2018-04-14 19:50:21 +0000

    media-libs/vulkan-loader: Add layers USE
    
    Closes: https://bugs.gentoo.org/619124

 ...e-a-file-to-get-the-spirv-tools-commit-ID.patch | 42 ++++++++++++++++++++++
 media-libs/vulkan-loader/metadata.xml              |  1 +
 media-libs/vulkan-loader/vulkan-loader-9999.ebuild | 12 +++++--
 3 files changed, 52 insertions(+), 3 deletions(-)
Comment 10 stephan wezel 2018-04-21 07:55:25 UTC
media-libs/vulkan-loader-1.1.70.0 installs layers into wrong directory.

When building vulkan-loaders with layers useflag enabled the config files for the layers gets installed under /usr/etc/vulkan/explicit_layer.d.
This is a wrong directory.

The problem is that by default src_install installs all under /usr.
y default CMAKE_INSTALL_SYSCONFDIR is set to "etc". But /usr/src/vulkan doesn't work it must be /usr/share/vulkan

A quick fix is to change CMAKE_INSTALL_SYSCONFDIR to /usr
Comment 11 stephan wezel 2018-04-21 07:57:30 UTC
Created attachment 528118 [details, diff]
fix for wrong install folder for vulkan loader conf files
Comment 12 Larry the Git Cow gentoo-dev 2018-04-22 23:03:56 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=89e57fb8b4db589e811846dd108f1076842b66bd

commit 89e57fb8b4db589e811846dd108f1076842b66bd
Author:     Nick Sarnie <sarnex@gentoo.org>
AuthorDate: 2018-04-22 22:58:35 +0000
Commit:     Nick Sarnie <sarnex@gentoo.org>
CommitDate: 2018-04-22 23:03:30 +0000

    media-libs/vulkan-loader: Fix the installation directory of the layers
    
    Upstream installs them into ${prefix}/etc, but these are not configuration files. They should be in the data root directory.
    
    This change is based on an idea from stephan wezel <s.wezel@web.de>
    
    Bug: https://bugs.gentoo.org/619124
    
    Package-Manager: Portage-2.3.31, Repoman-2.3.9

 ...ulkan-loader-Fix-layers-install-directory.patch | 26 +++++++++
 .../vulkan-loader/vulkan-loader-1.1.70.0-r1.ebuild | 65 ++++++++++++++++++++++
 media-libs/vulkan-loader/vulkan-loader-9999.ebuild |  5 +-
 3 files changed, 95 insertions(+), 1 deletion(-)}
Comment 13 Nick Sarnie gentoo-dev 2018-04-22 23:06:45 UTC
(In reply to stephan wezel from comment #11)
> Created attachment 528118 [details, diff] [details, diff]
> fix for wrong install folder for vulkan loader conf files

Hi Stephan,

Thank you for the report. I decided to fix this in a patch because the upstream directory is incorrect. Please try out 1.1.70.0-r1.

Thanks,
Sarnex