an-anime-team / sleepy-launcher

Sleepy game launcher for Linux with telemetry disabling
https://discord.gg/ck37X6UWBp
GNU General Public License v3.0
78 stars 2 forks source link

Random low fps #9

Open scgm0 opened 2 weeks ago

scgm0 commented 2 weeks ago

图片 The scenarios where low fps occurs are different every time I start the game, it could be a pause screen, a copy of a battle, a block dialog, etc... The graphics card and cpu usage are not high, but the fps is only in the single digits.

amatsagu commented 2 weeks ago

Do you have multiple monitors? I have no idea why but in my case - I get up to 20-30fps more when I have game window on main screen (internal screen if you use laptop). It seems ZZZ does some scaling based on screen type/size? It's really weird.

I have external 1920x1080@75Hz monitor where I get 30-50fps and 99% GPU usage (Vega 8 iGPU) but when I switch to internal, thinkpad screen that is 1920x1080@60Hz - I suddenly get 50-60fps and ~85% GPU utilization. Both have sync enabled.

What I also got once or twice - some scenes/animations are hard locked on 30fps and you can get small freeze when that scene starts/ends but sometimes game seems to not detect end of that special scene and you're suddenly playing in soft locked 30fps.

scgm0 commented 2 weeks ago

Do you have multiple monitors? I have no idea why but in my case - I get up to 20-30fps more when I have game window on main screen (internal screen if you use laptop). It seems ZZZ does some scaling based on screen type/size? It's really weird.

I have external 1920x1080@75Hz monitor where I get 30-50fps and 99% GPU usage (Vega 8 iGPU) but when I switch to internal, thinkpad screen that is 1920x1080@60Hz - I suddenly get 50-60fps and ~85% GPU utilization. Both have sync enabled.

What I also got once or twice - some scenes/animations are hard locked on 30fps and you can get small freeze when that scene starts/ends but sometimes game seems to not detect end of that special scene and you're suddenly playing in soft locked 30fps.

I have a single-screen laptop, and the screen is 1920*1080@144Hz (but I don’t know why the game’s default resolution is 2k, and the frame rate has not changed significantly after changing it back to 1080p). The problem of low frame rate often occurs to me. Every time I start it, I can only pray that it will appear in a copy or an interface that is not often opened, otherwise I will have to restart the game.

amatsagu commented 2 weeks ago

Do you use fractional scaling? It may be issue of that. Wine/Proton are still running in xwayland and x server scales your whole screen X times bigger and then downscales to cheat you into thinking you have proper scaling.

If you do use 1.25, 1.50 scaling, etc. - please try going to standard 1.0 and then launch game and see if that helps.

scgm0 commented 2 weeks ago

Do you use fractional scaling? It may be issue of that. Wine/Proton are still running in xwayland and x server scales your whole screen X times bigger and then downscales to cheat you into thinking you have proper scaling.

If you do use 1.25, 1.50 scaling, etc. - please try going to standard 1.0 and then launch game and see if that helps.

I don't use fractional scaling either... 图片

amatsagu commented 2 weeks ago

Do you use fractional scaling? It may be issue of that. Wine/Proton are still running in xwayland and x server scales your whole screen X times bigger and then downscales to cheat you into thinking you have proper scaling. If you do use 1.25, 1.50 scaling, etc. - please try going to standard 1.0 and then launch game and see if that helps.

I don't use fractional scaling either... 图片

Then honestly I don't have any idea. Can only say that ZZZ seems to be problematic for quite a few people on launch, those issues will probably get fixed in next 2-3 releases. For now you can either try using different scripts like on Lutris (checked it works but idk if better or worse) or just go back to Windows for time being.

scgm0 commented 2 weeks ago

Do you use fractional scaling? It may be issue of that. Wine/Proton are still running in xwayland and x server scales your whole screen X times bigger and then downscales to cheat you into thinking you have proper scaling. If you do use 1.25, 1.50 scaling, etc. - please try going to standard 1.0 and then launch game and see if that helps.

I don't use fractional scaling either... 图片

Then honestly I don't have any idea. Can only say that ZZZ seems to be problematic for quite a few people on launch, those issues will probably get fixed in next 2-3 releases. For now you can either try using different scripts like on Lutris (checked it works but idk if better or worse) or just go back to Windows for time being.

