[0.17.5] huge about 10 second lag every few minutes fps and ups drops to around 30 then goes back up
-
- Filter Inserter
- Posts: 689
- Joined: Sat Jun 06, 2015 2:23 am
- Contact:
Re: [0.17.5] huge about 10 second lag every few minutes fps and ups drops to around 30 then goes back up
I am also running in windowed mode and the slowdown was very frequent and regular for me, as the other reported. It seems to get worse over time. It used to be every few minutes then with longer play time it's much more frequent like every minute.
- TruePikachu
- Filter Inserter
- Posts: 978
- Joined: Sat Apr 09, 2016 8:39 pm
- Contact:
Re: [0.17.5] huge about 10 second lag every few minutes fps and ups drops to around 30 then goes back up
EDIT: Retracted, see below.
Last edited by TruePikachu on Mon Mar 18, 2019 4:04 pm, edited 1 time in total.
Re: [0.17.5] huge about 10 second lag every few minutes fps and ups drops to around 30 then goes back up
Hello, for 0.17.15 I've added to debug dialog a checkbox "capture-perf-stats" and button to save per-frame performance statistics, so that will hopefully give us better data to analyze this. There are some config.ini options that I wonder if they would make any difference. Specifically setting dxgi-presentation-mode to flip, and setting dxgi-swap-chain-buffer-count to 2 or 3. (You must remove ; at the beggining of the line you are changing, otherwise the change will be ignored)
@luc3k: I assume your computer is a laptop - does the issue happen only when you run on battery or also of power brick is plugged in? What about surface it is on? Do you always play on a desk?
@luc3k: I assume your computer is a laptop - does the issue happen only when you run on battery or also of power brick is plugged in? What about surface it is on? Do you always play on a desk?
This was just based on Rseding misreading the log. The luck3k's laptop is quite good. And even Intel HD 630 is more powerfull than lot of dedicated DX10 class and some DX11 class GPUs with 1 GB of VRAM.TruePikachu wrote: ↑Mon Mar 18, 2019 3:34 pmCurrently, we only have log files and screenshots of the time breakdown from luc3k; their issue appears to be caused by running the game on a system that's below minimum requirements, which would be considered NaB.
Re: [0.17.5] huge about 10 second lag every few minutes fps and ups drops to around 30 then goes back up
@posila I am always running this plugged in when gaming. I didnt play ever without cable. In that case I am not sure if my dedicated card will be switched off completely. I can test this if you need.
Let's say I am playing 50% on my desk (some cheap wood), other 50% on my legs (pillow under it). Mentioned Witcher 3 (this one 90% on desk because laptop is really hot).
So my another test game:
Some notes: Flip[on] is around 2-3 minutes really low and then around 10, then again really low, then back to around 10. No issue with FPS for me during that testing (around 10 minutes). I cant test longer for now. I have everything about this in mind so if I will have more time I will do longer session (maybe on that 0.17.15 with new debug options).
Save:
https://www.dropbox.com/s/6n5o4o20cnb35 ... e.zip?dl=0
log:
https://www.dropbox.com/s/8869bbh58zilq ... t.log?dl=0
config:
https://www.dropbox.com/s/1gd1jo1lenvsp ... g.ini?dl=0
Settings that I changed/uncommented:
dxgi-presentation-model=flip
dxgi-swap-chain-buffer-count=2
Edit:
Wait for VSync is on in that setup.
But my opinion is that these 2 settings fixed something too, there is flip on change as on screenshot but I have constant 60/60
Let's say I am playing 50% on my desk (some cheap wood), other 50% on my legs (pillow under it). Mentioned Witcher 3 (this one 90% on desk because laptop is really hot).
So my another test game:
Some notes: Flip[on] is around 2-3 minutes really low and then around 10, then again really low, then back to around 10. No issue with FPS for me during that testing (around 10 minutes). I cant test longer for now. I have everything about this in mind so if I will have more time I will do longer session (maybe on that 0.17.15 with new debug options).
Save:
https://www.dropbox.com/s/6n5o4o20cnb35 ... e.zip?dl=0
log:
https://www.dropbox.com/s/8869bbh58zilq ... t.log?dl=0
config:
https://www.dropbox.com/s/1gd1jo1lenvsp ... g.ini?dl=0
Settings that I changed/uncommented:
dxgi-presentation-model=flip
dxgi-swap-chain-buffer-count=2
Edit:
Wait for VSync is on in that setup.
But my opinion is that these 2 settings fixed something too, there is flip on change as on screenshot but I have constant 60/60
- Attachments
-
- factorio_2019-03-18_17-24-57.jpg (778.41 KiB) Viewed 3838 times
-
- factorio_2019-03-18_17-23-28.jpg (776.13 KiB) Viewed 3838 times
Re: [0.17.5] huge about 10 second lag every few minutes fps and ups drops to around 30 then goes back up
In another short session with that setup:
Full screen, Wait for VSync set to "on", default config; I was not able to reproduce this.
log from that session: (save is the creative_mode):
https://www.dropbox.com/s/jkcle4ny422ls ... t.log?dl=0
Full screen, Wait for VSync set to "on", default config; I was not able to reproduce this.
log from that session: (save is the creative_mode):
https://www.dropbox.com/s/jkcle4ny422ls ... t.log?dl=0
- Attachments
-
- factorio_2019-03-18_17-46-33.jpg (785.68 KiB) Viewed 3832 times
- TruePikachu
- Filter Inserter
- Posts: 978
- Joined: Sat Apr 09, 2016 8:39 pm
- Contact:
Re: [0.17.5] huge about 10 second lag every few minutes fps and ups drops to around 30 then goes back up
On the topic of portable systems, while my computer doesn't have switching graphics, issues can potentially arise if the system either (a) had entered sleep mode or hibernation since the last clean boot or (b) is exceeding thermal limits. On the topic of (b), I strongly suggest getting at least some kind of external fan, as well as making sure to clean the airflow on occasion, if only to prevent hardware damage.
Luckily, however, the game appears to be using the correct graphics, but depending on how they're implemented, take that with a grain of salt:
@posila, does the config setting for the buffer count include the frontbuffer or not? (This is controlled by a flag when creating the chain, IIRC.) If it does, the maximum frame latency might also need to be adjusted to avoid the issue described in this article, which could contribute to the issue.
Luckily, however, the game appears to be using the correct graphics, but depending on how they're implemented, take that with a grain of salt:
Code: Select all
0.012 Available displays: 1
0.012 [0]: \\.\DISPLAY1 - Intel(R) UHD Graphics 630 {0x05, [0,0], 1920x1080, 32bit, 60Hz}
0.235 [Direct3D11] Display: 0, Output: 0, DisplayAdapter: 0, RenderingAdapter: 0; d3dcompiler_47.dll
1.068 Initialised Direct3D[0]: NVIDIA GeForce GTX 1050 Ti with Max-Q Design; id: 10de-1c8f; driver: nvldumdx.dll 24.21.13.9921
1.068 D3D Feature Level: 11.1, DXGI 1.5+, SwapChain: 2,flip-sequential,-,-
1.068 [Local Video Memory] Budget: 3417MB, CurrentUsage: 1MB, Reservation: 0/1809MB
1.068 [Non-Local Vid.Mem.] Budget: 3616MB, CurrentUsage: 0MB, Reservation: 0/1908MB
1.068 Tiled resources: Tier 2
1.068 Unified Memory Architecture: No
1.068 BGR 565 Supported: Yes
1.068 MaximumFrameLatency: 3, GPUThreadPriority: 0
Re: [0.17.5] huge about 10 second lag every few minutes fps and ups drops to around 30 then goes back up
So that laptop is sort of new (6 months old). I am trying to keep it clean etc. I do not have this only for gaming or I am not rich so I am trying to do my best to keep it as long as possible (previous one was used for 6 years and it is still ok).
So this laptop is 99% of time plugged in. Last time I plugged it off maybe 1 month ago. It is running on included setup to keep battery living longer. So it is not always on 100%, after few days it simply drops for example to 92%.
I can add about sleep/hibernation also: I am turning it off mostly when I am rebooting it or going out for few days and I do not need it with me. So basically it is almost always in sleep mode when it is closed. So In my case it was in more than 1 sleep mode from last clean boot. But it doesnt make any problems for other things I do on that machine, including gaming.
So this laptop is 99% of time plugged in. Last time I plugged it off maybe 1 month ago. It is running on included setup to keep battery living longer. So it is not always on 100%, after few days it simply drops for example to 92%.
I can add about sleep/hibernation also: I am turning it off mostly when I am rebooting it or going out for few days and I do not need it with me. So basically it is almost always in sleep mode when it is closed. So In my case it was in more than 1 sleep mode from last clean boot. But it doesnt make any problems for other things I do on that machine, including gaming.
Re: [0.17.5] huge about 10 second lag every few minutes fps and ups drops to around 30 then goes back up
In short, the value is fed into BufferDesc field of DXGI_SWAP_CHAIN_DESC when creating swap chain.TruePikachu wrote: ↑Mon Mar 18, 2019 6:25 pm@posila, does the config setting for the buffer count include the frontbuffer or not? (This is controlled by a flag when creating the chain, IIRC.) If it does, the maximum frame latency might also need to be adjusted to avoid the issue described in this article, which could contribute to the issue.
Longer answer is, it depends. Since we are always running in windowed mode, it is without front-buffer, because frontbuffer is the desktop - that is at least if DWM is enabled. I don't know if there is implicit frontbuffer with desktop composition disabled. BUT, if flip presentation model is used, then there is no implicit frontbuffer. When dxgi-swap-chain-count in the config is set to zero (default), the game will set minimum count appropriate for current presentation model.
- TruePikachu
- Filter Inserter
- Posts: 978
- Joined: Sat Apr 09, 2016 8:39 pm
- Contact:
Re: [0.17.5] huge about 10 second lag every few minutes fps and ups drops to around 30 then goes back up
This is Win10 we're considering right now, so DWM is present. The question I brought up is if `dxgi-max-frame-latency` would also need to be adjusted; it defaults to three (well, the configuration defaults to zero, which is interpreted as three); the actual setting controls the length of the presentation queue, and how many calls to Present() can be made before it blocks. The main reason why I'm bringing it up is that if you have a number of buffers equal to the maximum frame latency, the render cycle can potentially get caught in a state where it continuously runs at a reduced framerate until a quick-enough-to-render frame comes around (see the blog post I linked above).
-
- Filter Inserter
- Posts: 689
- Joined: Sat Jun 06, 2015 2:23 am
- Contact:
Re: [0.17.5] huge about 10 second lag every few minutes fps and ups drops to around 30 then goes back up
I'm running on Windows 7 64 bit and get the same issues
- TruePikachu
- Filter Inserter
- Posts: 978
- Joined: Sat Apr 09, 2016 8:39 pm
- Contact:
Re: [0.17.5] huge about 10 second lag every few minutes fps and ups drops to around 30 then goes back up
Aero theme or Classic theme?factoriouzr wrote: ↑Mon Mar 18, 2019 7:51 pm I'm running on Windows 7 64 bit and get the same issues
Re: [0.17.5] huge about 10 second lag every few minutes fps and ups drops to around 30 then goes back up
Just started a new game, no mods & exactly the same thing right from the start. Files attached if anyone wants to give it a go.
There are references to both graphics systems in the log. How do I know what is doing the work?
There are references to both graphics systems in the log. How do I know what is doing the work?
-
- Filter Inserter
- Posts: 689
- Joined: Sat Jun 06, 2015 2:23 am
- Contact:
Re: [0.17.5] huge about 10 second lag every few minutes fps and ups drops to around 30 then goes back up
Aero (ie transparency one). Again my system didn't change nor did my settings and 0.16 worked perfectly.TruePikachu wrote: ↑Mon Mar 18, 2019 8:12 pmAero theme or Classic theme?factoriouzr wrote: ↑Mon Mar 18, 2019 7:51 pm I'm running on Windows 7 64 bit and get the same issues
Re: [0.17.5] huge about 10 second lag every few minutes fps and ups drops to around 30 then goes back up
Disabling 'wait for v-sync' seems to have fixed the problem for me. Can someone explain why & am I losing something. Seems smooth.
- TruePikachu
- Filter Inserter
- Posts: 978
- Joined: Sat Apr 09, 2016 8:39 pm
- Contact:
Re: [0.17.5] huge about 10 second lag every few minutes fps and ups drops to around 30 then goes back up
(I'm currently working on assembling instructions for factoriouzr to create an ETW trace I can check, so we can see what the GPU is up to)
EDIT:
The gist of the procedure is to (please read my entire message before starting with these steps):
EDIT:
The gist of the procedure is to (please read my entire message before starting with these steps):
- Download UIforETW
- Run UIforETW (which will install the Windows Performance Toolkit, as needed)
- Configure the trace:IMPORTANT: Do not compress the trace through this checkbox
- (Optional, but recommended) Under "Settings...", uncheck the "Auto view traces" box
- Start Factorio, and enter the game (note that we haven't started tracing yet)
- Start tracing (this can be done with either Ctrl+WinKey+C or by clicking the button in UIforETW). Things might slow down a bit (hopefully not as much as in the bug!), this is normal.
- When the major lag starts happening, press Ctrl+WinKey+C to save the most recent GPU activity to disk
- Stop tracing (by clicking on the button in UIforETW)
- In the list of traces, right-click and click "Browse folder"
- Compress the trace (zip/7z/rar/etc.), upload it somewhere (usually Dropbox or similar, but it might compress small enough to be uploaded here), and link to it here
- It is recommended not to have any files containing sensitive information open during this kind of procedure.
- As part of this procedure, the Windows Performance Toolkit might be installed. It can be uninstalled later, if you so choose.
- You might wish to reboot your computer after performing these steps; I tend to notice degraded GPU performance even after stopping the trace, so it's possible some part of the Windows kernel is still monitoring GPU activity.
- Trace compression (via the checkbox in UIforETW) is only supported in Windows 8 and later; if you want me to be able to check your trace, it must be unchecked.
Last edited by TruePikachu on Mon Mar 18, 2019 10:01 pm, edited 1 time in total.
Re: [0.17.5] huge about 10 second lag every few minutes fps and ups drops to around 30 then goes back up
Perf files from 0.17.15
This one is from the moment when it was 30/60 This one is when it was back to 60/60
This one is from the moment when it was 30/60 This one is when it was back to 60/60
-
- Filter Inserter
- Posts: 689
- Joined: Sat Jun 06, 2015 2:23 am
- Contact:
Re: [0.17.5] huge about 10 second lag every few minutes fps and ups drops to around 30 then goes back up
I tested to make sure I still get the issue in 0.17.15 first which I do, then I tried disabling vsync in options and restarted (game didn't force me to but just to make sure it was a proper test) and in a short play session (this is not conclusive) but I would usually have gotten the issue already and I didn't yet. It looks like disabling vsync might have fixed the issue same as another user reported.
Obviously I should be able to have vsync enabled and I want to turn it back on, but this should give you guys more information to fix the issue. Hope it helps.
Obviously I should be able to have vsync enabled and I want to turn it back on, but this should give you guys more information to fix the issue. Hope it helps.
Re: [0.17.5] huge about 10 second lag every few minutes fps and ups drops to around 30 then goes back up
You shouldn't lose anything, keep it disabled if it fixes the issue for you.
@luck3k: Thanks for sending the perf dumps even before I had chance to ask for them, I'll analyze them today.
@TruePikatchu: Thanks for the link, it helped to clarify some things for me. I have created separate thread for discussing V-sync issues (mainly with you): 68085
@factoriouzr: V-sync can be toggled runtime in 0.17 (unless you run with OpenGL renderer on nVidia GPU). In 0.16 v-sync would be off by default on your PC. Can you please, in game, press F4 to open Debug settings, enable "capture-perf-stats" and keep playing until the issue starts to happen. Then open debug settings again and click "save" button next to the checkbox. Then wait until framerate recovers and save again. Then please upload post the files including factorio-current.log here.
- TruePikachu
- Filter Inserter
- Posts: 978
- Joined: Sat Apr 09, 2016 8:39 pm
- Contact:
Re: [0.17.5] huge about 10 second lag every few minutes fps and ups drops to around 30 then goes back up
I actually just started getting...well, not 10 second lag, but noticable lag, so I just finished recording a pair of ETW traces myself after determining that it wasn't because of Superfetch running.
Something I noticed in the first one, after GPUView failed to be super useful for whatever reason (going to have to diagnose that, might be related to circular buffer recording though), was a mystery process "FlashUtil32_32_0_0_156_Plugin.exe" that existed for a short period of time, around the time of the hiccup, apparently invoked via the task scheduler attempting to update Flash. I just deleted those scheduled tasks, since I literally don't use Flash for anything and thought I removed it...
Factorio did have a quite-high CPU time peak in the second trace, not apparently caused by anything external, so I'm about to trim down the PDB symbols to something that WPA can work with and get some backtraces.
Something I noticed in the first one, after GPUView failed to be super useful for whatever reason (going to have to diagnose that, might be related to circular buffer recording though), was a mystery process "FlashUtil32_32_0_0_156_Plugin.exe" that existed for a short period of time, around the time of the hiccup, apparently invoked via the task scheduler attempting to update Flash. I just deleted those scheduled tasks, since I literally don't use Flash for anything and thought I removed it...
Factorio did have a quite-high CPU time peak in the second trace, not apparently caused by anything external, so I'm about to trim down the PDB symbols to something that WPA can work with and get some backtraces.
- TruePikachu
- Filter Inserter
- Posts: 978
- Joined: Sat Apr 09, 2016 8:39 pm
- Contact:
Re: [0.17.5] huge about 10 second lag every few minutes fps and ups drops to around 30 then goes back up
That lag I saw in the second trace was a false positive (caused by generating a new map), but there was a period where the main loop went to near-zero CPU usage. I can't determine the cause, however, as GPUView is being useless with the trace.