PCSX2 / pcsx2

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

[BUG]: Vulkan renderer crashes when bilinear filtering is set to sharp #11716

Closed amenoko closed 2 weeks ago

amenoko commented 3 weeks ago

Describe the Bug

Selecting Vulkan as renderer while setting "Bilinear Filtering" to "Bilinear (Sharp)" results in a crash before any graphics appear (other than the PCSX2 OSD, like FPS and frametime graph). Vulkan works correctly when filtering is set to "Bilinear (Smooth)" or "None". OpenGL works correctly when filtering is set to any.

Reproduction Steps

On a fresh instance of PCSX2, pick Vulkan and set bilinear filtering to sharp. Boot bios or game. OSD elements appear but freeze after a moment and about five seconds later the application window closes. This happens for me on both AppImage and Flatpak, both nightly and stable.

Expected Behavior

Application does not crash; alternatively, if this is something the driver just can't support, inform the user?

PCSX2 Revision

v2.1.93 (Fri Aug 16)

Operating System

Linux (64bit) - Specify distro below

If Linux - Specify Distro

Arch

CPU

i7-1355U

GPU

Integrated, Iris XE (using modules xe and i915)

GS Settings

Default except renderer set to Vulkan, bilinear filtering set to sharp

Emulation Settings

Default

GS Window Screenshots

No response

Logs & Dumps

I'm not sure why but emulog.txt is empty.

Console:

Forcing X11 instead of Wayland, due to various protocol limitations
and Qt issues. If you want to use Wayland, launch PCSX2 with
I_WANT_A_BROKEN_WAYLAND_UI=YES set.
  OpenType support missing for "Droid Sans", script 11
*************** Unhandled SIGSEGV at 0x72b13d0ebe6c ***************
  0x006187c1c291c9 LogCallstack [/home/runner/work/pcsx2/pcsx2/common/CrashHandler.cpp:284]
  0x006187c1c290b3 CrashSignalHandler [/home/runner/work/pcsx2/pcsx2/common/CrashHandler.cpp:315]
  0x006187c1c474d3 SignalHandler [/home/runner/work/pcsx2/pcsx2/common/Linux/LnxHostSys.cpp:341]
  0x0072b287a4c1cf
  0x0072b13d0ebe6c
  0x0072b13cf7ed4d
  0x0072b13d0ee9dd
  0x006187c16a6c99 TransitionSubresourcesToLayout [/home/runner/work/pcsx2/pcsx2/pcsx2/GS/Renderers/Vulkan/GSTextureVK.cpp:743]
  0x006187c169a0e2 TransitionToLayout [/home/runner/work/pcsx2/pcsx2/pcsx2/GS/Renderers/Vulkan/GSTextureVK.cpp:557]
  0x006187c169a0e2 TransitionToLayout [/home/runner/work/pcsx2/pcsx2/pcsx2/GS/Renderers/Vulkan/GSTextureVK.cpp:549]
  0x006187c169a0e2 DoStretchRect [/home/runner/work/pcsx2/pcsx2/pcsx2/GS/Renderers/Vulkan/GSDeviceVK.cpp:3043]
  0x006187c169a559 PresentRect [/home/runner/work/pcsx2/pcsx2/pcsx2/GS/Renderers/Vulkan/GSDeviceVK.cpp:2874]
  0x006187c1623f7c VSync [/home/runner/work/pcsx2/pcsx2/pcsx2/GS/Renderers/Common/GSRenderer.cpp:645]
  0x006187c162d910 VSync [/home/runner/work/pcsx2/pcsx2/pcsx2/GS/Renderers/HW/GSRendererHW.cpp:143]
  0x006187c1460e04 GSvsync [/home/runner/work/pcsx2/pcsx2/pcsx2/GS/GS.cpp:435]
  0x006187c1460e04 MainLoop [/home/runner/work/pcsx2/pcsx2/pcsx2/MTGS.cpp:498]
  0x006187c1460e04 ThreadEntryPoint [/home/runner/work/pcsx2/pcsx2/pcsx2/MTGS.cpp:183]
  0x006187c1c47984 operator() [/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/std_function.h:591]
  0x006187c1c47984 ThreadProc [/home/runner/work/pcsx2/pcsx2/common/Linux/LnxThreads.cpp:229]
  0x0072b287aa339c
  0x0072b287b2849b
  0xffffffffffffffff
*******************************************************************
Aborting application.
Aborted (core dumped)

I'm not sure but I think crashdumps are automatic? If so, there aren't any.

sebastian926 commented 3 weeks ago

In my case it doesnt crash but the games runs overall slower than before, and interlacing patches in Gran Turismo 4 dont seem to work.

kamfretoz commented 3 weeks ago

Can't repro, I'm on Arch Linux with AMD Radeon RX 6600 XT.

image

amenoko commented 3 weeks ago

May I ask why this was closed?

JordanTheToaster commented 3 weeks ago

May I ask why this was closed?

3 people have been unable to reproduce this including myself.

lightningterror commented 3 weeks ago

This should be verified if it's an intel issue only, @amenoko what mesa version, also is it a regression or was it always an issue?

sebastian926 commented 3 weeks ago

Did you guys already tried without GPU?

amenoko commented 3 weeks ago

This should be verified if it's an intel issue only, @amenoko what mesa version, also is it a regression or was it always an issue?

My mesa package is 1:24.1.6-1. I haven't had this laptop for very long, but I did also test stable and encountered the same thing there. I can check out other, older versions as well if that helps.

