NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.34k stars 13.58k forks source link

amdgpu: Vulkan doesn't work if amdvlk is installed #179918

Closed SuperSamus closed 2 years ago

SuperSamus commented 2 years ago

Describe the bug

Every Vulkan application (even from nixpkgs) simply doesn't work. For example:

wine (DXVK):

0114:err:vulkan:wine_vkCreateInstance Failed to load physical devices, res=5

dolphin-emu-beta:

VideoBackends/Vulkan/VulkanLoader.cpp:218 E[Video]: (EnumerateGPUs) vkEnumeratePhysicalDevices failed:  (5: VK_INCOMPLETE)
28:27:326 VideoBackends/Vulkan/VKMain.cpp:140 E[MASTER]: Warning: No Vulkan physical devices available.

Running vulkaninfo returns absolutely nothing: I have to manually CTRL+C to interrupt it. vkcube works for some reason...

Steps To Reproduce

Steps to reproduce the behavior:

  1. Have an AMD GPU (I guess) and be on nixos-unstable;
  2. Import this configuration;
  3. Run a Vulkan application (except vkcube). You can try vulkaninfo.
  4. It doesn't work!

Expected behavior

It should work.

Additional context

Latest build (that I tried) where I don't reproduce the problem is from June 24. The first (that I tried) where I do reproduce the problem is from June 27. I tried wiping /etc (because maybe there was some rogue configuration file doing something?) to no avail. My GPU is an integrated Vega 6 (from a Ryzen 4500U). Tested both RADV and AMDVLK (both don't work).

Metadata

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 5.18.5-zen1, NixOS, 22.11 (Raccoon), 22.11pre388641.020c74014b9`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.9.1`
 - channels(root): `"nixos"`
 - channels(<redacted>): `""`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
SuperSamus commented 2 years ago

I bisected the cause: 8184235b6ca23749cea9c30b744f755b340855d9. I have no idea why it does it with RADV, though it may be because I have both installed and using AMD_VULKAN_ICD=RADV. (I'll test with RADV only now)

SuperSamus commented 2 years ago

And without amdvlk, Vulkan works even after that commit. Seems to be caused by https://github.com/GPUOpen-Drivers/AMDVLK/issues/278.