rpcs3 icon indicating copy to clipboard operation
rpcs3 copied to clipboard

PR 11904 vm locking refactoring ... performance improvements only for windows build and much slowdown in linux build

Open Augusto7743 opened this issue 1 year ago • 1 comments

Quick summary

Hello. Thanks for reading my topic.

I had posted an topic about the issue with PR 11904 doing slowdown in Linux build, but was erroneously ignored simply the used cpu was an AMD FX. I understand AMD FX not have an good performance compared with current cpus, but the problem not is exactly related with the AMD FX.

The problem is some games continue running in 100 % speed , but are using more cpu and others have much slowdown and random stuttering for few seconds. I had tested several builds and the problem is the rpcs3-v0.0.22-13536. When happen that error the log window not show any creation of shader or spus and not running any OS tasks in background.

Thus for testing I had installed in same machine ( same AMD FX-6300 cpu and gpu GT 640) the windows 10 20H1. windows 10 using default settings without any software running in background or optimizer. For my surprise not any slowdown errors. The windows build run perfectly with speed improvements using PR 11904 (rpcs3-v0.0.22-13536) than before.

Example An game in linux build in rpcs3-v0.0.21-13534 > run in 50 FPS rpcs3-v0.0.22-13536 > run between 30 to 40 FPS others games continue 100 % speed using more cpu.

but in windows build rpcs3-v0.0.22-13536 > run above 55 FPS

PR 11904 vm locking refactoring was created for speed improvements and really does , but only for windows build. The Linux build is inverse. Not any details that PR 11904 was only for windows.

If you have both windows and linux in your machine will see clearly the windows build is much more faster. Linux builds are having slowdowns since rpcs3-v0.0.22-13536 from 2022-05. However any user having current cpus intel and amd not will see it because some users not does tests. Several improvements was done in source and really have done improvements in Linux build too, but that PR 11904 continue not allowing for linux build an performance similar with windows build.

Linux is Ubuntu 20.04.6. I have configured the OS /etc/security/limits.conf

  • hard memlock unlimited
  • soft memlock unlimited

disabled mitigations testing with zram enabled and disabled without an swap file and others settings. Not any fix.

"VM" is related with the PS3 vm file or OS virtual memory ? If is related with PS3 vm file and if is an similar pagefile perhaps is the explanation because only some games are slow. Perhaps that PR 11904 not was added code for Linux OS ?

Teenage Mutant Ninja Turtles Out of the Shadows is one in the list having issues. That game not need to run an current cpu.

Perhaps is simple an fix for Linux builds. Please not ignore because the topic was used an AMD FX. That is related with OS build. My action posting about it is correct. If need any log using some settings only reply me and I will try test and upload log file.

Is required upload an log to post topic, I have uploaded an zip file without log. First I need see if need and which settings before doing logs. Have an nice week

Details

No response

Attach a log file

null.zip

Attach capture files for visual issues

No response

System configuration

Ubuntu 20.04.6 Windows 10 20H1 GPU Geforce GT 640 4 GB DDR3

Other details

No response

Augusto7743 avatar May 24 '23 13:05 Augusto7743

Missing log file

AniLeo avatar May 24 '23 16:05 AniLeo

Thanks very much for attention given to my topic. I see had to add all details below for better understand because I am only an user.

I have done an test in same machine being : AMD FX 6300 4 GB RAM Geforce GT 640 1 GB Mainboard BIOS using default settings and disabled AMD core performance. Nvidia using performance adaptive with default settings.

Windows 10 20H1 using OS default settings in an "clean" recent installed OS. not any software optimizer running in background. disabled "Game Mode" and MS Antivirus. cpu power profile used high performance Nvidia Control Panel using default settings (not vsync).

Linux is Lubuntu ( Ubuntu using LXQT ) 20.04.6 kernel 6.2.12 disabled mitigations cpu power profile performance Disabled security feature not allowing memory maximum allocation for softwares using in /etc/security/limits.conf hard memlock unlimited soft memlock unlimited

Test was used versions 0.0.21-13534

0.0.22-13536 PR 11904 vm locking refactoring https://github.com/RPCS3/rpcs3/pull/11904

0.0.28-15183

RPCS3 using default settings SPU Block safe GPU OpenGL (Vulkan is the same performance) Framelimit off Vsync disabled Sleep Timers in windows "Usleep Only" and linux "As Host" Created an separate "cache" directory files (PPUs firmware, PPUs game , SPU and shaders) for each RPCS3 version. Game Patch setting applied in GOWA

Games tested God of War Ascension [NPUA80918] Snakeball [NPUA80072] Teenage Mutant Ninja Turtles Mutants in Manhattan [NPEB02246]

I had selected GOWA simply because that game use all cpu cores to 100 % , the slowdown happen exactly in same mode if compared with others affected games and I not remember exactly all games with slowdown issues with linux build. PLEASE not demanding or waiting any optimization to run GOWA in AMD FX ... GOWA cpu requirement is less of half if compared with Uncharted 2. However I need say GT6 , KZ3 , Uncharted 2 and 3 and TLOUS are impossible run in AMD FX. GOWA in an AMD FX run the game title and some stage areas with speed possible to play ... Perhaps is enough to see in logs any issues , but if you RPCS3 coder say created GOWA logs are invalid I need run some games for an long time to remember which are the affected games to create logs and upload the results ...

