Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 955269 - media-libs/mesa-25.0.5 Please add support for the imagination Video/GPU Cards
Summary: media-libs/mesa-25.0.5 Please add support for the imagination Video/GPU Cards
Status: RESOLVED WONTFIX
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: 2025-05-02 20:47 UTC by Andrew Cameron
Modified: 2025-05-07 14:03 UTC (History)
1 user (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 Andrew Cameron 2025-05-02 20:47:49 UTC
Please add support for the Imagination Video/GPU Cards.
Many of the newer Riscv SBC's and other boards have these GPU's built in and it would be nice to be able to use them without having to make changes to Gentoo ebuilds.
Comment 1 Matt Turner gentoo-dev 2025-05-05 15:44:31 UTC
Looks like since the last time you requested this (bug #904036) the kernel driver has landed upstream -- in v6.8.

The configuration option in Mesa is still called `imagination-experimental`, but the kernel ABI must be stable.
Comment 2 Andrew Cameron 2025-05-05 15:55:13 UTC
Please enable it as you have already done it for Microsoft where theirs is called microsoft-experimental

See Example
		vulkan_enable video_cards_d3d12 microsoft-experimental
Comment 3 Andrew Cameron 2025-05-05 16:00:42 UTC
Additionally I think llvm-orcjit should be enable on RISCV devices
Comment 4 Matt Turner gentoo-dev 2025-05-05 16:01:07 UTC
Yeah, I'm just thinking out loud since I had to go look up the status of the drivers.
Comment 5 Matt Turner gentoo-dev 2025-05-05 16:03:30 UTC
(In reply to Andrew Cameron from comment #3)
> Additionally I think llvm-orcjit should be enable on RISCV devices

https://gitlab.freedesktop.org/mesa/mesa/-/commit/56f38672a28b91f4be8cf2bb89a47df75a67a663 suggests that this already happens automatically for RISC-V.

Is that not the case?
Comment 6 Larry the Git Cow gentoo-dev 2025-05-05 16:29:54 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9ebb9d277a637bd9f005bf41c90e2004c5786816

commit 9ebb9d277a637bd9f005bf41c90e2004c5786816
Author:     Matt Turner <mattst88@gentoo.org>
AuthorDate: 2025-05-05 16:12:09 +0000
Commit:     Matt Turner <mattst88@gentoo.org>
CommitDate: 2025-05-05 16:29:48 +0000

    media-libs/mesa: Add VIDEO_CARDS=imagination
    
    Bug: https://bugs.gentoo.org/955269
    Signed-off-by: Matt Turner <mattst88@gentoo.org>

 media-libs/mesa/mesa-9999.ebuild | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=97513b1a1141aa21c7ea4cab7fe44c128218c130

commit 97513b1a1141aa21c7ea4cab7fe44c128218c130
Author:     Matt Turner <mattst88@gentoo.org>
AuthorDate: 2025-05-05 16:23:44 +0000
Commit:     Matt Turner <mattst88@gentoo.org>
CommitDate: 2025-05-05 16:29:48 +0000

    profiles/arch/riscv: Unmask video_cards_imagination
    
    Bug: https://bugs.gentoo.org/955269
    Signed-off-by: Matt Turner <mattst88@gentoo.org>

 profiles/arch/riscv/use.mask | 3 +++
 1 file changed, 3 insertions(+)

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

commit a961e47435d75c6695c3e248a9c737aab6ee4119
Author:     Matt Turner <mattst88@gentoo.org>
AuthorDate: 2025-05-05 16:16:56 +0000
Commit:     Matt Turner <mattst88@gentoo.org>
CommitDate: 2025-05-05 16:29:48 +0000

    profiles: Add VIDEO_CARDS=imagination
    
    Bug: Bug: https://bugs.gentoo.org/955269
    Signed-off-by: Matt Turner <mattst88@gentoo.org>

 profiles/arch/base/use.mask    | 1 +
 profiles/desc/video_cards.desc | 1 +
 2 files changed, 2 insertions(+)
Comment 7 Matt Turner gentoo-dev 2025-05-05 16:30:50 UTC
I've added VIDEO_CARDS=imagination to mesa-9999, added it to profiles/, and unmasked it on riscv.

Please confirm that this works for you.
Comment 8 Andrew Cameron 2025-05-05 17:08:10 UTC
The change is not visible yet 

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=97513b1a1141aa21c7ea4cab7fe44c128218c130

And mesa-9999 is not updated yet when I checked.

It may need to propagate still
Comment 9 Andrew Cameron 2025-05-05 23:07:11 UTC
I have it running now.

I added the following to the ebuild as these settings are also needed

    if use video_cards_imagination; then
        emesonargs+=(-Dimagination-srv=true)
        emesonargs+=(-Dtools="imagination")
    fi

Once this is added then its good to go and so far seems to be working on the vulkan side.



[I] x11-apps/mesa-progs
     Available versions:  (~)9.0.0 **9999*l {X gles2 vulkan wayland ABI_MIPS="n32 n64 o32" ABI_S390="32 64" ABI_X86="32 64 x32"}
     Installed versions:  9.0.0(13:51:24 05/04/25)(X vulkan wayland -gles2 ABI_MIPS="-n32 -n64 -o32" ABI_S390="-32 -64" ABI_X86="-32 -64 -x32")
     Homepage:            https://www.mesa3d.org/ https://mesa.freedesktop.org/ https://gitlab.freedesktop.org/mesa/demos
     Description:         Mesa's OpenGL utility and demo programs (glxgears and glxinfo)
Comment 10 Matt Turner gentoo-dev 2025-05-06 16:18:40 UTC
(In reply to Andrew Cameron from comment #9)
> I have it running now.
> 
> I added the following to the ebuild as these settings are also needed
> 
>     if use video_cards_imagination; then
>         emesonargs+=(-Dimagination-srv=true)

What does this do? Does Vulkan not work without it? What are the implications of enabling vs disabling it? (It's off by default)

>         emesonargs+=(-Dtools="imagination")

This appears to build an executable called `rogue_vk_compiler`. Is this really something users are going to want?

I'm not familiar with Imagination, so it would be helpful if you just lead with information that you think would be useful. Otherwise I'm just having to dig into the build system to understand what these options do, and even then not getting any sense for why we need these.
Comment 11 Matt Turner gentoo-dev 2025-05-06 16:30:24 UTC
I've filed an issue upstream with my questions: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13105
Comment 12 Andrew Cameron 2025-05-06 17:59:15 UTC
(In reply to Matt Turner from comment #11)
> I've filed an issue upstream with my questions:
> https://gitlab.freedesktop.org/mesa/mesa/-/issues/13105

Lets see what they say.

However the tools flag turns on this https://gitlab.freedesktop.org/mesa/mesa/-/blob/main/src/imagination/rogue/tools/vk_compiler.c?ref_type=heads
Which is "The Rogue offline Vulkan shader compiler"

And the imagination-srv Enables Services backend for Imagination Technologies 

All my custom ebuilds have always turned these settings on.
Comment 13 Matt Turner gentoo-dev 2025-05-06 19:53:06 UTC
(In reply to Andrew Cameron from comment #12)
> And the imagination-srv Enables Services backend for Imagination
> Technologies

You recognize that this description contains no actual information, right?
Comment 14 Andrew Cameron 2025-05-06 20:33:42 UTC
(In reply to Matt Turner from comment #13)
> (In reply to Andrew Cameron from comment #12)
> > And the imagination-srv Enables Services backend for Imagination
> > Technologies
> 
> You recognize that this description contains no actual information, right?

It adds the support services driver which seems to have an api to communicate with the firmware
Have a look at https://gitlab.freedesktop.org/mesa/mesa/-/blob/main/src/imagination/vulkan/meson.build?ref_type=heads

It adds the following to the build
if with_imagination_srv
  pvr_files += files(
    'winsys/pvrsrvkm/pvr_srv.c',
    'winsys/pvrsrvkm/pvr_srv_bo.c',
    'winsys/pvrsrvkm/pvr_srv_bridge.c',
    'winsys/pvrsrvkm/pvr_srv_job_common.c',
    'winsys/pvrsrvkm/pvr_srv_job_compute.c',
    'winsys/pvrsrvkm/pvr_srv_job_null.c',
    'winsys/pvrsrvkm/pvr_srv_job_render.c',
    'winsys/pvrsrvkm/pvr_srv_job_transfer.c',
    'winsys/pvrsrvkm/pvr_srv_sync.c',
    'winsys/pvrsrvkm/pvr_srv_sync_prim.c',
  )
  pvr_flags += '-DPVR_SUPPORT_SERVICES_DRIVER'
endif
Comment 15 Matt Turner gentoo-dev 2025-05-07 01:17:14 UTC
From https://gitlab.freedesktop.org/mesa/mesa/-/issues/13105#note_2898778:

>> Are you ready for distributions to begin shipping the Vulkan driver?
> 
> No, not yet. We still have quite a big back log of changes in our public repo
> (https://gitlab.freedesktop.org/imagination/mesa/-/tree/dev/bxs) that needs
> upstreaming to make the driver fully functional and conformant.

The Imagination developers don't want distributions to begin shipping the driver. I'll leave support in the -9999 ebuild, but I won't add VIDEO_CARDS=imagination to non-live ebuilds for now.
Comment 16 Andrew Cameron 2025-05-07 14:03:06 UTC
(In reply to Matt Turner from comment #15)
> From https://gitlab.freedesktop.org/mesa/mesa/-/issues/13105#note_2898778:
> 
> >> Are you ready for distributions to begin shipping the Vulkan driver?
> > 
> > No, not yet. We still have quite a big back log of changes in our public repo
> > (https://gitlab.freedesktop.org/imagination/mesa/-/tree/dev/bxs) that needs
> > upstreaming to make the driver fully functional and conformant.
> 
> The Imagination developers don't want distributions to begin shipping the
> driver. I'll leave support in the -9999 ebuild, but I won't add
> VIDEO_CARDS=imagination to non-live ebuilds for now.

Thank you for following up on this.