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 1, 2  Next  
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: 1331
Location: sweden

PostPosted: Sat Nov 05, 2022 5:09 pm    Post subject: media-libs/mesa with NVK . possible? (solved) Reply with quote

hi all .

i have been following NVK development and wonder if it is possible to have media-libs/mesa with NVK. media-libs/mesa is quite a heavy ebuild
to modify . i am maintaining : https://github.com/hedmo/grate-overlay/tree/master/media-libs/mesa and can modify a bit but want to hear from the pros
how to add NVK in the ebuild " you know better then me ;) " . i have Turing and Kepler so it would be fun to continue the following on the hardware to .

regards


Last edited by hedmo on Fri Mar 01, 2024 5:58 pm; edited 3 times in total
Back to top
View user's profile Send private message
GDH-gentoo
Veteran
Veteran


Joined: 20 Jul 2019
Posts: 1701
Location: South America

PostPosted: Mon Nov 07, 2022 1:49 pm    Post subject: Re: media-libs/mesa with NVK . possible? Reply with quote

hedmo wrote:
i am maintaining : https://github.com/hedmo/grate-overlay/tree/master/media-libs/mesa [...]

First problem is that NVK's code lives in a different Git repository (branch nvk/main of https://gitlab.freedesktop.org/nouveau/mesa), but these ebuilds pull from the grate-driver repository at GitHub. I suppose that you would have to create a new package (e.g. media-libs/mesa-nvk) that conflicts with media-libs/mesa (by writing a blocker).
_________________
NeddySeagoon wrote:
I'm not a witch, I'm a retired electronics engineer :)
Ionen wrote:
As a packager I just don't want things to get messier with weird build systems and multiple toolchains requirements though :)
Back to top
View user's profile Send private message
hedmo
Veteran
Veteran


Joined: 29 Aug 2009
Posts: 1331
Location: sweden

PostPosted: Mon Nov 07, 2022 5:08 pm    Post subject: Reply with quote

GDH-gentoo

Thank you for your reply .

About grate .It pulls from git and using a new driver "grate" with nouveau . I think it will be the same for NVK like i have done on mesa "grate" by adding flags for NVK to work with nouveau ? . But a more clean way would be to add a use flag for NVK as it is a feature for nouveau
and not a new driver?

regards
Back to top
View user's profile Send private message
GDH-gentoo
Veteran
Veteran


Joined: 20 Jul 2019
Posts: 1701
Location: South America

PostPosted: Mon Nov 07, 2022 5:15 pm    Post subject: Reply with quote

The problem is that there are two different forks of Mesa here: the one that contains the code of the grate driver, and the one that contains the code of NVK. You can only install one fork. Hence, the need for two different packages that conflict with each other.
_________________
NeddySeagoon wrote:
I'm not a witch, I'm a retired electronics engineer :)
Ionen wrote:
As a packager I just don't want things to get messier with weird build systems and multiple toolchains requirements though :)
Back to top
View user's profile Send private message
hedmo
Veteran
Veteran


Joined: 29 Aug 2009
Posts: 1331
Location: sweden

PostPosted: Mon Nov 07, 2022 8:03 pm    Post subject: Reply with quote

GDH-gentoo

I know . I am going to use : media-libs/mesa::gentoo and modify the correct fork . My question is not about the fork but how to add NVK
support in ebuild . Should i add it as a useflag or add it as a driver. Add the driver like i have in my mesa "grate" or something else ?.
I can have as many media-libs/mesa as i like .... i only need to add the provider i dont want to use to package.mask . or create a ebuild
for that to : https://github.com/hedmo/grate-overlay/blob/master/sys-config/grate/files/package.mask/grate

regards
Back to top
View user's profile Send private message
GDH-gentoo
Veteran
Veteran


Joined: 20 Jul 2019
Posts: 1701
Location: South America

PostPosted: Mon Nov 07, 2022 8:57 pm    Post subject: Reply with quote

To get the code of NVK, you have to fetch it from the nvk/main branch of the Nouveau GitLab repository. That means changing EGIT_REPO_URI. I am not in front of my Gentoo computer right now to test ebuild code, but I'd make the combination of VIDEO_CARDS="nouveau" and the vulkan USE flag enable NVK. As far as I can tell, NVK is enabled by adding "nouveau-experimental" to Meson's vulkan-drivers option.

But changing EGIT_REPO_URI, in turn, makes you lose the code of the grate-driver repository.
_________________
NeddySeagoon wrote:
I'm not a witch, I'm a retired electronics engineer :)
Ionen wrote:
As a packager I just don't want things to get messier with weird build systems and multiple toolchains requirements though :)
Back to top
View user's profile Send private message
GDH-gentoo
Veteran
Veteran


