flathub / org.yuzu_emu.yuzu

https://flathub.org/apps/details/org.yuzu_emu.yuzu
19 stars 43 forks source link

Zen 4 with integrated graphics breaks Vulkan initialisation #786

Open ajoneil opened 1 year ago

ajoneil commented 1 year ago

yuzu Version

1235

Description

The mesa version available within the currently used flatpak runtime does not recognise the integrated RDNA2 graphics on Zen 4 CPUs. This causes Vulkan initialisation to crash, rendering Vulkan unavailable even for a dedicated graphics card.

[andrew@harry ~]$ flatpak run org.yuzu_emu.yuzu
amdgpu: unknown (family_id, chip_external_rev): (149, 2)
/usr/include/c++/11.3.0/bits/stl_vector.h:1045: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](std::vector<_Tp, _Alloc>::size_type) [with _Tp = VkPhysicalDevice_T*; _Alloc = std::allocator<VkPhysicalDevice_T*>; std::vector<_Tp, _Alloc>::reference = VkPhysicalDevice_T*&; std::vector<_Tp, _Alloc>::size_type = long unsigned int]: Assertion '__n < this->size()' failed.

This error doesn't occur on the AppImage, where the integrated graphics is detected as "AMD Radeon Graphics (RADV GFX1036)". I've worked around this by disabling the integrated graphics in the BIOS.

System Information

System:
  Host: harry Kernel: 6.0.8-arch1-1 arch: x86_64 bits: 64 compiler: gcc
    v: 12.2.0 Desktop: GNOME v: 43.1 Distro: Arch Linux
Machine:
  Type: Desktop Mobo: ASRock model: B650E PG Riptide WiFi
    serial: <superuser required> UEFI: American Megatrends LLC. v: 1.11
    date: 10/21/2022
CPU:
  Info: 8-core model: AMD Ryzen 7 7700X bits: 64 type: MT MCP arch: Zen 4
    rev: 2 cache: L1: 512 KiB L2: 8 MiB L3: 32 MiB
  Speed (MHz): avg: 3224 high: 5516 min/max: 3000/5572 boost: enabled cores:
    1: 5516 2: 3000 3: 3000 4: 2749 5: 3000 6: 2762 7: 3000 8: 3250 9: 4790
    10: 3000 11: 3000 12: 3000 13: 2777 14: 2755 15: 3000 16: 3000
    bogomips: 143779
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
Graphics:
  Device-1: AMD Navi 21 [Radeon RX 6800/6800 XT / 6900 XT] vendor: Sapphire
    driver: amdgpu v: kernel arch: RDNA-2 bus-ID: 03:00.0
  Device-2: AMD Raphael driver: amdgpu v: kernel arch: RDNA-2
    bus-ID: 11:00.0 temp: 32.0 C
  Display: wayland server: X.org v: 1.21.1.4 with: Xwayland v: 22.1.5
    compositor: gnome-shell driver: X: loaded: modesetting dri: radeonsi
    gpu: amdgpu resolution: 3840x2160~60Hz
  API: OpenGL v: 4.6 Mesa 22.3.0-rc2 renderer: AMD Radeon RX 6800 XT
    (navi21 LLVM 14.0.6 DRM 3.48 6.0.8-arch1-1) direct render: Yes
Network:
  Device-1: MEDIATEK MT7921K Wi-Fi 6E 80MHz driver: mt7921e v: kernel
    bus-ID: 0c:00.0
  IF: wlp12s0 state: down mac: ea:cf:d9:39:b2:e6
  Device-2: Realtek Killer E3000 2.5GbE vendor: ASRock driver: r8169
    v: kernel port: c000 bus-ID: 0d:00.0
  IF: enp13s0 state: up speed: 1000 Mbps duplex: full mac: a8:a1:59:e2:a1:53
  IF-ID-1: br-46593809e4a1 state: up speed: 10000 Mbps duplex: unknown
    mac: 02:42:cb:2e:9c:ce
  IF-ID-2: br-7eacfcdbf711 state: down mac: 02:42:7c:e7:bf:60
  IF-ID-3: br-e68597fec47a state: up speed: 10000 Mbps duplex: unknown
    mac: 02:42:71:f3:1f:80
  IF-ID-4: docker0 state: down mac: 02:42:e1:fb:6c:13
  IF-ID-5: veth00323a1 state: up speed: 10000 Mbps duplex: full
    mac: 36:0f:b4:95:c4:40
  IF-ID-6: veth214ee78 state: up speed: 10000 Mbps duplex: full
    mac: b6:a8:5f:60:f0:61
  IF-ID-7: vethf744963 state: up speed: 10000 Mbps duplex: full
    mac: 12:49:4b:9e:de:f5
Drives:
  Local Storage: total: 4.1 TiB used: 3.27 TiB (79.7%)
Info:
  Processes: 501 Uptime: 17m Memory: 30.48 GiB used: 4.79 GiB (15.7%)
  Init: systemd Compilers: gcc: 12.2.0 clang: 14.0.6 Packages: 1468

Logs

[ 0.010749] Input input_common/drivers/udp_client.cpp:UDPClient:139: Udp Initialization started [ 0.010754] Input input_common/drivers/udp_client.cpp:StartCommunication:331: Starting communication with UDP input server on 127.0.0.1:26760 [ 0.054848] Frontend yuzu/main.cpp:GMainWindow:347: yuzu Version: yuzu 1235 [ 0.054849] Frontend yuzu/main.cpp:GMainWindow:363: Host CPU: AMD Ryzen 7 7700X 8-Core Processor | AVX512 | FMA [ 0.054870] Frontend yuzu/main.cpp:GMainWindow:365: Host CPU Cores: 8 [ 0.054871] Frontend yuzu/main.cpp:GMainWindow:368: Host CPU Threads: 16 [ 0.054880] Frontend yuzu/main.cpp:GMainWindow:369: Host OS: KDE Flatpak runtime [ 0.054884] Frontend yuzu/main.cpp:GMainWindow:370: Host RAM: 30.48 GiB [ 0.054885] Frontend yuzu/main.cpp:GMainWindow:372: Host Swap: 0.00 GiB

Remarks

No response

liushuyu commented 1 year ago

The mesa version available within the currently used flatpak runtime does not recognise the integrated RDNA2 graphics on Zen 4 CPUs.

Unfortunately, as the application distributor using the Flatpak platform, we have no control over which version of Mesa we could use inside the Flatpak system.

I have talked to Flatpak upstream about this issue in their IRC channels, and they told me to tell the user (you) to set the environment variable FLATPAK_GL_DRIVERS=mesa-git before running the application. Since I don't have a system with an AMD chip this modern, I can't test this. So I hope this helps.

Waddlen commented 1 year ago

While my Vulkan on Yuzu Flatpak is also broken, Vulkan on Ryujinx Flatpak works fine. It looks like they use a different function to fetch the GPU names, as my GPU shows up as "AMD Radeon RX 6800 (RADV NAVI21)" on Yuzu AppImage, but on Ryujinx Flatpak, it appears as "AMD RADV SIENNA_CICHLID (dGPU)" image

Perhaps Yuzu could try/catch and fallback to this dumber name if some device kills the Vulkan initialization?