Страницы

воскресенье, 30 июля 2023 г.

Yuzu emulation with rx 580

 Recently, I've had an experience of running nintendo switch games on windows 10 using Yuzu emulator on amd gpu.

Setup:

Amd Radeon RX 580 gpu

3.0 GHz cpu, 8 cores (16 threads)

My observations so far:

1. Mario odyssey runs in slowmo (when you observe many visual objects). This is easily reproduced on first level. Fps is not high too (20-23). 

2. If we uncheck the box "Use fast gpu time (hack)", the performance increases about 2 times. Slowmo is no more there and fps is about 38 FPS, sometimes dropping, but not below 25. But the quality drops too, we've got pixels :). Same behaviour can be achieved setting baseline to 2x (with fast gpu time hack disabled)

3. If we install all mods, we get rid of some frame drops but not all the time. Mods:

(I used yuzu mode downloader and default official server. See install instructions here https://github.com/amakvana/YuzuModDownloader#installation)

4. As I said, sometimes we still get frame drops and slowmo. 20-23 fps exactly. E.g. playing the level beginning after Harriet boss (after falling into hole) gives slowmo. 

The observations at first looks like https://www.reddit.com/r/yuzu/comments/i9zy8q/very_low_fps_on_rx_580/. And the cure, suggested there (except buying new video card, not acceptable in my case) is making more mhz on the cpu. Recommended system requirements of yuzu is also higher than I have (3.6ghz > 3.0ghz) Tried cpu overclocking to 3.6. With no luck. If we check mhz consumed by yuzu, it's not that most all the time, it is 1.5ghz - 3.6ghz, but lags persist all the time, so it's not about cpu.

5. As mentioned on reddit and in some docs on yuzu (https://yuzu-emu.org/wiki/deprecated-building-mesa-on-arch-linux/) we can achieve decent performance (with amd gpu) on linux. So I've installed and checked 2 games: mario odyssey and Astral chain. I'm sharing my observations and setup with you.

Ubuntu 22.04.2 LTS

Mesa gpu driver 22.2.5 (out of the box, note I've connected to internet during ubuntu installation, kisak 23.1.4 gives same performance)

Mario odyssey:

Cut scenes works without freezes, it's way better than on windows (with all settings I've tried there).

Game runs better, most time I have 25-38 fps, but still dropping to 20-23 (with slowmo) mostly on level begins (many visual objects - houses, trees, characters). Game is more playable than on windows.

Setup: vulkan, force cpu clocks checked.

Astral chain:

Opengl spir-v (experimental, mesa only. Important, to not get huge drops in menu and character select), accuracy is normal (important! To not get huge fps drops on character select)

I've also made some graphics lowering, but not tested if that help actually:

Vsync off,

Quality medium,

Anisatrophic filtering 2x.

Thats the setup:


This way I get 30 fps all the time (menu, intro, character select). But 15-20 fps in combat. And solid freezes in intro after race ends.

6. Note on Ryujinx. Mario works way better in this emulator, tested on same linux, opengl backend. 45-60 fps. But have freezes sometimes (shaders compile synchronously?) It's still linux as I already switched my test environment.

In Astral chain ryujinx gives same results as yuzu (30 fps menu, character select; 25-30 intro). But when we compare fps in combat, ryujinx is 22-25 fps (opengl) while yuzu is 15-20 fps. And both have freezes sometimes (shader compile), but with ryujinx they gradually disappear while you play (shader cache).

Tried to get more smooth gameplay with ryujinx+Vulkan. It gives 30 fps menu, 18-23 intro and char select, 20-30 fps, but dropping sometimes to 15. Fps drop with combat and intros is quete annoying. For sure, opengl is better with this game at the moment of writing.

Note: disabling vsync and setting anisotrophic filtering to 2x can give small performance increase.

7. Note on nvidia. I've got laptop from friend and checked astral chain and mario in windows. Both works ok (mario 35 fps, astral chain 30 fps) with some minor changes to setup: set opengl glasm (nvidia only). I've also set to use async shader building: looks like have less freezes on shader compiling, noticible in astral chain. Mods not applied at all. But yuzu gives low fps in combat (15-20).

Ryujinx gives the following results:

For mario better, 40-45 fps. 

For astral chain fps menu-first intro-character select is about same 25-30 fps, while in combat it's better, 25-30, but have stutters (new enemy, new fx, looks like shader compiling freezes main thread), which dissappear while you progress on the game (shader cache works I think), so this game is played much better with Ryujinx.

Test setup: asus g14 zephyrus laptop with nvidia geforce rtx 2060 with max-q design (running in energy saving mode btw)

1920x1080 display


Conclusion

If you have nvidia card, then you are good to go with windows, opengl (select glasm for yuzu).

 Ryujinx shows better fps in both idle and in combat or when there are many visual objects in the games chosen. Freezes in astral chain with ryujinx+opengl are going away gradually as you play. Yuzu shows lower fps (15-20 vs 20-25) than ryujinx on both linux+amd and windows+nvidia then ryujinx+opengl.

Ryujinx for mario is excellent with nvidia gpu (40-45 fps).

If you have amd radeon gpu, then it's better to be on linux with opengl. Both yuzu and ryujinx can run in linux with almost same performance. But when it comes to mario and ryujinx, radeon is better in fps (45-60 vs 40-45 nvidia), but have more noticible freezes. If you switch to yuzu to eliminate freezes with this card, 25-38 idle and 20-23 slowmo when there are many visual objects (level begins is the most common case). So nvidia is better for mario (because of less freezes and acceptable fps).

In astral chain, both yuzu and ryujinx shows noticible freezes, but ryujinx+opengl is better because of fps. And freezes are going away gradually as you play. And if you compare what we have for astral chain with nvidia, we will see that with amd radeon we have a fps drop (comparing these 2 video cards) in combat: amd 20-25 vs nvidia 25-40. Yuzu loses with radeon as it gives less fps without anything being better in stutters.

So, mario is excellent with nvidia and ryujinx+opengl on windows. On radeon you need linux and need to choose either lower (but acceptable) fps + minimum slowmo with yuzu+opengl. Or more slowmo but higher fps (48-60) (ryujinx+opengl/ryujinx+vulkan).

As it comes to astral chain, ryijinx+opengl is better choice. Vs same ryijinx+opengl on linux for amd card. Nvidia gives better fps when it comes to combat (25-30 vs 20-25 fps).

PS vulkan+ryujinx, nvidia, crashes in my setup.


What I personally select

I personally select ryujinx+opengl for nvidia (windows) for both mario & astral chain. And ryujinx+opengl (linux) for astral chain as they give better fps in combat then yuzu in any configuration. Same ryujinx+opengl for mario and luigi mansion 3 (luigi mansion not very much playable as it drops to 22 fps in many places).

As for amd gpu (linux), mario is better with yuzu+opengl because with disable mods it runs with much less slowmo, generally fps is lower than with ryujinx, but all in all it's more comfortable because of less slowmo and high fps with ryujinx is not needed (60 fps).

Note: I tested 2 games here. With other games it may be other choices. E.g. luigi mansion 3. The best I got, it is about 15-18 fps on radeon ryujinx+opengl (vulkan gives 4, yuzu gives ugly result on both backends). And on nvidia it's 22-24 fps with yuzu+opengl. Tested in first room after intro, character walking.

Checked options to note: async shader building (yuzu), 2x anisotropic filtering, normal accuracy (yuzu, important), vsync off(yuzu, not ryujinx), bilinear window adapting filter, no anti-aliasing, use fast gpu time (for quality, a bit better than set baseline)