[0.17.52] CPU pegged and high lag even on menu screen
[0.17.52] CPU pegged and high lag even on menu screen
On my Linux desktop system (12 CPU, 64G memory), 0.16 always ran fine. I was finally able to install the update yesterday, but the game is extremely laggy and pegs the CPU even on the initial menu screen. Mousing over the buttons takes almost a second for the button highlight to change to the new one. It takes 1-3 seconds after clicking a button to move onto the next screen.
Running top before starting, the system is idle and load is down below 0.1. Once I start Factorio, it pegs the CPU and stays there.
I then went back and started my 0.16 install, and it still works fine. So, it should not be that something else on the system is eating resources. 0.16 still runs fine, on 0.17 the lag makes the game unplayable and menus almost unusable.
My Linux laptop (8 CPU, 16G) works fine for both 0.16 and 0.17. On starting 0.17, the CPU is pegged until shortly after the menu screen. I don't see any lag issues and was able to play several hours yesterday.
I have attached logs from both my laptop and desktop for comparison. The "install" should be identical on both systems, as I used rsync to copy the install from the desktop to the laptop.
Running top before starting, the system is idle and load is down below 0.1. Once I start Factorio, it pegs the CPU and stays there.
I then went back and started my 0.16 install, and it still works fine. So, it should not be that something else on the system is eating resources. 0.16 still runs fine, on 0.17 the lag makes the game unplayable and menus almost unusable.
My Linux laptop (8 CPU, 16G) works fine for both 0.16 and 0.17. On starting 0.17, the CPU is pegged until shortly after the menu screen. I don't see any lag issues and was able to play several hours yesterday.
I have attached logs from both my laptop and desktop for comparison. The "install" should be identical on both systems, as I used rsync to copy the install from the desktop to the laptop.
- Attachments
-
- factorio-laptop.log
- (4.34 KiB) Downloaded 169 times
-
- factorio-desktop.log
- (3.99 KiB) Downloaded 156 times
- LinearJ
Re: [0.17.52] CPU pegged and high lag even on menu screen
Code: Select all
0.323 [0]: 0 - {[0,0], 2560x1440, SDL_PIXELFORMAT_RGB888, 0Hz}
0.323 [1]: 1 - {[0,1440], 2560x1440, SDL_PIXELFORMAT_RGB888, 0Hz}
0.323 [2]: 2 - {[2560,0], 2560x1440, SDL_PIXELFORMAT_RGB888, 0Hz}
0.323 [3]: 3 - {[2560,1440], 2560x1440, SDL_PIXELFORMAT_RGB888, 0Hz}
Re: [0.17.52] CPU pegged and high lag even on menu screen
Do you mean turn off "Wait for VSync" ?
If so, unfortunately, it did not. I started the game, went to settings->graphics, unchecked "Wait for VSync", clicked Confirm, Back, and then Exit. I then restarted the game. Still has the same lag. Checked the setting and verified it was indeed off.
Updated log attached.
If so, unfortunately, it did not. I started the game, went to settings->graphics, unchecked "Wait for VSync", clicked Confirm, Back, and then Exit. I then restarted the game. Still has the same lag. Checked the setting and verified it was indeed off.
Updated log attached.
- Attachments
-
- factorio-desktop-noWaitForVSync.log
- (3.99 KiB) Downloaded 157 times
- LinearJ
Re: [0.17.52] CPU pegged and high lag even on menu screen
Oh, and before you ask, "lspci -v" of video cards attached.
- Attachments
-
- videocards.txt
- (2.24 KiB) Downloaded 167 times
- LinearJ
Re: [0.17.52] CPU pegged and high lag even on menu screen
Been messing with it. Tested a hypothesis: on my laptop, CPU is pegged on startup, but shortly after it reaches menu screen, it drops down to zero. I figured, maybe something is just taking longer on the desktop.
So, started it on desktop and letting it run while watching CPU. Been running almost 15m and still sitting at around 105% CPU utilitzation for the factorio process.
So, started it on desktop and letting it run while watching CPU. Been running almost 15m and still sitting at around 105% CPU utilitzation for the factorio process.
- LinearJ
Re: [0.17.52] CPU pegged and high lag even on menu screen
Can you attach strace to the process and share some of the output?
Re: [0.17.52] CPU pegged and high lag even on menu screen
Below, repeating. The sched_yield line repeats several dozen times, followed by the rest.
sched_yield() = 0
getpid() = 28704
getpid() = 28704
getpid() = 28704
getpid() = 28704
getpid() = 28704
getpid() = 28704
clock_gettime(CLOCK_MONOTONIC, {tv_sec=96405, tv_nsec=348874247}) = 0
clock_gettime(CLOCK_MONOTONIC, {tv_sec=96405, tv_nsec=348903347}) = 0
clock_gettime(CLOCK_MONOTONIC, {tv_sec=96405, tv_nsec=348925664}) = 0
sched_yield() = 0
sched_yield() = 0
clock_gettime(CLOCK_MONOTONIC, {tv_sec=96405, tv_nsec=348994492}) = 0
sched_yield() = 0
sched_yield() = 0
recvmsg(8, {msg_namelen=0}, 0) = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=8, events=POLLIN|POLLPRI}], 1, 0) = 0 (Timeout)
futex(0x7ffc49de012c, FUTEX_CMP_REQUEUE_PRIVATE, 1, 2147483647, 0x7ffc49de00e0, 23194) = 1
futex(0x7ffc49de00e0, FUTEX_WAKE_PRIVATE, 1) = 1
sched_yield() = 0
getpid() = 28704
getpid() = 28704
getpid() = 28704
getpid() = 28704
getpid() = 28704
getpid() = 28704
clock_gettime(CLOCK_MONOTONIC, {tv_sec=96405, tv_nsec=348874247}) = 0
clock_gettime(CLOCK_MONOTONIC, {tv_sec=96405, tv_nsec=348903347}) = 0
clock_gettime(CLOCK_MONOTONIC, {tv_sec=96405, tv_nsec=348925664}) = 0
sched_yield() = 0
sched_yield() = 0
clock_gettime(CLOCK_MONOTONIC, {tv_sec=96405, tv_nsec=348994492}) = 0
sched_yield() = 0
sched_yield() = 0
recvmsg(8, {msg_namelen=0}, 0) = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=8, events=POLLIN|POLLPRI}], 1, 0) = 0 (Timeout)
futex(0x7ffc49de012c, FUTEX_CMP_REQUEUE_PRIVATE, 1, 2147483647, 0x7ffc49de00e0, 23194) = 1
futex(0x7ffc49de00e0, FUTEX_WAKE_PRIVATE, 1) = 1
- LinearJ
Re: [0.17.52] CPU pegged and high lag even on menu screen
Could you run the game under perf and send me the result files, perf.data and perf.data.tar.bz2?
The first command will run Factorio under perf – I'd like you to let it load to the main menu and then simply close the game after a few seconds. (It will wait for 20 seconds before collecting samples, and your log indicates that your desktop can load the game in 17 seconds, so that should be about right. Idea is to collect samples from the laggy menu and not from startup. You can tweak the value of the -D flag if you feel other delay would be more apropriate.)
Second command will create an archive with object files necessary to analyse the first file on another computer. perf.data and perf.data.tar.bz2 should be around 70 MB each, depending on how long you leave the game running.
Code: Select all
perf record -D20000 --call-graph dwarf path/to/factorio
perf archive perf.data
Second command will create an archive with object files necessary to analyse the first file on another computer. perf.data and perf.data.tar.bz2 should be around 70 MB each, depending on how long you leave the game running.
Re: [0.17.52] CPU pegged and high lag even on menu screen
Attached.
- Attachments
-
- perf.data.tar.bz2
- (13.26 MiB) Downloaded 141 times
- LinearJ
Re: [0.17.52] CPU pegged and high lag even on menu screen
Thanks, can I also have the perf.data file?
Re: [0.17.52] CPU pegged and high lag even on menu screen
Ah. Didn't realize that didn't get included.
Just looking at the file, and we have a problem. There is a lot of sensitive data in that file. It seems to have included environment variables, .e.g., which I cannot publish.
I may need to try and set up a controlled environment to run this again. That will take some time, unfortunately.
Just looking at the file, and we have a problem. There is a lot of sensitive data in that file. It seems to have included environment variables, .e.g., which I cannot publish.
I may need to try and set up a controlled environment to run this again. That will take some time, unfortunately.
- LinearJ
Re: [0.17.52] CPU pegged and high lag even on menu screen
Tried a Q&D way to do this, and that seems to have helped. I am concerned, however, about what I am not seeing.
Is there a way I can xfer this file more securely? E.g., something more direct to you or perhaps if you share a GPG public key I can use to encrypt it...
Is there a way I can xfer this file more securely? E.g., something more direct to you or perhaps if you share a GPG public key I can use to encrypt it...
- LinearJ
Re: [0.17.52] CPU pegged and high lag even on menu screen
Upload it to Google Drive and PM a private link.
Re: [0.17.52] CPU pegged and high lag even on menu screen
Never done that before. Will have to google how to upload to google drive . Will let you know...
- LinearJ
Re: [0.17.52] CPU pegged and high lag even on menu screen
Uploaded to google drive and PM'ed link. My first PM in the forums; it shows in my Outbox instead of Sent Messages, so not sure if it was "sent" or not...
- LinearJ
Re: [0.17.52] CPU pegged and high lag even on menu screen
Yep, I received the files just fine, thanks. I'll see if I can figure anything out from it.
Re: [0.17.52] CPU pegged and high lag even on menu screen
Many thanks; I am going to delete it from GD, now.
Let me know if there is anything further I can do to help!
Let me know if there is anything further I can do to help!
- LinearJ
Re: [0.17.52] CPU pegged and high lag even on menu screen
Unfortunately, I don't see anything particularly relevant in that either. You're using an NVidia card – did you change any settings of the NVidia driver? Anything NVidia-related in xorg.conf(.d), environment variables, or did you change anything inside nvidia-settings? You could also try unplugging all but one of your monitors, maybe the quad-screen setup is too much for something to handle.
Since you are the only person reporting this, I'm inclined to call this an undetermined issue with your setup, with the graphics driver high on the suspect list.
Since you are the only person reporting this, I'm inclined to call this an undetermined issue with your setup, with the graphics driver high on the suspect list.
Re: [0.17.52] CPU pegged and high lag even on menu screen
No special settings. Specifically, no changes between runs. More explicitly:
Run Factorio 0.16. Runs fine. Plays fine.
Run Factorio 0.17.52. 100% CPU and lag.
Run Factorio 0.16. Runs fine. Plays fine.
No changes or reboots or anything between the above three steps.
Same three steps on my laptop produce playable runs each time.
Big difference appears to be how Factorio is seeing the monitors:
0.16:
0.203 Available display adapters: 1
0.203 [0]: resolution 5120x2880px at [0,0]
0.17:
0.385 Available displays: 4
0.385 [0]: 0 - {[0,0], 2560x1440, SDL_PIXELFORMAT_RGB888, 0Hz}
0.385 [1]: 1 - {[0,1440], 2560x1440, SDL_PIXELFORMAT_RGB888, 0Hz}
0.385 [2]: 2 - {[2560,0], 2560x1440, SDL_PIXELFORMAT_RGB888, 0Hz}
0.385 [3]: 3 - {[2560,1440], 2560x1440, SDL_PIXELFORMAT_RGB888, 0Hz}
So, 0.17 is querying the hardware differently. Assuming we have success reports from other multi-monitor Linux users, then it could be particular to my hw. It appears at least that Factorio is not querying the vsync refresh rate properly, as it is getting 0Hz. I am betting that this zero is causing it to spin in a loop somewhere in the code.
Unplugging monitors is painful. It takes forever to get X/nvidia to agree on where to place them again, even if I save the Xorg.conf.
Run Factorio 0.16. Runs fine. Plays fine.
Run Factorio 0.17.52. 100% CPU and lag.
Run Factorio 0.16. Runs fine. Plays fine.
No changes or reboots or anything between the above three steps.
Same three steps on my laptop produce playable runs each time.
Big difference appears to be how Factorio is seeing the monitors:
0.16:
0.203 Available display adapters: 1
0.203 [0]: resolution 5120x2880px at [0,0]
0.17:
0.385 Available displays: 4
0.385 [0]: 0 - {[0,0], 2560x1440, SDL_PIXELFORMAT_RGB888, 0Hz}
0.385 [1]: 1 - {[0,1440], 2560x1440, SDL_PIXELFORMAT_RGB888, 0Hz}
0.385 [2]: 2 - {[2560,0], 2560x1440, SDL_PIXELFORMAT_RGB888, 0Hz}
0.385 [3]: 3 - {[2560,1440], 2560x1440, SDL_PIXELFORMAT_RGB888, 0Hz}
So, 0.17 is querying the hardware differently. Assuming we have success reports from other multi-monitor Linux users, then it could be particular to my hw. It appears at least that Factorio is not querying the vsync refresh rate properly, as it is getting 0Hz. I am betting that this zero is causing it to spin in a loop somewhere in the code.
Unplugging monitors is painful. It takes forever to get X/nvidia to agree on where to place them again, even if I save the Xorg.conf.
- LinearJ