Thank you for taking the time to help me troubleshoot the problem. It seems that I can only try using other scripts and wine before zzz is updated.

LostAttractor commented 2 weeks ago

I had a similar problem, I was using wayland, multiple monitors and fractional scaling at the same time. But I think it has nothing to do with these.

I found that ZZZ seems to take up a lot of vram, and more and more, until zram is not enough and suddenly drops to a very low frame rate, and because the vram overflows, the graphics card will work at a very low occupancy rate.

If you restart or login to the game again, the vram usage will drop significantly, and then it will take up more and more as you play until it is not enough.

scgm0 commented 2 weeks ago

I had a similar problem, I was using wayland, multiple monitors and fractional scaling at the same time. But I think it has nothing to do with these.

I found that ZZZ seems to take up a lot of vram, and more and more, until zram is not enough and suddenly drops to a very low frame rate, and because the vram overflows, the graphics card will work at a very low occupancy rate.

If you restart or login to the game again, the vram usage will drop significantly, and then it will take up more and more as you play until it is not enough.

You are right, it seems to be a vram problem here as well, caused by overflow of vram usage in random scenes.

amatsagu commented 2 weeks ago

Are you both using nvidia cards by chance? I looked bit more and it seems to leak vram only on nvidia cards and only when using wine/proton - on windows with "native" game it's fine.

ghostlyentity commented 2 weeks ago

my card is nvidia and has these stutters as well

scgm0 commented 2 weeks ago

Are you both using nvidia cards by chance? I looked bit more and it seems to leak vram only on nvidia cards and only when using wine/proton - on windows with "native" game it's fine.

Yes, I'm using a nvidia graphics card, gtx1650.

TsubakiDev commented 2 weeks ago

You can choose wine-tkg-9.12 to launch the game. In the discussion on discord, this seems to be a solution that can reduce the speed of vram leaks, but it still cannot completely solve the problem of vram leaks.

NOTE: Our test graphic card is AMD Radeon 7900GRE

ghostlyentity commented 2 weeks ago

You can choose wine-tkg-9.12 to launch the game. In the discussion on discord, this seems to be a solution that can reduce the speed of vram leaks, but it still cannot completely solve the problem of vram leaks.

for me it doesnt seem to be working, if anything it feels like i have more stuttering now

TsubakiDev commented 2 weeks ago

You can choose wine-tkg-9.12 to launch the game. In the discussion on discord, this seems to be a solution that can reduce the speed of vram leaks, but it still cannot completely solve the problem of vram leaks.

for me it doesnt seem to be working, if anything it feels like i have more stuttering now

Are you using an AMD graphics card? Our test platform is radeon 7900gre

ghostlyentity commented 2 weeks ago

You can choose wine-tkg-9.12 to launch the game. In the discussion on discord, this seems to be a solution that can reduce the speed of vram leaks, but it still cannot completely solve the problem of vram leaks.

for me it doesnt seem to be working, if anything it feels like i have more stuttering now

Are you using an AMD graphics card? Our test platform is radeon 7900gre

i have a

You can choose wine-tkg-9.12 to launch the game. In the discussion on discord, this seems to be a solution that can reduce the speed of vram leaks, but it still cannot completely solve the problem of vram leaks.

for me it doesnt seem to be working, if anything it feels like i have more stuttering now

Are you using an AMD graphics card? Our test platform is radeon 7900gre

i have a NVIDIA GeForce GTX 1660 SUPER After playing the game a few more times, i constantently get this overflow a lot quicker with wine staging tkg 9.12

is there another version you recommend?

TsubakiDev commented 2 weeks ago

You can choose wine-tkg-9.12 to launch the game. In the discussion on discord, this seems to be a solution that can reduce the speed of vram leaks, but it still cannot completely solve the problem of vram leaks.

for me it doesnt seem to be working, if anything it feels like i have more stuttering now

Are you using an AMD graphics card? Our test platform is radeon 7900gre

i have a

You can choose wine-tkg-9.12 to launch the game. In the discussion on discord, this seems to be a solution that can reduce the speed of vram leaks, but it still cannot completely solve the problem of vram leaks.

for me it doesnt seem to be working, if anything it feels like i have more stuttering now

Are you using an AMD graphics card? Our test platform is radeon 7900gre

