hrydgard / ppsspp

A PSP emulator for Android, Windows, Mac and Linux, written in C++. Want to contribute? Join us on Discord at https://discord.gg/5NJB6dD or just send pull requests / issues. For discussion use the forums at forums.ppsspp.org.
https://www.ppsspp.org
Other
11.37k stars 2.19k forks source link

JIT/Dynarec crash upon loading a game on RISC-V #19278

Open archanox opened 4 months ago

archanox commented 4 months ago

Game or games this happens in

ULUS-10093 WRC

What area of the game / PPSSPP

When loading the game with Dynarec enabled. Even with all JIT functionality disabled.

Original issue #19266

What should happen

The game should load with the JIT backend.

Logs

55:23:389 Core/System.cpp:428 N[BOOT]: PPSSPP v1.17-884-gcfcca0ed13
55:23:756 root         N[G3D]: GLES/ShaderManagerGLES.cpp:1153 Precompile: Compiled and linked 30 programs (11 vertex, 20 fragment) in 1.4 milliseconds
55:23:756 root         N[G3D]: GLES/GPU_GLES.cpp:108 Precompiling the shader cache from '/home/debian/.config/ppsspp/PSP/SYSTEM/CACHE/ULUS10093.glshadercache'
55:23:756 root         N[BOOT]: UI/EmuScreen.cpp:384 Booted /media/debian/Storage/Isos/World_Rally_Championship_USA_PSP-pSyPSP.iso...
55:23:762 user_main    E[SYSTEM]: Common/Log.cpp:73 (/media/debian/Storage/ppsspp/Core/MIPS/IR/IRRegCache.cpp:operator():806): [false] (ULUS10093 WRC, 0.4s) Unexpected type: ?
(/media/debian/Storage/ppsspp/Core/MIPS/IR/IRRegCache.cpp:operator():806): [false] (ULUS10093 WRC, 0.4s) Unexpected type: ?
Trace/breakpoint trap

Platform

Linux / BSD

Mobile device model or graphics card (GPU)

Radeon HD 7850

PPSSPP version affected

v1.17-884-gcfcca0ed13

Last working version

No response

Graphics backend (3D API)

OpenGL / GLES

Checklist

hrydgard commented 4 months ago

Hm, this problem is slightly different. Does it affect all games?

archanox commented 4 months ago

Yeah all games with Dynarec, and same error with and without everything ticked in the JIT functionality list.

archanox commented 3 months ago

Just tested this recently on a SpacemiT K1/M1, and this issue is not there, but an older JIT issue has reappeared when loading into the race in WRC.

NB, just for future reference this new device advertises rv64imafdcv_sscofpmf_sstc_svpbmt_zicbom_zicboz_zicbop_zihintpause

Whilst the previous sg2042 device supports rv64gc_zfh_xtheadba_xtheadbb_xtheadbs_xtheadcmo_xtheadcondmov_xtheadfmemidx_xtheadfmv_xtheadint_xtheadmac_xtheadmemidx_xtheadmempair_xtheadsync_xtheadvector

archanox commented 2 months ago

I've just now tried the same game, same machine with latest upstream, unfortunately the same issue is there and I'm unable to see any visible errors in the terminal, unless there's a verbosity that needs to be changed?

Screenshot from 2024-09-14 00-01-08

I still feel the regression happened after the RISC-V JIT was implemented and during the IR JIT for other platforms.

archanox commented 2 months ago

I managed to find the verbose logging output, which yields me this after selecting my vehicle and stage prior to loading into the actual game.

