doitsujin / dxvk

Vulkan-based implementation of D3D8, 9, 10 and 11 for Linux / Wine
zlib License
13.16k stars 848 forks source link

Frequent frame time spikes in Assetto Corsa Competizione #1161

Closed jp7677 closed 5 years ago

jp7677 commented 5 years ago

Assetto Corsa Competizione suffers from regular frame times spikes. Sometimes they happen with a regular frequency of 1 or 2 seconds for several seconds long. Sometime the spikes happen close together. The game itself indicate then that CPU usage is above 100%. The game "recovers" from the spikes, but these spikes may start again later during game play. See this screenshot for an example of the frame time graph when this behavior occurs. Screenshot from 2019-08-07 21-28-51 Note that the logging in screenshot stalls during a spike too.

I don't think this behavior is caused by shader compilation or at least not solemnly, it still occurs after lots of "rounds on a track" i.c.w. with a warm state cache. The game runs graphics wise with the exception of the frame time spikes astonishingly well.

Software information

Assetto Corsa Competizione 1.0.7, my settings vary between mid and epic, though I haven't found the setting that seemed to cause this. My impression is that having v-sync enabled seems to make it less worse or "postpone" the spikes, but I'm not that sure. These spikes started with version 1.0 of the game (it was available as Early Access), so a game change introduced these. This behavior is confirmed by at least one other user (https://github.com/ValveSoftware/Proton/issues/1420#issuecomment-497238834). Currently the games uses Unreal Engine 4.22 (that's what a folder name in application data indicates).

Considering this behavior was introduced with a game update this might not be related to DXVK at all.

System information

Apitrace file(s)

Log files

Please let me know if I can assist any further. Last but not least, D(X|9)VK are magic projects, thanks a lot for all the hard work!

jp7677 commented 5 years ago

According to information from Discord the apitrace shows no strange behavior. It doesn't seem that DXVK does anything wrong here. The game is just very CPU intensive, bringing one core during game play to 100% like all the time even with absolutely lowest graphics settings.

Screenshot from 2019-08-15 13-58-08 Note the GPU vs CPU usage in the screenshot. The spikes aren't there everytime. They come and then disappear after a few intervals.

doitsujin commented 5 years ago

Well, this still shouldn't really happen, but the apitrace just doesn't show any suspicious behaviour. It's very possible that running the game through apitrace just hides the cause of these spikes.

Which makes this even more annoying to debug.

jp7677 commented 5 years ago

Actually the in-game replay shot in my mind today. When replaying driving on the track in the game itself, the CPU usage of the busiest core seems around 50%. Spikes that I encountered during actual play, when one core had been constantly at 100% usage, didn't occur during in-game replay. I see a spike or two, but overall the frame times are much much smoother in the in-game replay. I guess that sorts out that DXVK causes the high CPU usage in this game. I can't judge if high CPU pressure could cause DXVK to act differently, but I guess mostly the game itself does something weird which results in the frequent spikes like seen in the screenshots. Would be interesting to know how CPU usage is on Windows... Anyway, the game still gets a lot of updates, hopefully a game update solves this at some point.

Thanks a lot for your time for looking into the trace!

leillo1975 commented 4 years ago

I'm have the same problem like you. I copy/paste the message I left on Proton Issues:

I found that this game has a lot of stuttering, especially in multiplayer games, or when you ride against many cars. In certain moments the games shows a message on the top-left (CPU use > 99%), and the frametimes graph of the DXVK_HUD shows a lot of stutter. I recorded a video to show you this problem: https://youtu.be/cEoahOxIWqc

As you can see in the "htop" window, the the CPU are not at 99% (perhaps 60%). There are a lot of CPU performance lost, and is probably that if the game use the entire CPU, this stutter would be much less. I think that this is not normal.

I made a Blender Benchmark and all the cores were set at 100% in "htop" without problems.

I played 2 multiplayer races on Windows in the same PC without any issues and CPU overload messages. I think that Proton can't use all the CPU in this game. The problem is the same with versions 5.0, 4.11 and 4.2

My CPU is a Intel i7-3770. You can see a GIST of my system here: https://gist.github.com/leillo1975/db654fd0c71ce0baf57c1cca5bef3525

jp7677 commented 4 years ago

Well, as stated in the Proton issue list, I do still see the occasional frame time spike on my machine. but overall it got much better with recent game updates.

leillo1975 commented 4 years ago

As I stated on proton Issue, the strange thing is that the game reports a CPU usage > 99% and the OS only reports less than 60%. It's like if Proton doesn't use the full power of the CPU

jp7677 commented 4 years ago

This mystery has finally been solved. See https://github.com/ValveSoftware/Proton/issues/1420#issuecomment-639084670