Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
media-libs/mesa with NVK . possible? (solved)
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2  
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
hedmo
Veteran
Veteran


Joined: 29 Aug 2009
Posts: 1305
Location: sweden

PostPosted: Sun Feb 04, 2024 8:37 am    Post subject: Reply with quote

update :
sys-kernel/gentoo-sources-6.7.x with nouveau GSP works now . i have update my my overlay : https://github.com/hedmo/hedmos-overlay.git
with media-libs/mesa 23 and unkeyworded 24 versions . feel free to test . mesa-24 will fail with multilib support because of some gentoo related "i think" issues (
Code:

../mesa-24.0.0/src/nouveau/compiler/meson.build:7: WARNING: add_languages is missing native:, assuming languages are wanted for both host and build.
Compiler for language rust for the build machine not found.

../mesa-24.0.0/src/nouveau/compiler/meson.build:7:0: ERROR: Rust compiler rustc -C linker=x86_64-pc-linux-gnu-gcc -C link-arg=-m32 -C link-arg=-mfpmath=sse cannot compile programs.

) that i cannot manage to solve by my self.
Back to top
View user's profile Send private message
mblnx
n00b
n00b


Joined: 04 Mar 2008
Posts: 16

PostPosted: Thu Feb 29, 2024 5:01 am    Post subject: Reply with quote

I believe someone figured out this one (I got interested again today since I saw the announcement that NVK is now fully compliant with vulkan 1.3)

This is the relevant part:
Code:

   if use vulkan; then
      vulkan_enable video_cards_lavapipe swrast
      vulkan_enable video_cards_freedreno freedreno
      vulkan_enable video_cards_intel intel intel_hasvk
      vulkan_enable video_cards_d3d12 microsoft-experimental
      vulkan_enable video_cards_radeonsi amd
      vulkan_enable video_cards_v3d broadcom
      if use video_cards_nouveau; then
         vulkan_enable video_cards_nouveau nouveau-experimental
         echo -e "[properties]\nrust_args = ['--target=\"${rust_abi}\"']\n\n[binaries]\nrust = 'rustc'" > "${T}/rust_fix.ini"
         emesonargs+=(
            --force-fallback-for=syn
            --native-file="${T}"/rust_fix.ini
         )
      fi
   fi


Source -> https://github.com/MrDuartePT/mrduarte-ebuilds/blob/master/media-libs/mesa/mesa-24.0.1.ebuild
That code didn't work directly for me, I tried two versions:
Code:

echo -e "[binaries]\nrust = ['rustc']\n\n[built-in options]\nrust_args=['--target=$(rust_abi)']" > "${T}/rust_fix.ini"
echo -e "[binaries]\nrust = ['rustc','--target=$(rust_abi)']\n" > "${T}/rust_fix.ini"


The second one worked to get past the configuration but hit an issue around proc macros version.

proc macros on rust must be on the same ABI as the compiler (in our case x64), but the second version forces it to be compiled as 32 bits.
Trying to work on that one now

Note 1:
After looking into it more, it seem like the problem has to do with how the meson eclass behaves and what rust requires:
When compiling for multilib, meson is using native compilers for 32 bits. Rust only installs a 64 bit compiler with a 32 bit target.
That build fails, because all the targets are built for 32 bit, but the rust compiler requires a 64 bit proc macro.

Proc macros are run/executed by the host compiler and, as such, they should match the compiler ABI.
Back to top
View user's profile Send private message
hedmo
Veteran
Veteran


Joined: 29 Aug 2009
Posts: 1305
Location: sweden

PostPosted: Fri Mar 01, 2024 5:57 pm    Post subject: Reply with quote

mblnx

Thank you very much!!!
I have been using your ebuild: https://git.lab.how/mb/overlay-mb/src/branch/master/media-libs/mesa/mesa-9999.ebuild the hole day . It builds fine (disable lto people !!!) .

Games that are current (20240301) working for me is :

cod4
shadows of the tomb raider
skyrim V


regards hedmo
Back to top
View user's profile Send private message
mblnx
n00b
n00b