Joined: 20 Jul 2019
Posts: 1701
Location: South America

PostPosted: Wed Nov 09, 2022 3:01 am    Post subject: Reply with quote

Applying this patch:

Code:
--- original/mesa-9999.ebuild   2022-11-08 23:49:58.351629502 -0300
+++ new/mesa-9999.ebuild        2022-11-08 23:10:04.765602686 -0300
@@ -5,20 +5,15 @@
 
 PYTHON_COMPAT=( python3_{8..11} )
 
-inherit llvm meson-multilib python-any-r1 linux-info
+inherit git-r3 llvm meson-multilib python-any-r1 linux-info
 
 MY_P="${P/_/-}"
 
 DESCRIPTION="OpenGL-like graphic library for Linux"
 HOMEPAGE="https://www.mesa3d.org/ https://mesa.freedesktop.org/"
 
-if [[ ${PV} == 9999 ]]; then
-       EGIT_REPO_URI="https://gitlab.freedesktop.org/mesa/mesa.git"
-       inherit git-r3
-else
-       SRC_URI="https://archive.mesa3d.org/${MY_P}.tar.xz"
-       KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~sparc-solaris ~x64-solaris ~x86-solaris"
-fi
+EGIT_REPO_URI="https://gitlab.freedesktop.org/nouveau/mesa.git"
+EGIT_BRANCH="nvk/main"
 
 LICENSE="MIT"
 SLOT="0"
@@ -228,9 +223,10 @@
                if ! use video_cards_d3d12 &&
                   ! use video_cards_freedreno &&
                   ! use video_cards_intel &&
+                  ! use video_cards_nouveau &&
                   ! use video_cards_radeonsi &&
                   ! use video_cards_v3d; then
-                       ewarn "Ignoring USE=vulkan     since VIDEO_CARDS does not contain d3d12, freedreno, intel, radeonsi, or v3d"
+                       ewarn "Ignoring USE=vulkan     since VIDEO_CARDS does not contain d3d12, freedreno, intel, nouveau, radeonsi, or v3d"
                fi
        fi
 
@@ -398,6 +394,7 @@
        if use vulkan; then
                vulkan_enable video_cards_freedreno freedreno
                vulkan_enable video_cards_intel intel
+               vulkan_enable video_cards_nouveau nouveau-experimental
                vulkan_enable video_cards_d3d12 microsoft-experimental
                vulkan_enable video_cards_radeonsi amd
                vulkan_enable video_cards_v3d broadcom

to this ebuild creates an ebuild that works for me and seems to produce the correct files:
Code:
/var/tmp/portage/media-libs/mesa-9999/image/usr/lib64/libvulkan_nouveau.so
/var/tmp/portage/media-libs/mesa-9999/image/usr/share/vulkan/icd.d/nouveau_icd.x86_64.json

_________________
NeddySeagoon wrote:
I'm not a witch, I'm a retired electronics engineer :)
Ionen wrote:
As a packager I just don't want things to get messier with weird build systems and multiple toolchains requirements though :)
Back to top
View user's profile Send private message
hedmo
Veteran
Veteran


Joined: 29 Aug 2009
Posts: 1331
Location: sweden

PostPosted: Wed Nov 09, 2022 6:42 am    Post subject: Reply with quote

GDH-gentoo

Yes i made the changes like you did but used another fork . ATM vkcube starts but is broken but thats not a big of a deal . Now i can see the progress on my pc .

Regards
Back to top
View user's profile Send private message
GDH-gentoo
Veteran
Veteran


Joined: 20 Jul 2019
Posts: 1701
Location: South America

PostPosted: Wed Nov 09, 2022 2:24 pm    Post subject: Reply with quote

hedmo wrote:
Yes i made the changes like you did but used another fork .

Which "other fork"? Is there any other that provides libvulkan_nouveau.so?
_________________
NeddySeagoon wrote:
I'm not a witch, I'm a retired electronics engineer :)
Ionen wrote:
As a packager I just don't want things to get messier with weird build systems and multiple toolchains requirements though :)
Back to top
View user's profile Send private message
hedmo
Veteran
Veteran


Joined: 29 Aug 2009
Posts: 1331
Location: sweden

PostPosted: Wed Nov 09, 2022 4:47 pm    Post subject: Reply with quote

GDH-gentoo wrote:

Which "other fork"? Is there any other that provides libvulkan_nouveau.so?


Yes and no . At first i used Karols (contributor) fork but ended up with : https://gitlab.freedesktop.org/nouveau/mesa.git .
And just patched it with the needs for kepler support. how about you . have you tested it out ?. i did test it out and have to say it was working quite well with NV166 but as i said
, broken with NVE0 ..
Back to top
View user's profile Send private message
GDH-gentoo
Veteran
Veteran


Joined: 20 Jul 2019
Posts: 1701
Location: South America

PostPosted: Thu Nov 10, 2022 12:16 am    Post subject: Reply with quote

hedmo wrote:
how about you . have you tested it out ?

No, I don't have the required hardware. But I thought I could help with the ebuild modifications :)

I did check that all ebuild phases up to and including src_install() succeeded with the changes, though.
_________________
NeddySeagoon wrote:
I'm not a witch, I'm a retired electronics engineer :)
Ionen wrote:
As a packager I just don't want things to get messier with weird build systems and multiple toolchains requirements though :)
Back to top
View user's profile Send private message
Asch
n00b
n00b


Joined: 20 Jan 2010
Posts: 25
Location: Nowhere special

PostPosted: Sat Mar 04, 2023 2:15 am    Post subject: Reply with quote

Sorry for the necroposting, but I believe this is the most appropriate thread to discuss this topic.

I'm trying to get my RTX 2060 working with NVK, but haven't been successful so far. Sway segfaults with the default renderer and complains of missing layers when I use WLR_RENDERER=vulkan.

I'm on gentoo-sources-6.2 btw. I tried adding those modifications to my local mesa-9999.ebuild, which also pulls from that nouveau repository.

Should I remove the nouveau flag from the global userland?
Back to top
View user's profile Send private message
hedmo
Veteran
Veteran


Joined: 29 Aug 2009
Posts: 1331
Location: sweden

PostPosted: Sat Mar 04, 2023 5:47 am    Post subject: Reply with quote

hi .

i am using a modified mesa-9999 for nvk on my rtx2060 and kepler systems. i cannot say much about your problem more then
that vulkan are missing a lot . one thing you need to know when you are using nouveau with tuning is that it does use nouveau driver.
nv166 is not supported yet and you only have kms with it. for me when i am checking vulkan with my tuning card i have only manage to see
one game that may want to use it and the rest are grabbing my IGPU . the only thing i can say is that you find what is needed ,
watch the nvk repo till it has been merged or fix it your self and contribute with it.

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


Joined: 20 Jan 2010
Posts: 25
Location: Nowhere special

PostPosted: Mon Mar 06, 2023 3:00 am    Post subject: Reply with quote

Well, I believe that I will need to wait a bit longer for them to have proper support, then. I don't have a fallback iGPU. :lol:

Ty very much for letting me know. Cheers!
Back to top
View user's profile Send private message
hedmo
Veteran
Veteran


Joined: 29 Aug 2009
Posts: 1331
Location: sweden

PostPosted: Sat Nov 25, 2023 6:38 am    Post subject: Reply with quote

NAK has been pushed to mesa and it depends on rustc . now mesa will fail with :

Code:
 
Compiler for C supports link arguments -Wl,-z,relro: YES
../mesa-9999/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-9999/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.

A full log can be found at /var/tmp/portage/media-libs/mesa-9999/work/mesa-9999-abi_x86_32.x86/meson-logs/meson-log.txt
 * ERROR: media-libs/mesa-9999::x-hedmo failed (configure phase):


and i need some help sort it out .

regards hedmo
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22675

PostPosted: Sat Nov 25, 2023 4:21 pm    Post subject: Reply with quote

Is rustc actually installed and otherwise functional? We need to understand whether your problem is that you lack Rust intentionally and will not install Rust (in which case you probably need to revert the patches that depend on rustc), that you lack Rust currently but can install it (in which case you need to install it), or that you have Rust and the test program fails to accept it.
Back to top
View user's profile Send private message
hedmo
Veteran
Veteran


Joined: 29 Aug 2009
Posts: 1331
Location: sweden

PostPosted: Mon Nov 27, 2023 4:27 am    Post subject: Reply with quote

i have rust-bin installed.

Code:

[ebuild   R    ] dev-lang/rust-bin-1.73.0:stable::gentoo  USE="(-big-endian) -clippy -doc (-prefix) -rust-analyzer -rust-src -rustfmt -verify-sig" ABI_X86="32 (64) (-x32)" CPU_FLAGS_X86="sse2" 0 KiB


i dont know how to test if it works/functional.
Back to top
View user's profile Send private message
sMueggli
Guru
Guru


Joined: 03 Sep 2022
Posts: 496

PostPosted: Mon Nov 27, 2023 4:09 pm    Post subject: Reply with quote

hedmo wrote:
i dont know how to test if it works/functional.


Quick and dirty:
Code:
rustc <(echo "fn main() { println!(\"Test\"); }"); echo $?


If you get 0 (return code of rustc), then the code compiled successfully. Otherwise you get probably an error message and not 0 for the status code.
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22675

PostPosted: Mon Nov 27, 2023 4:10 pm    Post subject: Reply with quote

If that does not produce a lead, I think we need to see the log that Meson wrote.
Back to top
View user's profile Send private message
hedmo
Veteran
Veteran


Joined: 29 Aug 2009
Posts: 1331
Location: sweden

PostPosted: Mon Nov 27, 2023 5:01 pm    Post subject: Reply with quote

Hu wrote:
If that does not produce a lead, I think we need to see the log that Meson wrote.


here is a snip of it : https://bpa.st/ME7A

hope it will do . the log is to big for wgetpaste
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22675

PostPosted: Mon Nov 27, 2023 5:58 pm    Post subject: Reply with quote

Rust is trying to link a 32-bit program, but is only finding 64-bit Rust libraries. This seems like a bug, but I cannot tell where. Do you need 32-bit support here? Disabling it might bypass the error until the problem is fixed upstream.
Back to top
View user's profile Send private message
hedmo
Veteran
Veteran


Joined: 29 Aug 2009
Posts: 1331
Location: sweden

PostPosted: Tue Nov 28, 2023 8:07 am    Post subject: Reply with quote

Hu.

You are correct. It wont find 32bits rust libraries but i have it installed. After disabled multilib i got an other issue. Now i am missing syn package . Syn is not in portage but find it in rust overlay "dev-rust/syn". It is old and i dont think it is the right way to use that .
Back to top
View user's profile Send private message
hedmo
Veteran
Veteran


Joined: 29 Aug 2009
Posts: 1331
Location: sweden

PostPosted: Sun Dec 03, 2023 5:12 am    Post subject: Reply with quote

ATM . i am trying to set up the dependencies . NAK depends on four crates: syn, proc-macro2, quote, and unicode-ident. this needs to be
prepared in the ebuild to . ATM i have manage to setup the download for some of them and moved the directory for syn to the right place :

Code:

   NAK_URI="
   https://github.com/dtolnay/syn/archive/refs/tags/2.0.15.tar.gz
   https://github.com/dtolnay/proc-macro2/archive/refs/tags/1.0.56.tar.gz
   https://github.com/dtolnay/quote/archive/refs/tags/1.0.25.tar.gz
   "
if [[ ${PV} == 9999 ]]; then
   EGIT_REPO_URI="https://gitlab.freedesktop.org/mesa/mesa.git"
   inherit git-r3
else
   SRC_URI="
   ${NAK_URI}
   https://gitlab.freedesktop.org/mesa/mesa/-/archive/b7517aec9ee665c7b4c8c4629deeb0e34925b777/mesa-b7517aec9ee665c7b4c8c4629deeb0e34925b777.tar.gz
   "
src_prepare() {
   if [[ ${PV} != *9999* ]]; then
   mv "${WORKDIR}"/syn-2.0.15 "${S}"/subprojects/syn-2.0.15 || die
   fi
default_src_prepare
}


but now it fails with : "Subproject exists but has no meson.build file."

but i will get there :)
Back to top
View user's profile Send private message
hedmo
Veteran
Veteran


Joined: 29 Aug 2009
Posts: 1331
Location: sweden

PostPosted: Mon Dec 04, 2023 5:12 pm    Post subject: Reply with quote

ATM i have manage to compile it on 64bit because it fails on 32bit . now back to square one and figure out why it wont take 32bit.

here is the ebuild ATM: https://bpa.st/O45Q
Back to top
View user's profile Send private message
hedmo
Veteran
Veteran


Joined: 29 Aug 2009
Posts: 1331
Location: sweden

PostPosted: Sun Dec 24, 2023 8:18 am    Post subject: Reply with quote

For now i have decided to drop mesa-24.x and continue with 23.x. now on to gsp . ATM i am getting a black screen when booting the kernel with :
Code:

nouveau.config=NvGspRm=1

I am at :6.7.0-rc7 and have the firmware blobs :
Code:

booter_load-535.113.01.bin  booter_unload-535.113.01.bin  bootloader-535.113.01.bin  gsp-535.113.01.bin

.now i have not fully understand what to do next but i have tried to add :
Code:

cat /etc/dracut.conf.d/firmware.conf
install_items+=" /usr/src/open-gpu-kernel-modules/_out/nvidia/tu116/gsp/booter_load-53514602.bin /usr/src/open-gpu-kernel-modules/_out/nvidia/tu116/gsp/booter_unload-53514602.bin /lib/firmware/nvidia/tu102/gsp/gsp-535.113.01.bin "


but still a black screen at boot.
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 1, 2  Next
Page 1 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