10:43:411 __StreamThre W[SCEIO]: HLE/sceIo.cpp:2330 8002032a=sceIoWaitAsync(5, 09fdd21c[000000000000f990]): no async pending
10:43:459 idle0        I[FRAMEBUF]: Common/FramebufferManagerCommon.cpp:1 Decimating FBO for 04154000 (256x256 8888), age 6
10:43:851 bgProc_Threa I[PRINTF]: HLE/sceIo.cpp:1197 stdout: tinfo 80 count 22
10:43:851 bgProc_Threa I[PRINTF]: HLE/sceIo.cpp:1197 stdout: tinfo 81 count 68
10:43:900 bgProc_Threa I[PRINTF]: HLE/sceIo.cpp:1197 stdout: NuWarning - ..\nu2api.jwrcpsp\nu3d\psp\psp_final_obj\..\nugscn.c Line 2126 : Scene file out of date. Reconvert From Direct Mem.
10:43:900 bgProc_Threa I[PRINTF]: HLE/sceIo.cpp:1197 stdout: 
10:43:903 bgProc_Threa I[PRINTF]: HLE/sceIo.cpp:1197 stdout: NuWarning - ..\nu2api.jwrcpsp\nu3d\psp\psp_final_obj\..\nugscn.c Line 2126 : Scene file out of date. Reconvert From Direct Mem.
10:43:904 bgProc_Threa I[PRINTF]: HLE/sceIo.cpp:1197 stdout: 
10:43:905 bgProc_Threa I[PRINTF]: HLE/sceIo.cpp:1197 stdout: NuWarning - ..\nu2api.jwrcpsp\nu3d\psp\psp_final_obj\..\nugscn.c Line 2126 : Scene file out of date. Reconvert From Direct Mem.
10:43:905 bgProc_Threa I[PRINTF]: HLE/sceIo.cpp:1197 stdout: 
10:45:573 __StreamThre I[ME]: HLE/sceAtrac.cpp:196 1=sceAtracGetAtracID(00001000)
10:45:809 __StreamThre I[ME]: HLE/AtracCtx.cpp:699 0=sceAtracSetData(1, 08c7cd2c, 00020000): atrac3+ stereo audio
10:45:991 user_main    W[FRAMEBUF]: Common/FramebufferManagerCommon.cpp:1 Creating 8888 FBO at 04154000/04110000 stride=256 256x256 (force=1)
10:45:991 user_main    I[FRAMEBUF]: Common/FramebufferManagerCommon.cpp:5 Creating FBO for 04154000 (z: 04110000) : 256 x 256 x 8888
10:45:992 user_main    I[G3D]: Vulkan/VulkanRenderManager.cpp:136 Pipeline (x/5) time on : 0.92 ms, 1.06 ms since scheduling  rpType: 0001 sampleBits: 1 (game)
10:46:008 user_main    W[FRAMEBUF]: Common/FramebufferManagerCommon.cpp:1 Creating 5551 FBO at 04154000/04110000 stride=128 128x272 (force=1)
10:46:009 user_main    I[FRAMEBUF]: Common/FramebufferManagerCommon.cpp:5 Creating FBO for 04154000 (z: 04110000) : 128 x 272 x 5551
10:46:009 user_main    W[FRAMEBUF]: Common/FramebufferManagerCommon.cpp:2 Copy: Multiple dst vfb candidates for (dst: 04154000, size: 69632):
 - 04154000 8888 256x256 y=0 h=68 * 
 - 04154000 5551 128x272 y=0 h=272
 (COLOR)
10:46:022 user_main    W[FRAMEBUF]: Common/FramebufferManagerCommon.cpp:2 Didn't find a destination candidate for 0415c000/32/4 0,0 32x128
10:46:022 user_main    W[FRAMEBUF]: Common/FramebufferManagerCommon.cpp:2 Didn't find a destination candidate for 0415c000/32/4 0,0 32x128
10:46:024 user_main    W[G3D]: Common/TextureCacheCommon.cpp:1085 Ignoring possible texturing from framebuffer at 04154000 +0x128 / 128x272
10:46:152 user_main    W[FRAMEBUF]: Common/FramebufferManagerCommon.cpp:2 Didn't find a destination candidate for 0415c000/32/4 0,0 32x128
10:46:153 user_main    W[FRAMEBUF]: Common/FramebufferManagerCommon.cpp:2 Didn't find a destination candidate for 0415c000/32/4 0,0 32x128
10:46:189 user_main    I[G3D]: Vulkan/VulkanRenderManager.cpp:136 Pipeline (x/5) time on : 198.22 ms, 198.36 ms since scheduling  rpType: 0001 sampleBits: 1 (game)
10:46:206 user_main    I[G3D]: Vulkan/VulkanRenderManager.cpp:136 Pipeline (x/5) time on : 214.59 ms, 214.75 ms since scheduling  rpType: 0001 sampleBits: 1 (game)
10:46:212 user_main    I[G3D]: Vulkan/VulkanRenderManager.cpp:136 Pipeline (x/5) time on : 215.25 ms, 221.20 ms since scheduling  rpType: 0001 sampleBits: 1 (game)
10:46:252 user_main    W[FRAMEBUF]: Common/FramebufferManagerCommon.cpp:2 Didn't find a destination candidate for 0415c000/32/4 0,0 32x128
10:46:584 user_main    I[G3D]: Vulkan/VulkanRenderManager.cpp:136 Pipeline (x/5) time on : 592.93 ms, 593.08 ms since scheduling  rpType: 0001 sampleBits: 1 (game)
10:46:808 user_main    I[G3D]: Vulkan/VulkanRenderManager.cpp:136 Pipeline (x/1) time on : 167.08 ms, 167.17 ms since scheduling  rpType: 0001 sampleBits: 1 (game)
10:46:839 user_main    I[G3D]: Vulkan/VulkanRenderManager.cpp:136 Pipeline (x/2) time on : 520.51 ms, 520.63 ms since scheduling  rpType: 0001 sampleBits: 1 (game)
10:46:847 user_main    I[G3D]: Vulkan/VulkanRenderManager.cpp:136 Pipeline (x/2) time on : 528.62 ms, 528.75 ms since scheduling  rpType: 0001 sampleBits: 1 (game)

I don't think it's mentioned on this issue, but the game hasn't crashed and is still running with audio etc, just the screen is purely white as shown previously. You can get visibility back when entering the pause menu. image