4K FPS is really poor

Bugs that we were not able to reproduce, and/or are waiting for more detailed info.
Post Reply
d3x0r
Filter Inserter
Filter Inserter
Posts: 316
Joined: Sun Jun 04, 2017 8:56 am
Contact:

4K FPS is really poor

Post by d3x0r »

Factorio is one of the game I would have figured wouldn't have had a very big loss of performance at 4k; and yet full 3d games all still play at their same frame rate, while Factorio has a huge hit on performance.
Every 3 seconds or so it stutters quite a bit... if I play in a winodw in just slightly less resolution it doesn't have so many issues....

I turned off VSync in case that was the cause... but it's still behaving the same way.

2560x1440 stats
factorio-3kstats.jpg
factorio-3kstats.jpg (106.71 KiB) Viewed 7098 times
3840x1260 stats
factorio4kstats.jpg
factorio4kstats.jpg (129.42 KiB) Viewed 7098 times
Most other games the resolution doesn't seem to matter very much....

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: 4K FPS is really poor

Post by Rseding91 »

Thanks for the report however there's not much we can do. All of the time is spent in flip() which is outside Factorios code and into the drivers of what ever graphics card you're using.

Do you have vsync enabled? If so, try turning that off.
If you want to get ahold of me I'm almost always on Discord.

orzelek
Smart Inserter
Smart Inserter
Posts: 3911
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: 4K FPS is really poor

Post by orzelek »

Can you post your log?
All your times for render are suspiciously high.
So it's either there is a lot on rest of the screen or your GPU is barely managing as is and increase in resolution leading to big increase in amount of pixels to render makes it fall over at some point.

d3x0r
Filter Inserter
Filter Inserter
Posts: 316
Joined: Sun Jun 04, 2017 8:56 am
Contact:

Re: 4K FPS is really poor

Post by d3x0r »

the [off] by the flip status shows vsync status on/off... in those it was off... and on it didn't make much difference it was still the same stuttering...

Another note; I do only have 2GB on my video card; and the system at idle is using about 500MB; and factorio pushes that to basically max. Although a 4k 32 bit buffer is only 33MB ...

Well I thought I'd share anyway, I was hesitant to even mention it.


Re the log; there's not much in the log about rendering. Although I do have quite a few mods loaded with tick events, those aren't really the culprit.

There's this thread from 11 years ago... https://www.opengl.org/discussion_board ... ering-time ... but there's not a lot of help there.
render
glFlush (<- vital to do before sleeping)
sleep
swap

But things like even webgl http://www.fishgl.com/ http://necromanthus.com/Test/html5/testA_disco.html don't care how big the window is... they're all the same rate...
I can see it if you were using something like windows API; bitblt to output.... but then it wouldn't be using graphic memory and sprites :)

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: 4K FPS is really poor

Post by Rseding91 »

Factorio loads all graphic assets into VRAM on startup so it doesn't have to constantly swap them in and out as it renders sprites. Additionally things like the map in-game is a series of VRAM-stored images + different buffers used for rendering.

You can tell the game not to load all of the graphics into VRAM at startup if your system doesn't have enough dedicated VRAM to do so. It just results in reduced performance runtime but if you don't have the VRAM then it's the only way you can play.
If you want to get ahold of me I'm almost always on Discord.

daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: 4K FPS is really poor

Post by daniel34 »

Do you play with high resolution graphics enabled? I think Factorio sets that as default if you have >= 2GB VRAM and >= 8GB RAM, I'm not sure though if that also applies if you play with mods. Try setting the sprite resolution to normal if it isn't already.

If it's a VRAM issue then changing the video memory usage (and enabling/disabling texture compression) could help.

The log file might also help us, it details your system configuration, Factorio graphics settings and mods used.
quick links: log file | graphical issues | wiki

d3x0r
Filter Inserter
Filter Inserter
Posts: 316
Joined: Sun Jun 04, 2017 8:56 am
Contact:

Re: 4K FPS is really poor

Post by d3x0r »

Well... actually when I first ran it after getting my new monitor (43 inch 4k... so like 4 21.5 inch 1920x1080 monitors on one display port connection) my game was setup for low res sprites because I was reloading a lot from mod development. It had the same stuttering. It's purely on the output and not really the input.
right now, starting in windowed mode it (starts in a tiny window) after load it's at 1.535GB used. maximizing in windows mode it goes up to 1.8GB used...