i have a NVIDIA GeForce GTX 1660 SUPER After playing the game a few more times, i constantently get this overflow a lot quicker with wine staging tkg 9.12

is there another version you recommend?

No, I have only tested this version for now. If there are other versions that can reduce vram leaks, I will inform you in time.

ghostlyentity commented 2 weeks ago

You can choose wine-tkg-9.12 to launch the game. In the discussion on discord, this seems to be a solution that can reduce the speed of vram leaks, but it still cannot completely solve the problem of vram leaks.

for me it doesnt seem to be working, if anything it feels like i have more stuttering now

Are you using an AMD graphics card? Our test platform is radeon 7900gre

i have a

You can choose wine-tkg-9.12 to launch the game. In the discussion on discord, this seems to be a solution that can reduce the speed of vram leaks, but it still cannot completely solve the problem of vram leaks.

for me it doesnt seem to be working, if anything it feels like i have more stuttering now

Are you using an AMD graphics card? Our test platform is radeon 7900gre

i have a NVIDIA GeForce GTX 1660 SUPER After playing the game a few more times, i constantently get this overflow a lot quicker with wine staging tkg 9.12 is there another version you recommend?

No, I have only tested this version for now. If there are other versions that can reduce vram leaks, I will inform you in time.

alright thank you ill try a different versions and see if i get any better results

amatsagu commented 2 weeks ago

For now, it seems only way to play ZZZ with nvidia graphics without trouble is to either use Windows 11 or play through virtual machine with windows - yes you get bit more latency but then it just works (fps are about the same).

TsubakiDev commented 2 weeks ago

For now, it seems only way to play ZZZ with nvidia graphics without trouble is to either use Windows 11 or play through virtual machine with windows - yes you get bit more latency but then it just works (fps are about the same).

Yes, the best way at the moment is to use dual systems to play ZZZ

ghostlyentity commented 2 weeks ago

so far wine staging tkg 9.10 seems to be the most consistent one for me, it even managed to unstuck itself more than once for a while

voidlily commented 2 weeks ago

wine staging tkg 9.10 didn't make a difference for me. I can most easily reproduce the issue by opening and closing the menu

voidlily commented 2 weeks ago

Lutris with the HoyoPlay launcher didn't seem to make a difference either compared to sleepy-launcher, I was watching vram usage in nvidia-smi and the vram usage would go up very quickly.

My current test card in my linux machine is a GTX 1080, which meets the game's system requirements otherwise.

As for using a windows vm, I run into vm detection so that doesn't work either for me.

+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 555.58.02              Driver Version: 555.58.02      CUDA Version: 12.5     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GeForce GTX 1080        Off |   00000000:02:00.0  On |                  N/A |
| 54%   80C    P2             66W /  180W |    8009MiB /   8192MiB |     86%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+

+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI        PID   Type   Process name                              GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|    0   N/A  N/A      2509      G   /usr/lib/Xorg                                 862MiB |
|    0   N/A  N/A     12562      G   xfwm4                                           3MiB |
|    0   N/A  N/A    106464      G   ...yOnDemand --variations-seed-version         40MiB |
|    0   N/A  N/A    121043      G   /usr/lib/firefox/firefox                     1404MiB |
|    0   N/A  N/A    132218      G   /usr/lib/firefox/firefox                        2MiB |
|    0   N/A  N/A    134888      G   ...yOnDemand --variations-seed-version         37MiB |
|    0   N/A  N/A    238624    C+G   /usr/bin/mpv                                  445MiB |
|    0   N/A  N/A    239376      G   sleepy-launcher                                14MiB |
|    0   N/A  N/A    243872    C+G   ZenlessZoneZero.exe                          5083MiB |
|    0   N/A  N/A    244652      G   ...ta/Plugins/x86_64/ZFGameBrowser.exe         84MiB |
+-----------------------------------------------------------------------------------------+

At game launch the vram usage is around 1800MiB. Opening and closing the menu a few times quickly gets it to the reported usage of 5083MiB where lagging starts to happen.

gabzou364 commented 2 weeks ago

so there is no fix for this problem except running the game on windows?

Zerwin commented 2 weeks ago

