RPCS3 / rpcs3

PS3 emulator/debugger
https://rpcs3.net/
GNU General Public License v2.0
14.65k stars 1.86k forks source link

Wayland Segfault while using discrete NVIDIA GPU #15476

Open tcharchar opened 2 months ago

tcharchar commented 2 months ago

Quick summary

RPCS3 instantly crashes with a segfault on wayland while using a discrete gpu.

Details

If QT_QPA_PLATFORM is set on wayland or wayland-egl and any other GPU but the one currently used by wayland is used, RPCS3 instantly crashes and closes with a segfault error.

Attach a log file

RPCS3.log

Attach capture files for visual issues

No response

System configuration

OS: Arch Linux x86_64 Kernel: 6.8.6-zen1-1-zen DE: Hyprland CPU: 13th Gen Intel i7-13700H (20) @ 4.800GHz GPU: NVIDIA GeForce RTX 4070 Max-Q / Mobile GPU: Intel Raptor Lake-P [Iris Xe Graphics] Memory: 15713MiB NVIDIA Driver: 535.113.01-1, but issue happens on most drivers I've tested from 530.x.x.x and up

Other details

Changing QT_QPA_PLATFORM to xcb fixes this issue, however it may be unfavourable to run RPCS3 under x11 due to issues with Xwayland and NVIDIA GPUs as seen here.

NOTE: Despite said post saying this issue has been solved under 545.x.x.x, it has not been fixed at all.

tcharchar commented 2 months ago

From further testing, I can confirm this is a QT issue. PCSX2 Nightly (aka pcsx2-qt) also suffers from this, and crashes instantly. However, PCSX2 can actually boot and run dumps while using OpenGL, while RPCS3 hangs with the following:

QWaylandGLContext::makeCurrent: eglError: 0x300d, this: 0x7228b40083e0 
RPCS3: RSX [0x0000000]: SIG: Thread terminated due to fatal error: Could not bind OpenGL context
(in file /usr/src/debug/rpcs3-git/rpcs3/rpcs3/rpcs3qt/gl_gs_frame.cpp:91[:4], in function set_current) (errno=62=Timer expired)

I should also add, using the --no-gui variable still crashes it, because I believe the game window is still being created with the help of QT.