Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 818019 - media-libs/mesa[vulkan] : enable software rasterizer (lavapipe)
Summary: media-libs/mesa[vulkan] : enable software rasterizer (lavapipe)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 2 votes (vote)
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2021-10-13 21:59 UTC by Thomas Capricelli
Modified: 2023-06-17 23:05 UTC (History)
4 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Capricelli 2021-10-13 21:59:17 UTC
Mesa includes a software rasterizer for vulkan ("lavapipe"). Very similar to how llvmpipe works. But the ebuild currently ignore it.

(thx BtbN @ irc for the following information):

It's probably just a matter of adding a line 
"vulkan_enable -- swrast"
inside the "if use vulkan; then" block.

Or whichever way you experts might think of.



Reproducible: Always
Comment 1 Thomas Capricelli 2021-10-13 22:12:02 UTC
I did exactly that in my local overlay.

You still get the message
 * Ignoring USE=vulkan     since VIDEO_CARDS does not contain i965, iris, radeonsi, or v3d


But at the end, you do have vulkan files installed:
--- files.mesa.before   2021-10-14 00:06:37.990659234 +0200
+++ files.mesa.after    2021-10-14 00:10:00.471939276 +0200
@@ -26,6 +26,7 @@
 /usr/lib/libglapi.so
 /usr/lib/libglapi.so.0
 /usr/lib/libglapi.so.0.0.0
+/usr/lib/libvulkan_lvp.so
 /usr/lib/pkgconfig
 /usr/lib/pkgconfig/dri.pc
 /usr/lib/pkgconfig/gbm.pc
@@ -53,6 +54,7 @@
 /usr/lib64/libglapi.so
 /usr/lib64/libglapi.so.0
 /usr/lib64/libglapi.so.0.0.0
+/usr/lib64/libvulkan_lvp.so
 /usr/lib64/pkgconfig
 /usr/lib64/pkgconfig/dri.pc
 /usr/lib64/pkgconfig/gbm.pc
@@ -63,13 +65,16 @@

 /usr/share/glvnd/egl_vendor.d/50_mesa.json
 /usr/share/vulkan
+/usr/share/vulkan/icd.d
+/usr/share/vulkan/icd.d/lvp_icd.i686.json
+/usr/share/vulkan/icd.d/lvp_icd.x86_64.json
 /usr/share/vulkan/implicit_layer.d
 /usr/share/vulkan/implicit_layer.d/VkLayer_MESA_device_select.json


And more importantly, vulkan-info now reports something:

orzel@berlioz /var/tmp% vulkaninfo 
WARNING: lavapipe is not a conformant vulkan implementation, testing use only.
==========
VULKANINFO
==========

Vulkan Instance Version: 1.2.182

...
Comment 2 Thomas Capricelli 2021-10-19 18:18:32 UTC
I tried some vulkan exmples found on the web, and most of them work. Those that don't require some extension not implemented (yet?) by lavapipe.
Comment 3 Adam 2022-11-15 02:02:48 UTC
I concur! I can't even run sway on this crappy ast graphics without a vulkan software renderer. What can we do to get these changes in the main tree?
Comment 4 Thomas Capricelli 2022-11-15 02:45:46 UTC
It's really not much to change in the ebuild ...
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-11-15 02:48:32 UTC
(In reply to Thomas Capricelli from comment #4)
> It's really not much to change in the ebuild ...

Can you attach a git am-able patch to the ebuild using git format-patch then? Thanks.
Comment 6 Thomas Capricelli 2022-11-17 17:25:41 UTC
i dont know about "git am-able patch", but this is really as said : just add this one liner:


--- /usr/portage/media-libs/mesa/mesa-22.2.3.ebuild    2022-11-14 23:24:19.873280859 +0100
+++ mesa-22.2.3-r1.ebuild       2022-11-17 18:19:57.361835712 +0100
@@ -416,6 +416,7 @@
                vulkan_enable video_cards_d3d12 microsoft-experimental
                vulkan_enable video_cards_radeonsi amd
                vulkan_enable video_cards_v3d broadcom
+               vulkan_enable -- swrast
        fi
 
        driver_list() {
Comment 7 Larry the Git Cow gentoo-dev 2023-06-16 20:24:26 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0c628930a95b68330942158cd315ff66f286cb23

commit 0c628930a95b68330942158cd315ff66f286cb23
Author:     Paul Zander <negril.nx+gentoo@gmail.com>
AuthorDate: 2023-06-15 13:40:54 +0000
Commit:     Matt Turner <mattst88@gentoo.org>
CommitDate: 2023-06-16 20:24:22 +0000

    media-libs/mesa: add Vulkan software rasterizer as VIDEO_CARDS=lavapipe
    
    Mesa includes a software rasterizer for vulkan ("lavapipe") based on
    llvmpipe.
    
    Add lavapipe to VIDEO_CARDS to enable it.
    
    Bug: https://bugs.gentoo.org/818019
    Closes: https://github.com/gentoo/gentoo/pull/31455
    Signed-off-by: Paul Zander <negril.nx+gentoo@gmail.com>
    Signed-off-by: Matt Turner <mattst88@gentoo.org>

 media-libs/mesa/mesa-23.1.2-r1.ebuild | 449 ++++++++++++++++++++++++++++++++++
 media-libs/mesa/mesa-9999.ebuild      |   4 +-
 profiles/desc/video_cards.desc        |   1 +
 3 files changed, 453 insertions(+), 1 deletion(-)
Comment 8 Thomas Capricelli 2023-06-17 12:05:22 UTC
I'm not sure. With current ebuild installed (media-libs/mesa-23.1.1) i got:

% equery  files mesa |grep lvp # nothing
% vulkaninfo
ERROR: [Loader Message] Code 0 : vkCreateInstance: Found no drivers!
Cannot create Vulkan instance.


While with the software rasterizer, i had an output for both commands.


Mesa is installed with +wayland +vulkan as confirmed by "equery uses mesa"
Comment 9 Thomas Capricelli 2023-06-17 12:06:51 UTC
I mean, i do see the line "gallium_enable -- swrast" in the ebuild, but i'm not sure what gallium_enable does.
Comment 10 Matt Turner gentoo-dev 2023-06-17 15:44:14 UTC
Did you enable VIDEO_CARDS=lavapipe ...?

I see /usr/lib64/libvulkan_lvp.so on my system.
Comment 11 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-06-17 15:45:15 UTC
Yes, in particular, note that what was committed was *not* the original patch posted in this bug.

You can see it at https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0c628930a95b68330942158cd315ff66f286cb23 which clearly has lavapipe.
Comment 12 Thomas Capricelli 2023-06-17 23:05:41 UTC
Yeps, portage update + VIDEO_CARDS=lavapipe solved this.
Thanks for bringing lavapipe to gentoo !