after setting to extra-low graphics(full screen), and reloading it starts at 1.1GB and loading in to the game it's up to 1.5GB and is pretty smooth...
setting normal, full screen on menu it's 1.3GB goes up to 1.7GB after loading the game... and starts to show 57-58 FPS in the same position on the map

high dettail - full screen, on menu 1.5GB, after loading game 1.8-1.9GB, but GPU Used starts to go up to 100%... and frame rate goes down to 42-43 leaving the area of the factory where everything is so there's just some train tracks, trees and bots... goes back up to 60 fps

game render and flip are both high in the dense area of the factory...

These are from gpu-z monitor program....
(high detail) (on this one I didn't notice before there's a perfCap Reason - it is 'vRel, vOp' ...
vRel = Reliability. Indicating perf is limited by reliability voltage.
VOp = Operating. Indicating perf is limited by max operating voltage.
Pwr = Power. Indicating perf is limited by total power limit.
Thrm = Thermal. Indicating perf is limited by temperature limit.
Util = Utilization. Indicating perf is limited by GPU utilization.

Huh; 'She needs more power'
factorio-full-screen-busy-graphs..png
factorio-full-screen-busy-graphs..png (18.45 KiB) Viewed 7063 times
(normal detail)
factorio-normal-detail.png
factorio-normal-detail.png (18.6 KiB) Viewed 7063 times
Does seem odd, that you said 'the graphics are loaded in the beginning' and yet the memory basically doubles once I load a map. But it does seem that the GPU Load (probably mostly in wait because I'm on a threshold of memory) is what's choking it; I hadn't noticed that detail... it seemed to stay just under max memory usage on the card.... but probably it kicks things out before getting to be absolutely full(?)

Threw in a full screenshot of the area I'm standing in (srory I took it when night fell)
but that's basically the active part of the factory; I have a little more, but not a whole lot.
Attachments
fullscreen-4k.jpg
fullscreen-4k.jpg (557.39 KiB) Viewed 7063 times

daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: 4K FPS is really poor

Post by daniel34 »

orzelek wrote:Can you post your log?
daniel34 wrote:The log file might also help us, it details your system configuration, Factorio graphics settings and mods used.
The log file is still missing.

Do you also have these issues when playing purely vanilla without any mods?

EDIT: Is the 4K screen the only monitor you have plugged in?
quick links: log file | graphical issues | wiki

orzelek
Smart Inserter
Smart Inserter
Posts: 3911
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: 4K FPS is really poor

Post by orzelek »

Stats from GPU-Z would point to the fact that your GPU might be running out of fill rate with such a big screen or it starts texture swapping with RAM due to problems with VRAM availability.

I'm not 100% sure but bus interface load could show that there is a lot of transfer from main memory to GPU. It goes pretty high with high res graphics and stays low on normal.

posila
Factorio Staff
Factorio Staff
Posts: 5202
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: 4K FPS is really poor

Post by posila »

Hi, screenshosts of the game with debug timing and GPU-Z are usefull, but Factorio log is vital, as we don't know what HW do you have (you sad 4k screen, and there is GTX 670 on GPU-Z screenshots), and we don't know what kind of settings you play the game on.

Anyway, my advice is to try to lower "Atlas texture size" in graphics options to 8192 or maybe even 4096.

d3x0r
Filter Inserter
Filter Inserter
Posts: 316
Joined: Sun Jun 04, 2017 8:56 am
Contact:

Re: 4K FPS is really poor

Post by d3x0r »

Here's logs. (previous is normal, current is high)
Good luck finding anything to do with rendering in them.
OKay I do see why memory increased after game load... the atlases get mipmapped.


16384*12404 + 16384 * 3388 + 16384*2729 + 8192*1920+8192*800+8192*2940

1 399 259 136 (4 bytes per pixel approx memory required)
185,466,880 (mipmap memory base - probably more than this is required)

normal required
16384*7370+8192*2409+8192*1899+4096*3648+4096*1568+4096*2616
752,484,352

but; then again, it works fine on high settings in not quite 4k...
Attachments
factoriologs.zip
(2.87 MiB) Downloaded 94 times

posila
Factorio Staff
Factorio Staff
Posts: 5202
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: 4K FPS is really poor

Post by posila »

This is quite interesting:

Code: Select all

   0.474     Video memory size (dedicated video/dedicated system/shared system/available): 1990/0/7913/1680 MB
On my system available video memory is larger than dedicated one, I have no idea how that works ... but it seems to work somehow.

Anyway ... additionally to memory allocated by atlases, there are is also bunch of sprites that didn't got put into any atlas (because of video-memory-usage=high).
And when you load the game 3 things happen: memory for map (as in minimap) is allocated, 4 fullscreen buffers + 1 buffer for lights, which depends on light scale setting (in your case 100% - so also fullscreen) are allocated, and things from sprite atlases get to be actually rendered on screen - so graphics driver shuffles them in a way that it thinks is best between VRAM and RAM, if it all can't be fit into VRAM.

My theory was that if we sort sprites into smaller atlases, so that we could do lot of draws from atlas 1, then switch to atlas 2 and do lot of draws again, then switch to another etc. We would give driver more room to optimize VRAM usage, as it wouldn't need to deal with one or two huge atlases, but several smaller ones, while we would keep benefit of batching sprite draws, which is the purpose of having sprite atlas in the first place. I added this atlas separation in middle of 0.15 stabilization, but to my surprise some of the people I expected this would help the most reported decrease in FPS.

So "Create specialized sprite atlases" is another option you can test (together with "Atlas texture size" I mentioned in the previous post).

PS: These are lines in the log that have anything to do with rendering :)

Code: Select all

   0.004 2017-09-27 17:40:40; Factorio 0.15.34 (build 30875, win64, steam)
   0.004 Operating system: Windows 7 Service Pack 1
   0.012 System info: [CPU:        Intel(R) Core(TM) i7-3770K CPU @ 3.50GHz, 8 cores, RAM: 16338MB]
   0.012 Display options: [FullScreen: 1] [VSync: 0] [UIScale: 100%] [MultiSampling: OFF] [Screen: 1] [Lang: en]
   0.013 Available display adapters: 2
   0.013  [0]: \\.\DISPLAY1 - NVIDIA GeForce GTX 670 {0x01, [3840,0], 800x600, 32bit, 60Hz}
   0.013  [1]: \\.\DISPLAY2 - NVIDIA GeForce GTX 670 {0x05, [0,0], 3840x2160, 32bit, 60Hz}
   0.014 Create display on adapter 1. Size 750x550 at position [1535, 787].
   0.458 Initialised Direct3D:[0] NVIDIA GeForce GTX 670; driver: nvd3dumx.dll 22.21.13.8253
   0.474     Video memory size (dedicated video/dedicated system/shared system/available): 1990/0/7913/1680 MB
   0.589 Desktop composition is active.
   0.589 Graphics settings preset: high
   0.590 Graphics options: [Graphics quality: high] [Video memory usage: high] [Light scale: 100%] [DXT: false] [Shader: 1]
   8.469 Loaded shader file C:/games2/steam/steamapps/common/Factorio/data/core/graphics/shaders/game.cso
   8.469 Loaded shader file C:/games2/steam/steamapps/common/Factorio/data/core/graphics/shaders/zoom-to-world.cso
   8.482 Initial atlas bitmap size is 16384
   8.486 Created atlas bitmap 16384x12404
  10.135 Created atlas bitmap 16384x3388
  10.316 Created atlas bitmap 16384x2729
  10.401 Created atlas bitmap 8192x1920
  10.420 Created atlas bitmap 8192x800
  10.428 Created atlas bitmap 8192x2940
  39.223 Sprites loaded
  39.223 Convert atlas 8192x1920 to: mipmap 
  39.536 Convert atlas 8192x800 to: mipmap 
  39.635 Convert atlas 8192x2940 to: trilinear-filtering 

arbarbonif
Fast Inserter
Fast Inserter
Posts: 110
Joined: Fri Jul 01, 2016 2:46 am
Contact:

Re: 4K FPS is really poor

Post by arbarbonif »

Holy cow, I didn't realize turning vsync off mattered that much. I was having the same problem in 4K, and in my last game even on the 1080 monitor (though not as bad). I turn off vsync and the flip went from 13-17 down to .3 and it now runs beautifully in both 4K and not.

Zavian
Smart Inserter
Smart Inserter
Posts: 1641
Joined: Thu Mar 02, 2017 2:57 am
Contact:

Re: 4K FPS is really poor

Post by Zavian »

Vsync is short for "(wait for) vertical synchronisation", ie wait till the monitor is finished displaying the bottom of the frame, and is about to start at the top again. On a typical monitor that happens 60 times per second, so the wait is up to 16.66 milliseconds.

Post Reply

Return to “Pending”