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

WIP: mesa bleeding edge #20454

Closed
wants to merge 5 commits into from
Closed

Conversation

corngood
Copy link
Contributor

@corngood corngood commented Nov 16, 2016

Motivation for this change

@Ralith @vcunat

This brings in development versions of llvm and mesa, which provides the open source amdgpu vulkan driver, OpenGL 4.5 core context, etc.

  • The amount of duplicate code in /llvm/*/ seems excessive. if I was going to package a new release (e.g. 4.0) I think I'd start by abstracting what I have in svn/).

  • I'm not quite sure about the way I exposed multiple versions of mesa. It's more like openssl than llvm.

My packageOverrides currently looks like this:

    packageOverrides = pkgs:
      with pkgs.stdenv.lib; {
      stdenv = pkgs.stdenv // {
        platform = pkgs.stdenv.platform // optionalAttrs (!amdgpu-pro) {
          kernelExtraConfig = "DRM_AMDGPU_CIK y";
        };
      };
      steam = pkgs.steam.override {
        newStdcpp = true;
      };
      mesa_drivers = (pkgs.mesa_13_1_0-git.override {
        enableTextureFloats = true;
      }).drivers;
    };
  • enable experimental support for certain GPUs (could this be a nixos option?)
  • enable the new libc in steam for compatibility with mesa drivers (should this be the default, or enabled when the driver is enabled?)
  • select mesa 13.1 driver only, to avoid rebuilding mesa dependencies, which is almost everything.
  • enable patent protected floating point textures
    • this probably deserves it's own nixos option and a mention in the manual. without it, you can only get an opengl 2.1 context.

Interesting glxinfo to prove it's working:

OpenGL renderer string: Gallium 0.4 on AMD HAWAII (DRM 3.3.0 / 4.8.7, LLVM 4.0.0)
OpenGL core profile version string: 4.5 (Core Profile) Mesa 13.1.0-devel

Any thoughts?

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • 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/)
  • Fits CONTRIBUTING.md.

@mention-bot
Copy link

@corngood, thanks for your PR! By analyzing the history of the files in this pull request, we identified @vcunat, @shlevy and @wkennington to be potential reviewers.

@corngood corngood changed the title WIP: amdgpu bleeding edge WIP: mesa bleeding edge Nov 16, 2016
@corngood corngood force-pushed the amdgpu-bleeding-edge branch 2 times, most recently from d9b687f to 87863d8 Compare December 20, 2016 15:14
@corngood corngood changed the title WIP: mesa bleeding edge mesa bleeding edge Dec 20, 2016
@corngood
Copy link
Contributor Author

Removing WIP. Any thoughts on this @vcunat?

@vcunat
Copy link
Member

vcunat commented Dec 23, 2016

I don't know if I can get to this properly within several days. Quick thoughts:

  • I do dislike the amount of copying in llvmPackages. I hope we could eradicate that at least for newly-added major versions.
  • We typically don't add multiple versions of packages. I'm personally not opposed to this case (llvm+mesa), as a way of preparing for the next major release, even if (almost) noone would use the testing packages.

@corngood
Copy link
Contributor Author

Tracking bleeding edge llvm + mesa is important these days for good GPU support/performance. It's the only way I can get a Vulkan driver and OpenGL 4.5 core context for my GPU, for example.

I do think it's probably a bad idea to be putting svn/git refs in nixpkgs, so how about if I just do the abstractions necessary to make this achievable via user config?

Having non-default bleeding edge configs in nixpkgs is probably worth doing in the future, but only for upstream releases, not just random commits.

I'll mark this WIP again, and do those changes next time I update.

@corngood corngood changed the title mesa bleeding edge WIP: mesa bleeding edge Dec 23, 2016
@vcunat vcunat mentioned this pull request Feb 10, 2017
@vcunat
Copy link
Member

vcunat commented Feb 26, 2017

llvmPackages_40 (RC2) are in master now, and next mesa (17.0.0) is on it's way too #22854. Do you know of some (strong) motivation to switch mesa to the new LLVM? I'm mainly thinking of nixos 17.03 release, as it's to be cut within days and be stabilizing during March, and expected to last for about half a year.

@vcunat vcunat closed this Feb 26, 2017
@vcunat vcunat reopened this Feb 26, 2017
@corngood
Copy link
Contributor Author

corngood commented Mar 4, 2017

@vcunat I wouldn't worry about it too much for 17.03. I'd like it to be as easy as possible for people to run with bleeding edge mesa/llvm (for AAA games, etc), but that shouldn't impact the stable release.

It looks like there are tons of changes going in recently for amdgpu on llvm (https://github.com/llvm-mirror/llvm/commits/master/lib/Target/AMDGPU). Any one of them could make a big performance difference for a recently released game, or enable support of a new device (e.g. Vega).

I still think it's best to just better abstract llvm so that it can easily build from svn with user config, but I haven't had any time to work on it.

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

4 participants