I got curious and tried playing the game with the Nouveau drivers instead of the official Nvidia drivers. Sadly no way exists to measure the VRAM usage when using Nouveau, however after about 5min in, and after switching a bunch of times between menus and locations, the game (and my entire wayland session) crashed on me while I was pulling on a banner. I'm guessing it ran out VRAM.

gabzou364 commented 2 weeks ago

wait I think there was an update for my drivers and Now the game is actually running smoothly again no lag no fps drop try updating your nvidia drivers

voidlily commented 2 weeks ago

What hardware and driver version are you using? My report was on driver 555.58.02 which as far as I can tell is the most recent version.

Zerwin commented 1 week ago

A few more things I found out: Running the game under pure wayland (so not XWayland) does not fix the issue, but rather introduces a few other ones. However, I did observe someone on Windows having a similar problem. They were running the game while also having something open in the background that consumed a lot of VRAM, and the game initially showed the same problems (random low FPS). Only after reducing the resolution and setting rendering to 0.8 did it improve. So it might just really be a problem with the game that for some reason is limited to Nvidia, and more prone to occur with Wine (maybe the DXVK compilation just takes up more resources)

scgm0 commented 1 week ago

A few more things I found out: Running the game under pure wayland (so not XWayland) does not fix the issue, but rather introduces a few other ones. However, I did observe someone on Windows having a similar problem. They were running the game while also having something open in the background that consumed a lot of VRAM, and the game initially showed the same problems (random low FPS). Only after reducing the resolution and setting rendering to 0.8 did it improve. So it might just really be a problem with the game that for some reason is limited to Nvidia, and more prone to occur with Wine (maybe the DXVK compilation just takes up more resources)

If you use dxvk in Windows, will there be video memory issues as well?

kamikaze211 commented 1 week ago

I tested some scenes (such as streets or cities, include battle scenes) and some UI menus.

Both on Linux and on Windows: When open UI menus, the vram usage will increase, and won't release; When run in a scene, the vram usage will increase, but after swithing to another scene, the vram will decrease; After returning to the main log in menu, the vram usage will always be more than the first time

So I think, the vram behaviors in game on Linux and Windows is the same.

But, notice that, the game always uses more vram on Linux than on Windows. I think perhaps it is because that the game is running in a wine/proton/dxvk environment, and the environment will use extra hard resource than on Windows. I also tested some other games (such as Genshin Impact and Honkai Star Rail, and some Steam games) that running on Linux, and as a result, they did use more vram than on Windows.

And also ZZZ itself uses more vram than Genshin Impact and Honkai Star Rail. So ZZZ is not friendly for those graphic cards with low vram ( less than 4GB), maybe this includes Steamdedck.

But there are still somethings that you can try to decrease the vram that used by the system (except the game): 1, close the desktop environment, such as plasmashell, on my machine, plasmashell use about 1GB of 16GB vram. I recommend you to bind hotkeys for these commands:

systemctl --user stop plasma-plasmashell.service
systemctl --user start plasma-plasmashell.service