I somewhat prefer the sharp filtering look but other than that this issue is arguably very minor. Mostly it's confusing because I thought vulkan didn't run at all (despite working in other apps) but it seems to just be the one setting.

F0bes commented 3 weeks ago

I can reproduce on Linux with my Intel UHD 630. Note that it seems to depend on internal resolution. The crash is occurring in the libvulkan_intel driver. I'll try to see if I can get some more symbols. Disclaimer: I'm not a GPU dev and don't really know what I'm getting myself into.

F0bes commented 3 weeks ago

For future reference, here is a full backtrace with symbols. All of the related code looks alien to me. Hopefully someone else can pick it up.

#0  0x00007ffff5aa53f4 in ?? () from /usr/lib/libc.so.6
#1  0x00007ffff5a4c120 in raise () from /usr/lib/libc.so.6
#2  0x00007ffff5a334c3 in abort () from /usr/lib/libc.so.6
#3  0x0000555556a6545c in CrashHandler::CrashSignalHandler (signal=11, siginfo=0x7ffe94bfd470, ctx=0x7ffe94bfd340) at /home/ty/pcsx2/common/CrashHandler.cpp:325
#4  0x0000555556a9f80a in PageFaultHandler::SignalHandler (sig=11, info=0x7ffe94bfd470, ctx=0x7ffe94bfd340) at /home/ty/pcsx2/common/Linux/LnxHostSys.cpp:341
#5  <signal handler called>
#6  vk_command_buffer_get_attachment_layout () at ../mesa-24.1.6/src/vulkan/runtime/vk_render_pass.c:1409
#7  0x00007ffe600df2fb in cmd_buffer_barrier () at ../mesa-24.1.6/src/intel/vulkan/genX_cmd_buffer.c:4058
#8  0x00007ffe602ee9de in vk_common_CmdPipelineBarrier () at ../mesa-24.1.6/src/vulkan/runtime/vk_synchronization.c:191
#9  0x000055555650d57d in GSTextureVK::TransitionSubresourcesToLayout (this=0x7ffe6c62dd10, command_buffer=0x7ffe6c318420, start_level=0, num_levels=1, old_layout=GSTextureVK::Layout::ColorAttachment, 
    new_layout=GSTextureVK::Layout::ShaderReadOnly) at /home/ty/pcsx2/pcsx2/GS/Renderers/Vulkan/GSTextureVK.cpp:743
#10 0x000055555650d0f6 in GSTextureVK::TransitionToLayout (this=0x7ffe6c62dd10, command_buffer=0x7ffe6c318420, new_layout=GSTextureVK::Layout::ShaderReadOnly) at /home/ty/pcsx2/pcsx2/GS/Renderers/Vulkan/GSTextureVK.cpp:557
#11 0x000055555650f2ce in GSTextureVK::TransitionToLayout (this=0x7ffe6c62dd10, layout=GSTextureVK::Layout::ShaderReadOnly) at /home/ty/pcsx2/pcsx2/GS/Renderers/Vulkan/GSTextureVK.cpp:549
#12 0x00005555564e62d6 in GSDeviceVK::DoStretchRect (this=0x7ffe6c0092a0, sTex=0x7ffe6c62dd10, sRect=..., dTex=0x0, dRect=..., pipeline=0x7ffe6c3600e0, linear=true, allow_discard=true)
    at /home/ty/pcsx2/pcsx2/GS/Renderers/Vulkan/GSDeviceVK.cpp:3043
DRIVER | LAYER:       <Device>
DRIVER | LAYER:           Using "Intel(R) UHD Graphics 630 (CFL GT2)" with driver: "/usr/lib/libvulkan_intel.so"
VUID-vkCmdPipelineBarrier-None-07889(ERROR / SPEC): msgNum: -616663606 - Validation Error: [ VUID-vkCmdPipelineBarrier-None-07889 ] Object 0: handle = 0x282e0e00000001ae, type = VK_OBJECT_TYPE_RENDER_PASS; | MessageID = 0xdb3e75ca | vkCmdPipelineBarrier():  Barriers cannot be set during subpass 0 of VkRenderPass 0x282e0e00000001ae[] with no self-dependency specified. The Vulkan spec states: If vkCmdPipelineBarrier is called within a render pass instance using a VkRenderPass object, the render pass must have been created with at least one subpass dependency that expresses a dependency from the current subpass to itself, does not include VK_DEPENDENCY_BY_REGION_BIT if this command does not, does not include VK_DEPENDENCY_VIEW_LOCAL_BIT if this command does not, and has synchronization scopes and access scopes that are all supersets of the scopes defined in this command (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-vkCmdPipelineBarrier-None-07889)
    Objects: 1
        [0] 0x282e0e00000001ae, type: 18, name: NULL
F0bes commented 2 weeks ago

@amenoko Can you test PR #11741 and see if it fixes the issue?

amenoko commented 2 weeks ago

@amenoko Can you test PR #11741 and see if it fixes the issue?

If I understand correctly that means I have to compile it myself which I haven't done before (not this particular program I mean). I'll try, might take a while though.

F0bes commented 2 weeks ago

There are builds provided for that PR here: https://github.com/PCSX2/pcsx2/actions/runs/10517518116

Each PR has artifacts built for them, on the PR screen click on "Checks".

amenoko commented 2 weeks ago

Uh. I missed that last message and ended up compiling it anyway.

PR seems to solve the issue for me, yep! With a fresh config folder and everything left default, I can boot into a game and change bilinear filtering to sharp while using Vulkan renderer now.