an-anime-team/an-anime-game-launcher

Genshin since today - 100% CPU usage and new maybe new kernel-anticheat stuff

Opened this issue · 21 comments

I asked on reddit and it seems it confirmed.

Since today - launching Genshin in Linux always use 100% CPU.

Current solution to 100% CPU usage in Genshin on Linux - turn off internet, start Game, wait for login screen and error, connect to internet - no 100% CPU.

Edit - that log lines for anticheat is old, it was not working like that for long time.

So maybe this is not reason to worry.


Wine log, this last two lines:

0164:err:module:import_dll Library WDFLDR.SYS (which is needed by L"C:\\windows\\system32\\HoYoKProtect.sys") not found
0164:err:ntoskrnl:ZwLoadDriver failed to create driver L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\HoYoProtect": c0000142

After that - infinite spam of fixme:sync:NtCreateTransaction :

0188:fixme:sync:NtCreateTransaction (nil), 0x1aaff40, 0x789f90, {28ec8348-894c-ffc1-d289-c1ff15f39902}, (nil), 0x00000000, 0x00000000, 0x00000000, (nil), (nil) stub.
0188:fixme:sync:NtCreateTransaction (nil), 0x1aaff40, (nil), (null), (nil), 0x00000000, 0x00000000, 0x00000000, (nil), (nil) stub.
0188:fixme:sync:NtCreateTransaction (nil), 0x1aaff40, (nil), (null), (nil), 0x00000000, 0x00000000, 0x00000000, (nil), (nil) stub.

WDFLDR.SYS - is windows kernel-modules loader, and it seems Genshint trying to load new C:\\windows\\system32\\HoYoKProtect.sys - and it can not that result in infinite spam of error.

Idk how important it is and will it lead to account bans because we can not load this anticheat...
(having 100% CPU usage is very annoying)

the reddit thread you linked has a solution and I can confirm it works

turn off internet, start Game, wait for login screen and error, connect to internet - no 100% CPU

Can confirm, this happens to me as well. The wifi toggle trick seems to be the only fix to it for now.

Huh, now THAT'S why I've only been getting like 20 fps out of 60 lately. Also it might be consuming more RAM, but idk. Will update on any bans
Launching the usual way:
Screenshot_2024-06-12_21-32-28
After trying the workaround out, same location, same settings:
Screenshot_2024-06-12_21-35-35
However, I must also point out that I recently downloaded the new Hoyoplay launcher on my Windoze installation (for kicks and giggles), which might have somehow altered Genshit's files that I share with Linux through a symlink, but I'm not too sure either, can't spare more 80 gigs for a single test. Would love to know if anyone's downloaded that shady crap too and encountered the same issue

However, I must also point out that I recently downloaded the new Hoyoplay launcher

I downloaded/used it weeks before current 100% CPU behavior - I do not think it related.

However, I must also point out that I recently downloaded the new Hoyoplay launcher

I downloaded/used it weeks before current 100% CPU behavior - I do not think it related.

You're right, it's not. I noticed this after the ~4 KB or so update in-game we had yesterday. This was not due to the launcher.

I don't seem to notice a 100% CPU usage, in fact the game is running fine for me. Well, until I run out of space because the syslog eats the whole root partition.

5310 commented

On my Steam Deck, capped at 7W and medium resolution, 30fps around Fontaine, I now get 80–90% CPU usage. After using the "Wifi" trick, it drops to the 30–40% I used to get last week 🥲

There's definitely a massive change, but I don't get frame drops yet. I certainly get a gigantic battery drop though! Gotta look out for the syslog too now... Hope this works out

I was thinking of using an rsyslog rule to prevent the launcher from logging anything. Though I'm not sure if that's a good idea.

Despite me adding rsyslog rules to prevent the launcher from logging anything, setting WINEDEBUG to -all and -richedit, the fixmes were still getting logged.

Guess we'll just have to wait.

@DvidPiDev
export WINEDEBUG=-all
to turn off wine-error spam you had in yours #384

(this does not fix 100% CPU usage, errors just not logged, only ofline-launch work as fix for now as described above)

5310 commented

We can automate the "WiFi trick" for the time being with a pre-launch script of some sort, I hope. Trying out this solution later: https://superuser.com/a/1824000

I just use this as launch parameters. Internet is cut systemwide but it works
nmcli n off ; %command% & sleep 15 ; nmcli n on

export WINEDEBUG=-all

I already tried that, both in the .bashrc file (after sourcing it of course) and as launch parameters for the game.

All to no avail

Oh! It seems as though I had to fully restart my system for it to actually apply.
The syslog thing is solved then, thanks.

@DvidPiDev spam of fixme:sync:NtCreateTransaction in logs - happening only when you have 100% CPU usage bug.

When you launching game with no internet and see "error" message - you should not have any "log spam" - I mean if you had log spam - you did not make this "fix" work correctly.

the nmcli command works well to mitigate the 100% CPU usage, but the game logs me out of my account every time I launch, is there anything I'm missing? or maybe another workaround?

@GMrlsN maybe you click error message when have no internet?

I launched game for last days with "no internet" - then saw error message - I did not click anything - turn on internet - click on "ingame message" when had internet - it auto login, no relog required.

@GMrlsN try reducing "sleep 15" to "sleep 10" or play with different values, 15 is not a hard number

Thanks for your help! I found that a 5 works well. I also encountered another issue: Steam couldn't close the game from its menu, so I adjusted the parameters. If anyone else faces the same problem, this worked for me:
nmcli n off ; %command% & pid=$! && sleep 5 ; nmcli n on && wait $pid

is do we launch the launcher or the game directly?

also it is probably possible to use firejail to limit bandwidth to next to nothing, which could probably cause a timeout without being disruptive to anything else. I have yet to try this but it's something like this.

you may need to use --noprofile

firejail --name=limnet --net=eth0 STARTUPCMD
firejail --bandwidth=limnet set eth0 1 1
<wait for timeout>
firejail --bandwidth=limnet set eth0 10000 10000

EDIT: confirmed that firejail method works, so no need to use nmcli if you have firejail working.

5310 commented

That's great news. Nmcli breaks my Tailscale Exits unkess I restart the services, I'd live to use to Firejail!

(I only launch AAGL to update, and run the game directly through Steam to play. Still got the issue though.)