PCSX2 / pcsx2

PCSX2 - The Playstation 2 Emulator
https://pcsx2.net
GNU General Public License v3.0
11.58k stars 1.6k forks source link

[BUG]: PCSX2-Qt on Fedora 36 KDE Wayland; host display device context creation error #6363

Closed r2rX closed 2 years ago

r2rX commented 2 years ago

Describe the Bug

Hello there,

I recently installed PCSX2-Qt to give it a shot on Fedora 36 KDE, running Wayland. When attempting to run the BIOS or any game, there is a pop-up box with the following message: Failed to create host display file context. This occurs irrespective of which renderer I select (even if manually selecting either GPU adapter when using Vulkan) . More so, the non-Qt version of PCSX2 works fine with all renderers (as a side-note, the same error occurs with DuckStation).

For further information, my laptop has AMD integrated graphics, as well as a RX 6800M, of which both are running Mesa 22.2.0-git. Additionally, I've set a global environmental variable for the Plasma desktop (export KWIN_DRM_DEVICES=/dev/dri/card0:/dev/dri/card1) for the dedicated GPU to be the first in order (so all apps refer to the dGPU by default and I don't have to use DRI_PRIME as some apps don't allow you to select the adapter. The laptop is tethered to power and an external monitor at all times). Lastly, in KDE Plasma, the laptop monitor is disabled and the external is the sole monitor being used. KDE is Plasma v5.24.5 w/ Frameworks 5.94.0.

If there's any further information I can provide, please let me know. :) Cheers!

Here's the log from the terminal:

[    0.0179] PCSX2 Nightly - v1.7.2900 Compiled on Jun  6 2022
[    0.0179] Savestate version: 0x9a2d0000
[    0.0179] 
[    0.0179] Host Machine Init:
[    0.0179]    Operating System =  Linux
[    0.0179]    Physical RAM     =  31562 MB
[    0.0189]    CPU name         =  AMD Ryzen 9 5900HX with Radeon Graphics        
[    0.0189]    Vendor/Model     =  AuthenticAMD (stepping 00)
[    0.0189]    CPU speed        =  3.293 ghz (16 logical threads)
[    0.0189]    x86PType         =  Standard OEM
[    0.0189]    x86Flags         =  178bfbff 7ed8320b
[    0.0189]    x86EFlags        =  2fd3fbff
[    0.0189] 
[    0.0189] x86 Features Detected:
[    0.0189]    SSE2 SSE3 SSSE3 SSE4.1 SSE4.2 AVX AVX2 FMA SSE4a
[    0.0189] 
[    0.0190] Main Memory Manager              @ 0x0000000040000000 -> 0x0000000068000000 [640mb]
[    0.0190] Reserving memory for recompilers...
[    0.0191]    Micro VU0 Recompiler Cache       @ 0x000000005C000000 -> 0x0000000060000000 [64mb]
[    0.0192]    Micro VU1 Recompiler Cache       @ 0x0000000060000000 -> 0x0000000064000000 [64mb]
[    0.0193]    R5900-32 Recompiler Cache        @ 0x0000000050000000 -> 0x0000000054000000 [64mb]
[    0.0193]    R3000A Recompiler Cache          @ 0x0000000054000000 -> 0x0000000056000000 [32mb]
[    0.0193]    VIF0 Unpack Recompiler Cache     @ 0x0000000056000000 -> 0x0000000056800000 [8mb]
[    0.0194]    VIF1 Unpack Recompiler Cache     @ 0x0000000058000000 -> 0x0000000058800000 [8mb]
[    0.0194] Installing POSIX SIGSEGV handler...
[    0.0194] Mapping host memory for virtual systems...
[    0.0194]    EE Main Memory                   @ 0x0000000040000000 -> 0x0000000042884000 [40mb]
[    0.0194]    IOP Main Memory (2mb)            @ 0x0000000044000000 -> 0x0000000044211000 [2mb]
[    0.0194]    VU0/1 on-chip memory             @ 0x0000000048000000 -> 0x000000004800A000 [40kb]
[    0.1146] Scanning /home/xxxxx/Emulators/PCSX2/Games (recursively)
[    0.1147] Scanning '/home/xxxxx/Emulators/PCSX2/Games/PS2.iso'...
[    0.1148] isoFile open ok: /home/xxxxx/Emulators/PCSX2/Games/PS2.iso
[    0.1148]    Image type  = CD
[    0.1148]    blocks      = 900
[    0.1148]    offset      = 0
[    0.1148]    blocksize   = 2048
[    0.1148]    blockoffset = 24
[    0.1148]  * CDVD Disk Open: CD, 1 tracks (1 to 1):
[    0.1148]  * * Track 1: Data (Mode 1) (900 sectors)
[    0.1148] (IsoFS) Block 0x10: Primary partition info.
[    0.1148] (IsoFS) Block 0x11: Extended partition info.
[    0.1148] (IsoFS) Filesystem is Joliet
[    0.1574] (SDLInputSource) Controller 0 inserted
[    0.1610] (SDLInputSource) Opened controller 0 (instance id 0, player id 0): Xbox One S Controller
[    0.1610] (SDLInputSource) Rumble is supported on 'Xbox One S Controller' via gamecontroller
[    5.4234] Allocating memory map...
[    5.4235] Allocating host memory for virtual systems...
[    5.4235] Opening CDVD...
[    5.4237] isoFile open ok: /home/xxxxx/Emulators/PCSX2/Games/Ape Escape 2 (SCES-50885).iso
[    5.4237]    Image type  = DVD
[    5.4237]    blocks      = 884592
[    5.4237]    offset      = 0
[    5.4237]    blocksize   = 2048
[    5.4237]    blockoffset = 24
[    5.4237]  * CDVD Disk Open: DVD, Single layer or unknown:
[    5.4237]  * * Track 1: Data (Mode 1) (884592 sectors)
[    5.4237] (IsoFS) Block 0x10: Primary partition info.
[    5.4237] (IsoFS) Filesystem is ISO9660
[    5.4237] Opening GS...
[    5.4322] createDisplay(0, 1)
[    5.4435] Vsync is ON
[    5.4435] Failed to create any GL context
[    6.8411] Failed to acquire host display
[    6.8412] GS failed to open.
[    6.8413] Failed to open GS.

Reproduction Steps

  1. Compile/install PCSX2-Qt on Fedora 36 KDE (running Wayland)
  2. Select any renderer and try run a game or BIOS and the error should prompt.

Expected Behavior

It should successfully create the host display device context and run any game/BIOS.

PCSX2 Revision

v1.7.2900

Operating System

Linux (64bit) - Specify Distro Below

If Linux - Specify Distro

Fedora 36 KDE

stenzek commented 2 years ago

Did you enable Wayland in cmake?

r2rX commented 2 years ago

That's a good question. There were issues when I tried compiling it myself so I'm using a build from a recently created copr for PCSX2 Qt. I've asked the copr owner about it. Shall update this post when I get feedback.

On a side note; out of curiosity and my ignorance, is it possible to compile with both X11 and Wayland support?

stenzek commented 2 years ago

I checked both GL and Vulkan with GNOME, Plasma and Sway, all worked fine. We can close this as invalid and a packaging issue (i.e. not our problem).

On a side note; out of curiosity and my ignorance, is it possible to compile with both X11 and Wayland support?

Yes, if you compile with WAYLAND_API enabled it'll support both.

r2rX commented 2 years ago

You were on point, @stenzek . The Wayland API wasn't enabled. The most recent build on the copr has it enabled and it's working fine now. Thanks!