Joined: 04 Mar 2008
Posts: 16

PostPosted: Fri Mar 01, 2024 6:03 pm    Post subject: Reply with quote

\o/

I don't even know what would be the right way to fix the issue, the way Gentoo compiles x86 components in a multilib systems isn't usually cross compiling, but fully using the native compiler for that target. Rust doesn't have the native compiler and it runs into cross compiler issues because meson doesn't know it is cross compiling.

I gave up trying to generate a meson.ini file and just hacked it afterwards, as it worked out fine.

Not the ideal solution, but I tried to make it as generic as possible.
Back to top
View user's profile Send private message
2bc4
n00b
n00b


Joined: 13 Mar 2024
Posts: 3

PostPosted: Wed Mar 13, 2024 8:13 pm    Post subject: Reply with quote

Thanks mblnx!

You may want to add dev-util/bindgen to the dependencies, it failed to build for me without it.

Code:
Program bindgen found: NO

../mesa-9999/src/nouveau/compiler/meson.build:59:23: ERROR: Program 'bindgen' not found or not executable
Back to top
View user's profile Send private message
mblnx
n00b
n00b


Joined: 04 Mar 2008
Posts: 16

PostPosted: Wed Mar 13, 2024 8:24 pm    Post subject: Reply with quote

2bc4 wrote:
Thanks mblnx!

You may want to add dev-util/bindgen to the dependencies, it failed to build for me without it.

Code:
Program bindgen found: NO

../mesa-9999/src/nouveau/compiler/meson.build:59:23: ERROR: Program 'bindgen' not found or not executable


Do you have cbindgen installed too? I remember I had to add it to a previous version of the ebuild I had (there have been some updates from gentoo related to llvm, I guess that one isn't in my version any longer)

Edit: I have added both of them as build dependencies, I should probably have rust added in there too now that I think about it....
Back to top
View user's profile Send private message
2bc4
n00b
n00b


Joined: 13 Mar 2024
Posts: 3

PostPosted: Wed Mar 13, 2024 8:33 pm    Post subject: Reply with quote

I did have cbindgen installed at the time (I use firefox and that pulls it in)

mblnx wrote:
Edit: I have added both of them as build dependencies, I should probably have rust added in there too now that I think about it....


Thank you!
Back to top
View user's profile Send private message
2bc4
n00b
n00b


Joined: 13 Mar 2024
Posts: 3

PostPosted: Sat Mar 16, 2024 11:20 am    Post subject: Reply with quote

Another thing, if you use the latest version of meson (1.4.0) with multilib the build will fail with:

Code:
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: src/nouveau/compiler/libnak_ir_proc.so: error adding
 symbols: file in wrong format
collect2: error: ld returned 1 exit status


Issue already reported to meson: https://github.com/mesonbuild/meson/issues/12973
May want to cap the meson version to 1.3.2 in the ebuild if possible for now.
Back to top
View user's profile Send private message
mblnx
n00b
n00b


Joined: 04 Mar 2008
Posts: 16

PostPosted: Thu Mar 21, 2024 9:20 pm    Post subject: Reply with quote

2bc4 wrote:
Another thing, if you use the latest version of meson (1.4.0) with multilib the build will fail with:

Code:
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: src/nouveau/compiler/libnak_ir_proc.so: error adding
 symbols: file in wrong format
collect2: error: ld returned 1 exit status


Issue already reported to meson: https://github.com/mesonbuild/meson/issues/12973
May want to cap the meson version to 1.3.2 in the ebuild if possible for now.


This is kind of the same issue I had to work around, except meson is also now trying to link it somewhere else.
As it is in unstable, I won't modify the ebuild for now as I will have to modify it again once the bug is solved, eventually.
Back to top
View user's profile Send private message
mblnx
n00b
n00b


Joined: 04 Mar 2008
Posts: 16

PostPosted: Wed Apr 24, 2024 11:38 pm    Post subject: Reply with quote

A new rust crate was added paste-1.0.14
The ebuild has been updated.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum