Nixpkgs: Numerous games crashing on 19.09 exclusively

Created on 16 Dec 2019  路  5Comments  路  Source: NixOS/nixpkgs

Describe the bug
Some games that were formerly working without issue on 19.03 are crashing on 19.09 on startup. The games I've tested include a non-steam game via wine (same wine version as the working one on 19.03) and some steam games both with and without proton including the following

non-steam via wine:
-MTG arena -- crashlog here: https://hastebin.com/xehisacuni.log (l1 "Unhandled exception: divide by zero in 32-bit code")

steam:
-cuphead (proton/wine) -- stdout here: https://hastebin.com/odipabeyug.log
-ruiner (proton/wine) -- stdout here: https://hastebin.com/vefuhajixa.log
-total war: warhammer 2 (native, also crashes with proton though) -- stdout here: https://hastebin.com/xihebanemu.log (l81 "Game crashed with signal SIGFPE(8): Floating-point exception, check your CPU meets minimum requirements.")

To Reproduce
Steps to reproduce the behavior:
-For MTG arena: to install: https://forums.mtgarena.com/forums/threads/58489, `wine msiexec /i on the provided *.msi file. On 19.09 both installing and launching an installed (which can be done on 19.03) client fails.
-For the rest: It's all in steam. I'm sure there are more games than the ones listed above one could test. All proton and some native ones I've tested, that all were and are working fine on 19.03, crash on 19.09.

Expected behavior
The games should launch and run as expected.

Metadata

  • system: "x86_64-linux"
  • host os: Linux 4.19.89, NixOS, 19.09.1590.d85e435b7bd (Loris)
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.3
  • channels(boogie): ""
  • channels(root): "nixos-19.09.1590.d85e435b7bd, nixos-unstable-20.03pre200231.7827d3f4497, nixos1609-16.09.1943.25f4906da6, nixos1903-19.03.173651.ca6b6595392, nixos1909-19.09"
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute: steam? wine? any of their deps?
bug steam

Most helpful comment

same wine version as the working one on 19.03

So, if you go back to nixos 19.03, I mean like right now, does it work? Because if it does not, it could be a hardware bug or something else (besides wine) that changed in the 19.09 upgrade.

The first log show pretty clearly (thanks wine) that the crash happens in libvulkan_radeon.so, mesa.
I don't see any relevant error in the other logs, except in total war: warhammer 2, which confirms the same error caused by mesa.

If you can downgrade only mesa and confirm the crash goes away I'd say it's a bug in mesa and should be reported upstream. To do this try installing the 19.03 channel, if you don't have it already:

$ sudo nix-channel --add https://nixos.org/channels/nixos-19.03 nixos-19.03

then import this expression into your configuration.nix and rebuild

{ config, lib, pkgs, }:

with lib;

let

  oldPkgs = import <nixos-19.03> { };

  makePackage = p: pkgs.buildEnv {
    name = "mesa-drivers+txc-${p.mesa.version}";
    paths =
      [ p.mesa.drivers
        p.libtxc_dxtn_s2tc
      ];
  };

in

{
  hardware.opengl.package   = mkDefault (makePackage oldPkgs);
  hardware.opengl.package32 = mkDefault (makePackage oldPkgs.pkgsi686Linux);
}

I have never tried this so I'm not 100% sure this works.

All 5 comments

same wine version as the working one on 19.03

So, if you go back to nixos 19.03, I mean like right now, does it work? Because if it does not, it could be a hardware bug or something else (besides wine) that changed in the 19.09 upgrade.

The first log show pretty clearly (thanks wine) that the crash happens in libvulkan_radeon.so, mesa.
I don't see any relevant error in the other logs, except in total war: warhammer 2, which confirms the same error caused by mesa.

If you can downgrade only mesa and confirm the crash goes away I'd say it's a bug in mesa and should be reported upstream. To do this try installing the 19.03 channel, if you don't have it already:

$ sudo nix-channel --add https://nixos.org/channels/nixos-19.03 nixos-19.03

then import this expression into your configuration.nix and rebuild

{ config, lib, pkgs, }:

with lib;

let

  oldPkgs = import <nixos-19.03> { };

  makePackage = p: pkgs.buildEnv {
    name = "mesa-drivers+txc-${p.mesa.version}";
    paths =
      [ p.mesa.drivers
        p.libtxc_dxtn_s2tc
      ];
  };

in

{
  hardware.opengl.package   = mkDefault (makePackage oldPkgs);
  hardware.opengl.package32 = mkDefault (makePackage oldPkgs.pkgsi686Linux);
}

I have never tried this so I'm not 100% sure this works.

Yes, I'm keeping an older 19.03 generation alive for this purpose. There's also some hardware working on 19.03 which doesn't on 19.09. (https://github.com/NixOS/nixpkgs/issues/75774)

I've done what you suggested (except I learned that the mkDefault function had to be mkForce instead to override the option :) ). It worked! Every game I listed is running fine again on 19.09 with 19.03 channel mesa.

function had to be mkForce

Of course, my bad: I copied the code from the NixOS module and I forgot about priority.

It worked! Every game I listed is running fine again on 19.09 with 19.03 channel mesa.

Very nice! So this pinpoints the issue to mesa. You could also try a newer version from the nixos-unstable channel: maybe it has already been fixed.

I gave a quick look at the mesa issue tracker but I didn't find anything like this bug. I think you should report it in case it hasn't been fixed yet.

Getting mesa from the unstable channel instead of 19.03 indeed also works. So I'll assume it's fixed upstream. :)
Thanks again for your input here.

P.S.: If you could leave me a message about what exactly in the logs made you realize this is a mesa problem, I'd be very thankful! Hopefully I'll get better at identifying such an issue myself this way. :)
P.P.S.: I just realized there's no such functionality on github. Nevermind then. :p

If you could leave me a message about what exactly in the logs made you realize this is a mesa problem

Sure, the first lines in the wine traceback shows that the crash happened inside libvulkan_radeon.so:

0xf6d874c8 radv_builtin_cache_path.part+0x4f888() in libvulkan_radeon.so (0xf25042a0)

This is a shared object in mesa. I know that because I worked on the mesa package some time ago.

Also the prefix of the function name radv_ tells me it has something to do with radv, which is the Vulkan driver of AMD GPUs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

retrry picture retrry  路  3Comments

matthiasbeyer picture matthiasbeyer  路  3Comments

copumpkin picture copumpkin  路  3Comments

teto picture teto  路  3Comments

edolstra picture edolstra  路  3Comments