2, close any other applications that use much vram, you can check this by using something like nvtop. On my machine, these applications usually are: Systemsettings, Steam, browsers ( Firefox, Chrome, and any other chromium or electron based applications (and also the official game launcher: Hoyoplay).

scgm0 commented 1 week ago

I tested some scenes (such as streets or cities, include battle scenes) and some UI menus.

Both on Linux and on Windows: When open UI menus, the vram usage will increase, and won't release; When run in a scene, the vram usage will increase, but after swithing to another scene, the vram will decrease; After returning to the main log in menu, the vram usage will always be more than the first time

So I think, the vram behaviors in game on Linux and Windows is the same.

But, notice that, the game always uses more vram on Linux than on Windows. I think perhaps it is because that the game is running in a wine/proton/dxvk environment, and the environment will use extra hard resource than on Windows. I also tested some other games (such as Genshin Impact and Honkai Star Rail, and some Steam games) that running on Linux, and as a result, they did use more vram than on Windows.

And also ZZZ itself uses more vram than Genshin Impact and Honkai Star Rail. So ZZZ is not friendly for those graphic cards with low vram ( less than 4GB), maybe this includes Steamdedck.

But there are still somethings that you can try to decrease the vram that used by the system (except the game): 1, close the desktop environment, such as plasmashell, on my machine, plasmashell use about 1GB of 16GB vram. I recommend you to bind hotkeys for these commands:

systemctl --user stop plasma-plasmashell.service
systemctl --user start plasma-plasmashell.service

2, close any other applications that use much vram, you can check this by using something like nvtop. On my machine, these applications usually are: Systemsettings, Steam, browsers ( Firefox, Chrome, and any other chromium or electron based applications (and also the official game launcher: Hoyoplay).

When zzzz's video memory leaks start it all drains all the video memory very quickly, no matter how much video memory one has it's never enough.

Zerwin commented 1 week ago

If you use dxvk in Windows, will there be video memory issues as well?

Can't say, not sure why you would even try using dxvk on windows for this though as the problem seems to occur less on windows

When zzzz's video memory leaks start it all drains all the video memory very quickly, no matter how much video memory one has it's never enough.

Are you sure about this ? Can anyone with an Nvidia 12GB+ VRAM GPU confirm this ?

And also ZZZ itself uses more vram than Genshin Impact and Honkai Star Rail. So ZZZ is not friendly for those graphic cards with low vram ( less than 4GB), maybe this includes Steamdedck.

Steamdeck uses an AMD APU, and from the previous comments it seemed like the problem was limited to Nvidia GPU's, so Steam Deck should be fine. Also lowering the resolution and rendering of the game also helps with lowering the VRAM consumption. Overall for now this really feels like something that might just needs to be fixed by Mihoyo in the game itself.

amatsagu commented 1 week ago

If you use dxvk in Windows, will there be video memory issues as well?

Can't say, not sure why you would even try using dxvk on windows for this though as the problem seems to occur less on windows

When zzzz's video memory leaks start it all drains all the video memory very quickly, no matter how much video memory one has it's never enough.

Are you sure about this ? Can anyone with an Nvidia 12GB+ VRAM GPU confirm this ?

And also ZZZ itself uses more vram than Genshin Impact and Honkai Star Rail. So ZZZ is not friendly for those graphic cards with low vram ( less than 4GB), maybe this includes Steamdedck.

Steamdeck uses an AMD APU, and from the previous comments it seemed like the problem was limited to Nvidia GPU's, so Steam Deck should be fine. Also lowering the resolution and rendering of the game also helps with lowering the VRAM consumption. Overall for now this really feels like something that might just needs to be fixed by Mihoyo in the game itself.

Yes, it seems that currently all Nvidia graphics have this bug with vram leak (or doing something else that system interprets as vram leak). I use AMD graphics just fine and know 0 other reports about problems on AMD side. Additionally - I've heard this bug may not be related to dxvk or wine - very small number of people seems to experience it also on Windows 11 but it's hard to debug... it seems to appear once every XX game launches, it's not always present on windows. There's probably nothing to be done - we have to wait for Mihoyo to eventually notice this and fix problem. On Windows, it's probably very minor problem so it may be a long time (if at all) for them to handle this.

kamikaze211 commented 1 week ago

Now there is a workaround for Nvidia card players:

DXVK_CONFIG="dxgi.emulateUMA = True" DXVK_ENABLE_NVAPI=0

UMA ( Unified Memory Architeture ) is a technology that allows a graphics processing unit to share system memory. DXVK allows you to emulate this technology.

I asked some friends to test this workaround, as a result, they can play now withouth out of vram issue. I think you can also give a try.

gabzou364 commented 4 days ago

Now there is a workaround for Nvidia card players:

DXVK_CONFIG="dxgi.emulateUMA = True" DXVK_ENABLE_NVAPI=0

UMA ( Unified Memory Architeture ) is a technology that allows a graphics processing unit to share system memory. DXVK allows you to emulate this technology.

I asked some friends to test this workaround, as a result, they can play now withouth out of vram issue. I think you can also give a try.

This fix the problem Thank you

ghostlyentity commented 2 days ago

Now there is a workaround for Nvidia card players:

DXVK_CONFIG="dxgi.emulateUMA = True" DXVK_ENABLE_NVAPI=0

UMA ( Unified Memory Architeture ) is a technology that allows a graphics processing unit to share system memory. DXVK allows you to emulate this technology.

I asked some friends to test this workaround, as a result, they can play now withouth out of vram issue. I think you can also give a try.

what to do with this? if i use it in the launch options it wont start