NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.42k stars 13.63k forks source link

Mangohud no longer appears when loading games #230978

Closed THERAAB closed 1 year ago

THERAAB commented 1 year ago

Describe the bug

Mangohud no longer appears on gnome/wayland when opening a game.

"rev": "d6b863fd9b7bb962e6f9fdf292419a775e772891", (works) "rev": "1a411f23ba299db155a5b45d5e145b85a7aafc42", (doesn't)

Steps To Reproduce

Steps to reproduce the behavior:

  1. Launch a game on gnome/wayland
  2. Mangohud doesn't appear even when enabled (worked in previous revision of nixpkgs above)
  3. ...

Expected behavior

Mangohud shows system stats

Notify maintainers

@kira-bruneau @r-ryantm

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

➜ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.3.1, NixOS, 23.05 (Stoat), 23.05.20230506.897876e`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.13.3`
 - nixpkgs: `/nix/store/zjpd6dn9kza8zl3l17cwgyifsxbvi3nb-source`
IceDBorn commented 1 year ago

I have the same problem too. I'm using Hyprland btw.

kira-bruneau commented 1 year ago

Oh weird. I'll try looking into this. The only thing that really sticks out to me in the diff is possibly #228870? - but it seems unlikely. I'll do a git bisect to try to narrow it down better.

THERAAB commented 1 year ago

If it helps you narrow down, here's my repo with the exact commit where mangohud stopped working. If I revert back to previous commit mangohud starts working again: https://github.com/THERAAB/nix-dotfiles/commit/0c4fb2b4fe61e7abcccfedc0ef79f647c5da1d85

Atemu commented 1 year ago

I bisected it, it's https://github.com/NixOS/nixpkgs/pull/228870.

cc @K900

K900 commented 1 year ago

mangohud uses its own internal copy of vulkan-headers: https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/tools/graphics/mangohud/default.nix#L64

So it's probably the loader? If it is though, it might be tricky to bisect...

Atemu commented 1 year ago

So, what are we going to do? Especially w.r.t. 23.05 being around the door. I don't think we should ship a broken mangohud in 23.05.

Honestly, I think https://github.com/NixOS/nixpkgs/pull/228870 should have probably not made it to master before branch-off. (Eventhough it was technically merged a few dasy before breaking changes were restricted.)

K900 commented 1 year ago

I'll try to reproduce locally and see if I can bisect vulkan-loader.

Atemu commented 1 year ago

cc @PedroHLC because of https://github.com/PedroHLC/nixpkgs/commits/vulkan-versioned

Atemu commented 1 year ago

We could also try updating the headers externally; Mangohud's are really quite old. They use this weird meson wrap thingy rather than letting the distro provide it and it too is very out of date.

Also, this is the error we're getting:

INFO | LAYER:     Requested layer "VK_LAYER_MANGOHUD_overlay" was wrong bit-type.

(This is on 64-bit-only Mangohud.)

K900 commented 1 year ago

It breaks when built with newer headers.

kira-bruneau commented 1 year ago

Oh sorry, forgot to get back to this! Maybe we need to switch back to using the system headers?

K900 commented 1 year ago

I'm actually pretty sure it's https://github.com/KhronosGroup/Vulkan-Loader/commit/c3eb97de22e9e2eec061be897dcf13f2c0759788 which we probably don't want to revert, but we may need to look into layer ordering?

kira-bruneau commented 1 year ago

oh no 😞 - yeah i think you're right, i think the duplicate behaviour was added specifically to support multi-arch layers (from what I remember).

Atemu commented 1 year ago

If it's just an issue of duplicate layers, perhaps we could add _32 and _64 suffixes to the layer names. obs-vkcapture does that too.

PedroHLC commented 1 year ago

cc @PedroHLC because of https://github.com/PedroHLC/nixpkgs/commits/vulkan-versioned

I gave up o pursuing this, as seen in https://github.com/NixOS/nixpkgs/pull/229897#issuecomment-1546698008

It works, but for this case here, it's probably better to bring attention upstream. Cc @flightlessmango

Atemu commented 1 year ago

Having only the 64-bit mangohud json in the implicit layer dir works!

Going to try giving the 32-bit layer a different name now.

kira-bruneau commented 1 year ago

This is also going to affect vkbasalt too then - I haven't tried yet though - I'll take a look at fixing that too!

K900 commented 1 year ago

cc @PedroHLC because of https://github.com/PedroHLC/nixpkgs/commits/vulkan-versioned

I gave up o pursuing this, as seen in #229897 (comment)

It works, but for this case here, it's probably better to bring attention upstream. Cc @flightlessmango

Speaking of, any reason you gave up on that? I personally really liked the good idea.

Atemu commented 1 year ago

Different suffixes work! PR incoming.

PedroHLC commented 1 year ago

Speaking of, any reason you gave up on that? I personally really liked the good idea.

It needed a proper rebase+bump to v1.3.250, and I couldn't figure out how to really take a good benefit from it.

K900 commented 1 year ago

Hm, I'll definitely try to pick it up after branch-off then.

PedroHLC commented 1 year ago

Peculiarly, obs-vkcapture seem to do this for some time already:

VK_LAYER_OBS_vkcapture_32 (OBS Linux game capture) Vulkan version 1.3.249, layer version 1:
VK_LAYER_OBS_vkcapture_64 (OBS Linux game capture) Vulkan version 1.3.249, layer version 1:

@Scrumplex VK_LAYER_MANGOAPP_overlay from gamescope might need this fix too.