#32 Enable NVK to support the new Nouveau driver in Linux 6.7+
Merged 3 months ago by ngompa. Opened 4 months ago by ngompa.
rpms/ ngompa/mesa enable-nvk  into  rawhide

file modified
+29 -3
@@ -11,6 +11,10 @@ 

  %global base_vulkan ,amd

  %endif

  

+ %if 0%{?with_vulkan_hw}

+ %global with_nvk 1

+ %endif

+ 

  %ifarch %{ix86} x86_64

  %global with_crocus 1

  %global with_i915   1
@@ -57,7 +61,7 @@ 

  %bcond_with valgrind

  %endif

  

- %global vulkan_drivers swrast%{?base_vulkan}%{?intel_platform_vulkan}%{?extra_platform_vulkan}

+ %global vulkan_drivers swrast%{?base_vulkan}%{?intel_platform_vulkan}%{?extra_platform_vulkan}%{?with_nvk:,nouveau-experimental}

  

  Name:           mesa

  Summary:        Mesa graphics libraries
@@ -77,7 +81,7 @@ 

  # Workaround for llvm/clang bug: https://github.com/llvm/llvm-project/issues/78691

  Patch11:        gallium-Undef-__arm_streaming-macro-to-workaround-cl.patch

  

- BuildRequires:  meson >= 1.2.0

+ BuildRequires:  meson >= 1.3.0

  BuildRequires:  gcc

  BuildRequires:  gcc-c++

  BuildRequires:  gettext
@@ -135,7 +139,7 @@ 

  BuildRequires:  pkgconfig(libelf)

  BuildRequires:  pkgconfig(libglvnd) >= 1.3.2

  BuildRequires:  llvm-devel >= 7.0.0

- %if 0%{?with_opencl}

+ %if 0%{?with_opencl} || 0%{?with_nvk}

  BuildRequires:  clang-devel

  BuildRequires:  bindgen

  BuildRequires:  rust-packaging
@@ -143,6 +147,12 @@ 

  BuildRequires:  pkgconfig(SPIRV-Tools)

  BuildRequires:  pkgconfig(LLVMSPIRVLib)

  %endif

+ %if 0%{?with_nvk}

+ BuildRequires:  (crate(proc-macro2) >= 1.0.56 with crate(proc-macro2) < 2)

+ BuildRequires:  (crate(quote) >= 1.0.25 with crate(quote) < 2)

+ BuildRequires:  (crate(syn/clone-impls) >= 2.0.15 with crate(syn/clone-impls) < 3)

+ BuildRequires:  (crate(unicode-ident) >= 1.0.6 with crate(unicode-ident) < 2)

+ %endif

  %if %{with valgrind}

  BuildRequires:  pkgconfig(valgrind)

  %endif
@@ -366,6 +376,18 @@ 

  # ensure standard Rust compiler flags are set

  export RUSTFLAGS="%build_rustflags"

  

+ %if 0%{?with_nvk}

+ export MESON_PACKAGE_CACHE_DIR="%{cargo_registry}/"

+ # So... Meson can't actually find them without tweaks

+ %define inst_crate_nameversion() %(basename %{cargo_registry}/%{1}-*)

+ %define rewrite_wrap_file() sed -e "/source.*/d" -e "s/%{1}-.*/%{inst_crate_nameversion %{1}}/" -i subprojects/%{1}.wrap

+ 

+ %rewrite_wrap_file proc-macro2

+ %rewrite_wrap_file quote

+ %rewrite_wrap_file syn

+ %rewrite_wrap_file unicode-ident

+ %endif

+ 

  # We've gotten a report that enabling LTO for mesa breaks some games. See

  # https://bugzilla.redhat.com/show_bug.cgi?id=1862771 for details.

  # Disable LTO for now
@@ -659,6 +681,10 @@ 

  %{_libdir}/libvulkan_radeon.so

  %{_datadir}/drirc.d/00-radv-defaults.conf

  %{_datadir}/vulkan/icd.d/radeon_icd.*.json

