NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.45k stars 13.65k forks source link

Mesa: Device select Vulkan layer appears to be missing #165616

Closed Ashe closed 2 years ago

Ashe commented 2 years ago

Describe the bug

Someone analysed my steam system info when I was asking for help with issues with Elden Ring in https://github.com/ValveSoftware/Proton/issues/5613#issuecomment-1076358061. I don't know much about what this means, but I thought I'd raise it as it seems important:

Hello, looking at your current system information, Mesa's device select vulkan layer appears to be missing. While DXVK and VKD3D-Proton may deal with that, you may unexpectedly end up using lavapipe (Mesa's CPU based Vulkan render pipeline) instead of your GPU. This is something to ask your distro's package maintainer for Mesa about.

Notify maintainers

@primeos @vcunat

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 5.16.15, NixOS, 22.05 (Quokka)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.4pre20211001_4f49615`
 - channels(root): `"home-manager, nixos-21.11pre321644.5e2018f7b38"`
 - channels(ashe): `""`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

Steam System Info

Gist can be found here (it's too big to directly paste here).

primeos commented 2 years ago

Have you read https://nixos.org/manual/nixos/unstable/index.html#sec-gpu-accel-vulkan and does vulkaninfo work? Vulkan works on NixOS but I've never tested it with Steam games (/ Proton).

Ashe commented 2 years ago

So for convenience here's my configuration.nix file so you can see what I had: https://github.com/Ashe/dotfiles/blob/c06cdaaebec0666c0cfc74c6d94dda61616f27d0/system/configuration.nix

As for vulkaninfo I get this error:

~
❯ nix-shell -p vulkan-tools.out --run vulkaninfo
ERROR: [Loader Message] Code 0 : /nix/store/s88zdqxzw3x3ppxrz1n8b2qpaniz36v4-mesa-21.3.7-drivers/lib/libvulkan_intel.so: undefined symbol: wl_proxy_marshal_flags
ERROR: [Loader Message] Code 0 : /nix/store/s88zdqxzw3x3ppxrz1n8b2qpaniz36v4-mesa-21.3.7-drivers/lib/libvulkan_radeon.so: undefined symbol: wl_proxy_marshal_flags
ERROR: [Loader Message] Code 0 : /nix/store/s88zdqxzw3x3ppxrz1n8b2qpaniz36v4-mesa-21.3.7-drivers/lib/libvulkan_lvp.so: undefined symbol: wl_proxy_marshal_flags
Cannot create Vulkan instance.
This problem is often caused by a faulty installation of the Vulkan driver or attempting to use a GPU that does not support Vulkan.
ERROR at /build/source/vulkaninfo/vulkaninfo.h:687:vkCreateInstance failed with ERROR_INCOMPATIBLE_DRIVER

Prior to the comment I linked, it was pointed out that I was using amdvlk and not radv and so I switched. I read the manual and saw that

Adding the amdvlk package to hardware.opengl.extraPackages makes amdvlk the default driver and hides radv and lavapipe from the device list

and so I figured removing amdvlk from my configuration would tell my system to use radv instead, but it seems that that also means that I'm opening myself up to using lavapipe as well, have I done something wrong?

primeos commented 2 years ago

undefined symbol: wl_proxy_marshal_flags might be caused by impurities, IIRC. vulkaninfo from nix-shell -p vulkan-tools.out --run vulkaninfo might not be compatible with Mesa from /nix/store/s88zdqxzw3x3ppxrz1n8b2qpaniz36v4-mesa-21.3.7-drivers. Is it possible that your user Nixpkgs channel is outdated?

I noticed such issues when I performed a Wayland update: https://github.com/NixOS/nixpkgs/pull/148588

vcunat commented 2 years ago

nixos-21.11pre321644.5e2018f7b38

That's commit from October 2021. On that commit there's mesa-21.2.3.

Ashe commented 2 years ago

I installed vulkan-tools via my configuration and not nix-shell -p and it does seem to work - here's the output: https://termbin.com/bsio

Not really sure why nix-shell -p is so different.

vcunat commented 2 years ago

As mentioned, if you happen to mix versions too far away between /run/opengl-driver (i.e. commit from the OS) and the running package using the driver, you may get into similar trouble.

Ashe commented 2 years ago

nixos-21.11pre321644.5e2018f7b38

That's commit from October 2021. On that commit there's mesa-21.2.3.

Wait.. are we saying I'm not using the latest version of NixOS? I'm on unstable I swear, I should be up to date right?

EDIT: A lot of my machine says 22.05? I'm not sure what nixos-21.11 is relating to?

primeos commented 2 years ago

I'm not really familiar with vulkaninfo output but https://termbin.com/bsio LGTM:

VkPhysicalDeviceDriverProperties:
---------------------------------
    driverID           = DRIVER_ID_MESA_RADV
    driverName         = radv
    driverInfo         = Mesa 21.3.7
    conformanceVersion = 1.2.3.0

Anyway, this isn't a Mesa packaging issue as Vulkan is working (at least I'm not aware of any issues). I have no idea if it works with Steam games as I'm neither packaging nor using Steam (currently).

Not really sure why nix-shell -p is so different.

Your user channel is likely outdated (nix-channel --list, nix-channel --update, etc.).

Anyway, that's about all I can help with. PS (for next time): This might be something to post on Discourse first (or via chat): https://nixos.org/community/index.html

Ashe commented 2 years ago

I apologise if this was a waste of time - I thought that maybe there was something important to relay when people identified some stuff with my steam information. Thanks for checking this out for me, I do appreciate it!

primeos commented 2 years ago

It's fine, at least it's documented/searchable via GitHub's issue tracker now :) We just often lack time to help with such setup specific issues while Discourse was created for community support (etc.), AFAIK. And the /run/opengl-driver/ impurities do unfortunately result in many similar issues (https://github.com/NixOS/nixpkgs/issues/95808 often comes up).