RPCS3 / rpcs3

PlayStation 3 emulator and debugger
https://rpcs3.net/
GNU General Public License v2.0
15.69k stars 1.93k forks source link

Pre-existing SPU cache kills performance in LittleBigPlanet games (#10003) #10497

Closed Kilowog01 closed 6 months ago

Kilowog01 commented 3 years ago

Quick summary

Pre-existing SPU cache kills LittleBigPlanet 2 performance.

Details

During my adventures trying to reach 100% in LBP2, tweaking a setting here, installing a DLC there, new savegame, new build etc. I noticed that sometimes the game ran at 30fps, especially on the first run. That wasn't normal, I was used to 17ish fps. I started the investigations, downloaded a new build, installed the minimum necessary and bam, constant 30fps. But when i restarted the game, there was loss of 12fps with instability. So I found that if I delete all caches, the game goes back to 30fps. While the shader cache is being compiled the fps drops a bit, but then I can play at 30 for as long as I want(I tested for about 2 hours), the fps doesn't decrease over time, it's always around 30fps. But if I restart the game, the fps drops back to 17ish.

The logs contained here are with default settings, with the exception of the overlay performance.

Pre-existing cache: https://user-images.githubusercontent.com/16064499/123503758-44bb5e80-d62b-11eb-9591-3c2fb1ba0abe.mp4 RPCS3_old cache.log.gz

Fresh cache: https://user-images.githubusercontent.com/16064499/123503750-3c632380-d62b-11eb-9e18-0e17db93b043.mp4 RPCS3_fresh cache.log.gz

Fresh cache after a while: https://user-images.githubusercontent.com/16064499/123504482-083e3180-d630-11eb-932e-2b7fd0b07192.mp4

System configuration:

elad335 commented 3 years ago

Which cache?

Kilowog01 commented 3 years ago

SPU cache is the one that makes the most difference between the 3.

Remov84 commented 3 years ago

same problem but on LBP1 RPCS3.log.gz

Kilowog01 commented 3 years ago

Issue #10045 talks about the same problem, but the reported pull is incorrect, in fact this problem is a regression caused by the pull #10003 by @elad335 The generally recommended build (12025) was the problem all along, the only reason people reported improvement was the fact that they were running the game for the first time, with no pre-existing spu cache. Build 12023 doesn't have this problem.

Logs (pre-existing spu cache) 12023 12025

ghost commented 3 years ago

Interesting. I started LittleBigPlanet 1 for the first time and got a solid 30fps. The next time it dropped to 23FPS for no reason and I was wondering what's wrong with my machine. Maybe this is the cause.

Nekotekina commented 3 years ago

Can someone upload SPU cache dat file after FPS is dropped?

Remov84 commented 3 years ago

\cache\BCES00141\ppu-Jo3ijKqksCR388Rnxnw5vwpisVCV-EBOOT.BIN\"spu-safe-v1-tane.dat" right ? https://cdn.discordapp.com/attachments/861214916290674718/869188821839925298/spu-safe-v1-tane.dat

Kilowog01 commented 3 years ago

spu-safe-v1-tane.zip Using 4.46 fw because VSH

Nekotekina commented 3 years ago

I'd like to ask for logs (make sure to use latest version), but with a few debug options set in config:

  1. Open config.yml in an appropriate text editor
  2. Find "SPU Debug" and change its value from false to true
  3. Find "SPU Profiler" and change its value from false to true
    • Provide two logs, with deleted SPU cache and with a cache that initiates the slowdown.
    • Pause and unpause game when in the area showing the FPS difference, wait at least 20 seconds before stopping the emulation
Kilowog01 commented 3 years ago

I'd like to ask for logs (make sure to use latest version), but with a few debug options set in config:

  1. Open config.yml in an appropriate text editor
  2. Find "SPU Debug" and change its value from false to true
  3. Find "SPU Profiler" and change its value from false to true
    • Provide two logs, with deleted SPU cache and with a cache that initiates the slowdown.
    • Pause and unpause game when in the area showing the FPS difference, wait at least 20 seconds before stopping the emulation

Okay, I had a problem while doing it with pre-existing cache. I did what you asked but game won't boot with SPU debug on, only with profiler. At the end of "building spu cache" RPCS3 closes without any error. The log with deleted cache is exactly as requested. RPCS3 SPU - Pre-existing cache - SPU DEBUG CRASH.log RPCS3 SPU - Pre-existing cache - SPU Profiler ONLY.log.gz RPCS3_DELETED CACHE.log.gz

KryptonicDragon commented 3 years ago

I am having the same issue, where having existing SPU caches causes performance to tank in NPUA80662 (LittleBigPlanet 2).

Here are some logs from me as well, with "SPU Debug" and "SPU Profiler" enabled in (the game's custom) config.yml: NPUA80662 SPU cache slowdown - 1st run (cleared SPU cache).log.gz NPUA80662 SPU cache slowdown - 2nd run (existing SPU cache).log.gz

Unlike @Kilowog01, my game successfully booted with "SPU Debug" enabled when running the 2nd time (with existing SPU cache).

Here is the SPU Cache file used in the 2nd run (at least, I think this is the right file): spu-safe-v1-tane.zip

In both runs, I launched the game, spammed start to skip the warnings/intros, went into the same level, and walked/jumped around for a bit. Both times, I paused the emulator for about 1-2 seconds, un-paused, waited 20 seconds, then exited RPCS3.

The slowdown exists throughout the entire game, no matter what level I'm playing (or even if I'm not in a level and am in the "pod" (the game's "lobby")).

Here is a screenshot from the 1st (cleared SPU cache) run: image And here is one from the 2nd (existing SPU cache) run: image

RPCS3 Version: 0.0.17-12565-8af694da Alpha OS: Windows 10 x64 v20H2 CPU: AMD Ryzen 7 5800X GPU: NVIDIA RTX 3070 GPU Driver version: 466.27

Kilowog01 commented 3 years ago

it seems that Neko fixed SPU debug, i can run the game now. RPCS3 WITH CACHE.log.gz RPCS3 WITHOUT CACHE.log.gz And yes, the main menu/pod is technically already a level. I pause when sackboy hits the ground, count to 5, unpause and then count to 20 before closing. The logs should look very similar.

AphelionWasTaken commented 3 years ago

This issue appears to be related to logging. I can reproduce this to some extent on builds going all the way back to last September (probably further, but that's where I stopped).

0.0.15-12025 does appear to have made it worse though; when launching with an existing spu cache before this build, performance would dip by about 25% for me, whereas now it drops by about 50%.

With logs silenced, performance is consistent boot after boot with or without an existing SPU cache: Launch 1: image Launch 2, 3, 4, etc...: image

With logs enabled, performance takes a dip. Launching the game with no SPU cache results in the performance below: image RPCS3 NO CACHE.log.gz

Closing the emulator and relaunching the game with logs enabled and an existing SPU cache causes performance to tank image RPCS3 CACHE.log.gz

elad335 commented 6 months ago

Heavily outdated and probably fixed, also log spam iirc is reduced significantly since.