Skip to content

Conversation

@CrystalGamma
Copy link
Contributor

Motivation for this change

Allows Mesa to build on non-x86, non-ARM platforms like ppc64(le).
Part of my roadmap to bring NixOS to OpenPower platforms.

The new logic should be logically equivalent for x86 and ARM platforms (but might cause rebuilds due to reordered list elements).

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)
  • Fits CONTRIBUTING.md.

This allows Mesa to also build on ppc64le.
@GrahamcOfBorg GrahamcOfBorg added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. labels Aug 22, 2018
@dezgeg
Copy link
Contributor

dezgeg commented Aug 22, 2018

I don't see this very readable.

What you could do is just a separate case for x86 and then an else case which just adds the safest option (which is presumably only virgl).

@CrystalGamma
Copy link
Contributor Author

The point was that "generic" architectures (like Power) that have PCIe support but no integrated GPUs get all drivers for GPUs widely available as PCIe cards by default, while drivers for integrated GPUs are only built for their platforms (ARM ⇒ freedreno, etnaviv, x86 ⇒ Intel drivers), so when following your suggestion I would need to add a specific path for ppc64(le) for each variable …

@dezgeg
Copy link
Contributor

dezgeg commented Aug 22, 2018

Makes sense. Maybe have the else case then just list all the drivers for the PCI(-E) cards.

@edolstra
Copy link
Member

Note that adding support for a new platform is something that should go through the RFC process (since it may introduce a non-trivial maintenance burden for other contributors).

@CrystalGamma
Copy link
Contributor Author

New design that more clearly shows the reasoning.

@CrystalGamma
Copy link
Contributor Author

@edolstra Where can I access that process? FWIW, the initial platform enablement PR was marked as [RFC] …

@edolstra
Copy link
Member

@CrystalGamma
Copy link
Contributor Author

I see discussion on NixOS/rfcs#31 has largely concluded without major unaddressed objections …
Maybe we should just (squash &) merge this (even though the RFC hasn't been merged)?

@matthewbauer
Copy link
Member

I still think this is helpful - the old way basically just had static lists for each system. We should think more in capabilities - what driver works and doesn't work with each system.

@matthewbauer
Copy link
Member

@GrahamcOfBorg build mesa

@ofborg ofborg bot requested a review from vcunat May 2, 2019 21:54
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. and removed 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. labels May 2, 2019
@matthewbauer matthewbauer merged commit 9d3d5e9 into NixOS:staging May 9, 2019
@CrystalGamma CrystalGamma deleted the mesa_3 branch June 7, 2019 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants