[0.17.5] huge about 10 second lag every few minutes fps and ups drops to around 30 then goes back up

Bugs that we were not able to reproduce, and/or are waiting for more detailed info.
factoriouzr
Filter Inserter
Filter Inserter
Posts: 685
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

Post by factoriouzr »

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.
User avatar
TruePikachu
Filter Inserter
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

Post by TruePikachu »

Currently, 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. If anyone else is encountering this, and their system isn't below minimum requirements, we need actual information from the game that can be used to track down the issue; right now, just saying "me too" doesn't help with anything at all.

EDIT: Retracted, see below.
Last edited by TruePikachu on Mon Mar 18, 2019 4:04 pm, edited 1 time in total.
posila
Factorio Staff
Factorio Staff
Posts: 5349
Joined: Thu Jun 11, 2015 1:35 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

Post by posila »

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?
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.
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.
luc3k
Burner Inserter
Burner Inserter
Posts: 10
Joined: Wed Mar 06, 2019 6:58 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

Post by luc3k »

@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
Attachments
factorio_2019-03-18_17-24-57.jpg
factorio_2019-03-18_17-24-57.jpg (778.41 KiB) Viewed 3816 times
factorio_2019-03-18_17-23-28.jpg
factorio_2019-03-18_17-23-28.jpg (776.13 KiB) Viewed 3816 times
luc3k
Burner Inserter
Burner Inserter
Posts: 10
Joined: Wed Mar 06, 2019 6:58 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

Post by luc3k »

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
Attachments
factorio_2019-03-18_17-46-33.jpg
factorio_2019-03-18_17-46-33.jpg (785.68 KiB) Viewed 3810 times
User avatar
TruePikachu
Filter Inserter
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

Post by TruePikachu »

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:

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
@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.
luc3k
Burner Inserter
Burner Inserter
Posts: 10
Joined: Wed Mar 06, 2019 6:58 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

Post by luc3k »

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.
posila
Factorio Staff
Factorio Staff
Posts: 5349
Joined: Thu Jun 11, 2015 1:35 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

Post by posila »

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.
In short, the value is fed into BufferDesc field of DXGI_SWAP_CHAIN_DESC when creating swap chain.
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.
User avatar
TruePikachu
Filter Inserter
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

Post by TruePikachu »

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).
factoriouzr
Filter Inserter
Filter Inserter
Posts: 685
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

Post by factoriouzr »

I'm running on Windows 7 64 bit and get the same issues
User avatar
TruePikachu
Filter Inserter
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

Post by TruePikachu »

factoriouzr wrote: Mon Mar 18, 2019 7:51 pm I'm running on Windows 7 64 bit and get the same issues
Aero theme or Classic theme?
denebarry
Burner Inserter
Burner Inserter
Posts: 13
Joined: Sun Mar 13, 2016 5:04 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

Post by denebarry »

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?
To send to bug report.zip
(4.64 MiB) Downloaded 114 times
factoriouzr
Filter Inserter
Filter Inserter
Posts: 685
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

Post by factoriouzr »

TruePikachu wrote: Mon Mar 18, 2019 8:12 pm
factoriouzr wrote: Mon Mar 18, 2019 7:51 pm I'm running on Windows 7 64 bit and get the same issues
Aero theme or Classic theme?
Aero (ie transparency one). Again my system didn't change nor did my settings and 0.16 worked perfectly.
denebarry
Burner Inserter
Burner Inserter
Posts: 13
Joined: Sun Mar 13, 2016 5:04 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

Post by denebarry »

Disabling 'wait for v-sync' seems to have fixed the problem for me. Can someone explain why & am I losing something. Seems smooth.
User avatar
TruePikachu
Filter Inserter
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

Post by TruePikachu »

(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):
  1. Download UIforETW
  2. Run UIforETW (which will install the Windows Performance Toolkit, as needed)
  3. Configure the trace:
    trace_config.png
    trace_config.png (7.54 KiB) Viewed 3740 times
    IMPORTANT: Do not compress the trace through this checkbox
  4. (Optional, but recommended) Under "Settings...", uncheck the "Auto view traces" box
  5. Start Factorio, and enter the game (note that we haven't started tracing yet)
  6. 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.
  7. When the major lag starts happening, press Ctrl+WinKey+C to save the most recent GPU activity to disk
  8. Stop tracing (by clicking on the button in UIforETW)
  9. In the list of traces, right-click and click "Browse folder"
  10. 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
A few important notes to make:
  • 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.
Do not feel obligated to provide or even record an ETW trace; if you don't feel like you're able to do so, I'd recommend you don't. This procedure is mainly for those people experiencing this bug who want to help in whatever way they possibly can.
Last edited by TruePikachu on Mon Mar 18, 2019 10:01 pm, edited 1 time in total.
luc3k
Burner Inserter
Burner Inserter
Posts: 10
Joined: Wed Mar 06, 2019 6:58 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

Post by luc3k »

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
factoriouzr
Filter Inserter
Filter Inserter
Posts: 685
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

Post by factoriouzr »

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.
posila
Factorio Staff
Factorio Staff
Posts: 5349
Joined: Thu Jun 11, 2015 1:35 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

Post by posila »

denebarry wrote: Mon Mar 18, 2019 8:53 pm Disabling 'wait for v-sync' seems to have fixed the problem for me. Can someone explain why & am I losing something. Seems smooth.
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.
User avatar
TruePikachu
Filter Inserter
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

Post by TruePikachu »

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.
User avatar
TruePikachu
Filter Inserter
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

Post by TruePikachu »

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.
Post Reply

Return to “Pending”