+ %if 0%{?with_nvk}

+ %{_libdir}/libvulkan_nouveau.so

+ %{_datadir}/vulkan/icd.d/nouveau_icd.*.json

+ %endif

  %ifarch %{ix86} x86_64

  %{_libdir}/libvulkan_intel.so

  %{_datadir}/vulkan/icd.d/intel_icd.*.json

With new nouveau driver coming with Linux 6.7, NVK will be able to
be used for Turing+ GPUs (GTX 16/RTX 20+), and it will be used by
default for Ada Lovelace+ GPUs (RTX 40+).

Build succeeded.
https://fedora.softwarefactory-project.io/zuul/buildset/ff68e5a85c944258bf4ea37b76539075

I don't think upstream wants this turned on for 23.3.0 since it doesn't really have all the features we need. We should wait for 24.0.0-rc1, not sure doing snapshots is a good plan unless we have some sort of plans to update them often.

rebased onto a6f4c63

3 months ago

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci
https://fedora.softwarefactory-project.io/zuul/buildset/1e46f212e1824c91a8d3bfb90e521c57

rebased onto 03e3539

3 months ago

rebased onto 242f436

3 months ago

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci
https://fedora.softwarefactory-project.io/zuul/buildset/b524727b5e3d445696a3a6f0d1616b6a

rebased onto 86489d5

3 months ago

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci
https://fedora.softwarefactory-project.io/zuul/buildset/cb8e69537da644f1ac9ece780135b6be

rebased onto 3042fff

3 months ago

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci
https://fedora.softwarefactory-project.io/zuul/buildset/081a3ef7e69a4afcbd8cc8921cb12300

rebased onto be2780e

3 months ago

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci
https://fedora.softwarefactory-project.io/zuul/buildset/0abc7b6c777e407b9a028d2c9b44ff24

rebased onto 040eb48

3 months ago

rebased onto cf38f75

3 months ago

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci
https://fedora.softwarefactory-project.io/zuul/buildset/d3c1c4212be04860b21b54ea6a03c9a4

I'm a bit confused how meson is even supposed to find those dependencies ... Is it possible that dependency("syn", ...) in src/nouveau/compiler/meson.build is supposed to fall back to using the wrapfile for getting that dependency (and in turn, looking it up in the defined package cache), but that is disabled with --wrap-mode=nodownload in our meson flags - so it never even looks in %{cargo_registry} and just fails?

I'm also not sure whether it even could find that dependency in the %{cargo_registry} "cache", because the directory name is different (I suppose it will look for syn-2.0.39 as defined in subprojects/syn.wrap, but we have syn-2.0.48 currently. Those directory paths are not stable, so hard-coding them is going to be trouble.

Side note: Depending on syn with an open-ended '>= 2.0.15' is a bad idea (open-ended dependencies for Rust crates in general), because that also matches 3.0.0 which would be API-incompatible with the 2.x.y series. That should probably be syn with version >=2.0.15, <3.0.0.

rebased onto ae25160

3 months ago

Alright, I think I got it now, thanks for the hints!

Yup, looks like it found them now :100: Looks like this workaround should work unless there's two different versions of the same crate pulled in as dependencies (which is not the case now, but might be the case in the future, so maybe keep that in the back of your head if you see strange failures once more Rust dependencies are pulled in :)

Build succeeded.
https://fedora.softwarefactory-project.io/zuul/buildset/f2e8686a17b4492fb3129b98ee9c145e

Yup, looks like it found them now :100: Looks like this workaround should work unless there's two different versions of the same crate pulled in as dependencies (which is not the case now, but might be the case in the future, so maybe keep that in the back of your head if you see strange failures once more Rust dependencies are pulled in :)

It might be worth making a general macro for this in rust-packaging for doing these kinds of rewrites...

Got the ack from @karolherbst and Faith (upstream), so I'm landing this now.

Pull-Request has been merged by ngompa

3 months ago
Metadata