Linux version happen slowdowns and repeated intervals of some seconds stuttering dropping framerate and after returning good performance after in some secods again the stuttering even with the gameplay not moving the player character in area not happening any activity or changing the graphics. When happen slowdowns RPCS3 log window not show any creation of shader or spus and not running any OS tasks in background. Windows version not happen any slowdown and the issues above.

In tests both windows and linux had more than 1,5 GB RAM free even after loaded the game ... enough RAM to run RPCS3. Perhaps I will say something wrong , when happen the slowdown is as if RPCS3 are trying allocate memory to some processing , but not is being possible allocate enough memory size and thus some processing tasks are waiting time to begin process after others codes will be completed. Each game was started two times waiting create all caches files ... thus avoid cpu usage creating spu and shaders ... in third time was created the log. Linux version was created logs using "usleep" and "as host". I have been noticed an detail ... windows version create an null file with an name related with "vm" of 32 GB size ( null disk space) in rpcs3 exe root directory and linux version not does it and not have any file vm of 32 GB size, but create in /dev_hdd0/vm/ an file vm0 of 0 bytes. windows version begin create that file "vm" 32 GB exactly in 0.0.22-13536 PR 11904 vm locking refactoring.

In games tested the problem only happen with GOWA ... the other two games not are affected ... Snakeball not use 100 % cpu and TMNT Mutants in Manhattan [NPEB02246] use 100 % cpu not having good speed even thus not happen the PR 11904 slowdown bug. PR 11904 only does slowdowns in some games ... however not only for games using 100 % cpu ... happen in simple games using less of 75 % cpu too.

Other detail is possible see in windows "usleep" have better performance for much games and in linux "as host" for some games and "usleep" for others.

Below have details about the speed of three games comparing before and after of PR 11904 and with recent 0.0.28-15183. 0.0.28-15183 not have Snakeball because only run in PPU interpreter mode. Numbers are FPS.

0.0.21-13534

God of War Ascension [NPUA80918] Windows 11 between 14 Linux 15 between 20 and 14 Snakeball [NPUA80072] Windows 23 between 28 Linux 24 between 32 Teenage Mutant Ninja Turtles Mutants in Manhattan [NPEB02246] Windows 8 Linux 9

0.0.22-13536 PR 11904 vm locking refactoring

God of War Ascension [NPUA80918] Windows 14 between 16 Linux 9 between 15 7 ~ 11 Snakeball [NPUA80072] Windows 23 between 28 Linux 24 between 32 Teenage Mutant Ninja Turtles Mutants in Manhattan [NPEB02246] Windows 8 Linux 8

0.0.28-15183

God of War Ascension [NPUA80918] Windows 14 between 16 Linux 9 between 11 Teenage Mutant Ninja Turtles Mutants in Manhattan [NPEB02246] Windows 8 Linux 10

GOWA start the game and save load the stage 6 being an area playable in AMD FX. About Linux version GOWA in 0.0.21-13534 run in game title between 15 to 20 FPS and in stage 6 average 14 FPS and in 0.0.22-13536 happen the problem affecting others games having an behavior game title few times is 15 FPS and almost all times between 9 to 11 with stuttering for few seconds repeating in intervals and in stage 6 the framerate is between almost all time in 7 FPS and few times 11 FPS. However the windows version is the inverse ... in 0.0.21-13534 GOWA framerate is variable between 14 to 16 and in 0.0.22-13536 PR 11904 few times is 14 FPS and almost all time 16 FPS having few moments above 18 FPS as if the graphics are being rendered without frameskip ... 0.0.22-13536 PR 11904 win build does performance improvements between 10 to 15 % in GOWA and in others games. Possibly in current intel and zen the improvements are more high. 0.0.28-15183 linux build continue with the same slowdowns and stuttering even after several versions with fixes and others optimizations.

In moment I not remember all games having slowdowns problems with PR 11904. Exactly as happen in GOWA is the same behavior in others games ... If necessary I can create video capture showing the problem and upload in YT posting here the link.

Thanks very much for reading my topic. I wish good luck in path of life for you RPCS3 coder. Your good deeds have allowing me play my PS3 games in PC =) I wish for you an nice next week too.

logs.zip

Augusto7743 avatar Jun 17 '23 03:06 Augusto7743

Test with #12598

elad335 avatar Jul 26 '23 09:07 elad335

Retest on master.

elad335 avatar Jul 27 '23 07:07 elad335

Excuse me for the long delay in reply. Internet access problems.

Tested 0.0.28-15404 only in GOW Ascension and the performance is the same compared with 0.0.22-13536 windows version. Now the game is MUCH FASTER in some moments and loading menus ... huge performance improvement ... before trying load menus more or less 2 seconds and now is half second even with game loading data and some areas are much more faster.

I need test in same machine with others games and with the windows version too ...

  • If both windows and linux have same performance the PR#12598 have fixed the problem.

or

  • If in same machine the windows version is more faster than Linux the PR#12598 have done an very good performance improvement.

I will report the test when possible.

elad335 ... an huge thanks for you !!!! God bless your life and have an nice next week.

Augusto7743 avatar Sep 10 '23 00:09 Augusto7743

Tested in same machine comparing with windows version and Linux version run in similar performance. the problem was fixed !!!! THANKS !!!!!!!!!!!!!!!!!!

Augusto7743 avatar Sep 10 '23 04:09 Augusto7743