Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mesa: build with meson #56199

Merged
merged 2 commits into from Jun 26, 2019
Merged

mesa: build with meson #56199

merged 2 commits into from Jun 26, 2019

Conversation

eadwu
Copy link
Member

@eadwu eadwu commented Feb 22, 2019

Motivation for this change

Wanted to try iris.

Builds fine on top of 5f2252c with #56261 and b9392ac for iris, and 4d5295e and 6f9a7f0.

radeon doesn't seem to exist anymore.

.la files don't seem to be present anymore.
$out/lib/pkgconfig exists during postInstall but is only moved to $dev/lib/pkgconfig in fixupPhase.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

[1] https://gitlab.freedesktop.org/mesa/mesa/blob/master/meson.build#L208

@jtojnar jtojnar self-requested a review February 22, 2019 16:57
@eadwu eadwu force-pushed the mesa/build-with-meson branch 5 times, most recently from 952a86a to adcb5c1 Compare February 22, 2019 21:39
@eadwu
Copy link
Member Author

eadwu commented Feb 22, 2019

This should be fine now, --enable-glx-tls doesn't seem to present on the builds I've seen while --enable-texture-float is only if we want to be backwards compatible [1].

[1] https://gitlab.freedesktop.org/mesa/mesa/commit/66673bef941af344314fe9c91cad8cd330b245eb

@eadwu eadwu marked this pull request as ready for review February 22, 2019 21:45
@eadwu
Copy link
Member Author

eadwu commented Feb 22, 2019

disk_cache-include-dri-driver-path-in-cache-key.patch seems pretty important, so I tried adding it back in? Not very familiar with meson as well but it seems to compile at least.

@eadwu
Copy link
Member Author

eadwu commented Feb 23, 2019

Is there a reason why mesa_noglu.stubs is within the derivation? It causes overrideAttrs to fail since self always references the old derivation. Doing grep -nr '\.stubs show that mesa_noglu.stubs is only used in the declaration of libGL in all-packages.nix.

self: super:

{
  mesa_noglu = (super.mesa_noglu.override {
    galliumDrivers = [ "virgl" "svga" "i915" "iris" "r300" "r600" "radeonsi" "nouveau" ];
  }).overrideAttrs (oldAttrs: {
    inherit (oldAttrs) pname;
    version = "19.1.0-devel";

    src = builtins.fetchGit {
      url = "https://gitlab.freedesktop.org/mesa/mesa.git";
      rev = "2bd08b8b9de9b10ecad5b808f56af2aa1bb8e007";
    };
  });
}

Done at #56261.

@eadwu eadwu force-pushed the mesa/build-with-meson branch 2 times, most recently from 2f12f78 to 55c0e7e Compare February 24, 2019 01:51
@eadwu
Copy link
Member Author

eadwu commented Feb 24, 2019

$dev/lib/pkgconfig/*.pc should be correct now. Though it affects libGL, so time to rebuild ~400 packages to test again.

Screwed up again, need to include /lib/dri back to the *.pc.

@@ -36,16 +35,16 @@ let
then ["virgl" "nouveau" "freedreno" "vc4" "etnaviv" "imx"]
else if stdenv.isAarch64
then ["virgl" "nouveau" "vc4" ]
else ["virgl" "svga" "i915" "r300" "r600" "radeonsi" "nouveau"]);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't really know what to prefer here, read somewhere that the gallium driver is "unofficial" so went with the dri driver.

@eadwu eadwu mentioned this pull request Feb 24, 2019
10 tasks
@eadwu
Copy link
Member Author

eadwu commented Apr 16, 2019

On the few weekends I spent recompiling my system, it more or less works fine, though I've ended up reverting due to abnormal CPU usage with compton using iris (don't know if it's been fixed since then).

@MP2E
Copy link

MP2E commented May 11, 2019

Building this on my machine currently, we'll want to merge this into staging soon IMO because it seems that Mesa 19.1 will be the first release to remove the old build system, and require Meson.

@ikervagyok
Copy link
Contributor

Only 2 weeks left until the Mesa 19.1 release[1]. Any plans to merge into master/staging?

[1] https://www.mesa3d.org/release-calendar.html

@pstn
Copy link
Contributor

pstn commented May 26, 2019

Mesa 18 is very buggy with some vega cards and leads to GPU crashes while vulkan is enabled. I've got a temporary fix for myself (disable vulkan at build time), but I'd very much like this to be merged for everybody since upgrading mesa is the way better solution.

@colemickens
Copy link
Member

Needs rebase.

@eadwu eadwu force-pushed the mesa/build-with-meson branch 2 times, most recently from 1384351 to 150d7f8 Compare June 7, 2019 23:51
@pstn
Copy link
Contributor

pstn commented Jun 11, 2019

@pstn
Copy link
Contributor

pstn commented Jun 11, 2019

Wow, thanks for the quick update! I did an equivalent local patch myself and can confirm that this seems to run just fine with my vega setup for both vulkan and opengl.

@dtzWill
Copy link
Member

dtzWill commented Jun 12, 2019 via email

@colemickens
Copy link
Member

I've been rebasing this myself, but I've been using both Sway and GNOME with Mesa 19.1 and the updated libdrm without issue. I've even been using a tip build of Sway with Iris successfully.

It feels like time to get this and #56261 and #57773 into staging.

@joakim1999
Copy link
Contributor

joakim1999 commented Jun 16, 2019

Is it possible to upgrade LLVM to version 8? I know that some LLVM 7.x.x versions has caused issues for DXVK (wine D3D to vulkan layer) and I've seen mesa 19 being paired well with LLVM 8. There is already an LLVM override for this package so one can simply change a single line in the all-packages.nix I think.

@eadwu eadwu force-pushed the mesa/build-with-meson branch 2 times, most recently from 0f01818 to f6848b9 Compare June 25, 2019 13:27
@grahamc
Copy link
Member

grahamc commented Jun 26, 2019

@GrahamcOfBorg eval

@grahamc
Copy link
Member

grahamc commented Jun 26, 2019

I hope it is okay, I rebased on staging.

@grahamc grahamc added this to the @grahamcof milestone Jun 26, 2019
@grahamc
Copy link
Member

grahamc commented Jun 26, 2019

@GrahamcOfBorg build mesa

@grahamc grahamc merged commit 86311cd into NixOS:staging Jun 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet