Page 1 of 1

[0.12.17] Minimap causes huge slowdowns on Linux

Posted: Mon Nov 16, 2015 10:06 pm
by Wartorn
Having the minimap enabled causes huge slowdowns making the game near unplayable. The only setting changed in the screenshots below is the "show minimap" checkbox.

With minimap: http://i.imgur.com/Ds1l3Fv.jpg
Without minimap: http://i.imgur.com/WliNT3z.jpg

Running Arch Linux with i3wm. i7 2600k (overclocked), 16GB system ram, GTX780 with 3GB vram and an SSD drive.
This is not related to the multiple monitor issues some are experiencing. I've tried with only 1 connected and the same result applies.
Just as a side note I play other OpenGL games without issue, such as Insurgency at 150-200 FPS with max settings.

Log (removed email and username):
0.000 2015-11-16 22:55:44; Factorio 0.12.17 (Build 17307, linux64)
0.000 Operating system: Linux
0.000 Program arguments: "./factorio"
0.000 Read data path: /home/<private>/factorio/data
0.000 Write data path: /home/<private>/factorio
0.000 Binaries path: /home/<private>/factorio/bin
0.170 Available display adapters: 2
0.170 [0]: resolution 1920x1080px at [0,0]
0.170 [1]: resolution 1920x1080px at [1920,0]
0.170 Create display on adapter 0. Size 1280x720 at position [310, 162]. Monitor 0
0.975 Initialised OpenGL:[0] GeForce GTX 780/PCIe/SSE2; driver: 4.5.0 NVIDIA 355.11
0.997 Graphics options: [FullScreen: false] [VSync: false] [UIScale: 100%] [MultiSampling: OFF] [Graphics quality: normal] [Video memory usage: high] [Light scale: 20%] [Screen: 0]
1.022 Loading mod core 0.0.0 (data.lua)
1.024 Loading mod base 0.12.17 (data.lua)
1.314 Initial atlas bitmap size is 16384
1.316 Created atlas bitmap 16384x5509
39.381 Info Updater.cpp:752: Downloading https://www.factorio.com/updater/get-av ... iVersion=2
40.670 0 packages available to download (experimental updates disabled).
40.692 Factorio initialised
45.446 Loading map /home/<private>/factorio/saves/nik.zip
45.467 Info Scenario.cpp:123: Map version 0.12.17-0
152.566 Goodbye

Re: [0.12.17] Minimap causes huge slowdowns on Linux

Posted: Wed Nov 18, 2015 12:59 pm
by kovarex
This one is tricky. I have no idea why drawing minimap is especially slow on your computer. The obvious thing is to ask you if you have the latest drivers.

Re: [0.12.17] Minimap causes huge slowdowns on Linux

Posted: Wed Nov 18, 2015 1:24 pm
by prg
Wartorn wrote: 0.975 Initialised OpenGL:[0] GeForce GTX 780/PCIe/SSE2; driver: 4.5.0 NVIDIA 355.11
I'm using the same version and I'm seeing no such issue.

Another weird thing is that the initialisation of the game takes 40s, for me it's just 6s (or 12s if crop-cache.dat needs to be regenerated.)

Re: [0.12.17] Minimap causes huge slowdowns on Linux

Posted: Wed Nov 18, 2015 3:22 pm
by Wartorn
I tried running it with sudo. Turns out the game works perfectly if I do. This is not a good solution though. Why would it require root privileges?

http://i.imgur.com/gfqvXZS.jpg


0.000 2015-11-18 16:16:42; Factorio 0.12.17 (Build 17307, linux64)
0.000 Operating system: Linux
0.000 Program arguments: "./factorio"
0.000 Read data path: /home/<private>/factorio/data
0.000 Write data path: /home/<private>/factorio
0.000 Binaries path: /home/<private>/factorio/bin
0.176 Available display adapters: 1
0.176 [0]: resolution 1920x1080px at [0,0]
0.176 Create display on adapter 0. Size 1280x720 at position [310, 162]. Monitor 0
0.245 Initialised OpenGL:[0] GeForce GTX 780/PCIe/SSE2; driver: 4.5.0 NVIDIA 355.11
0.280 Graphics options: [FullScreen: false] [VSync: false] [UIScale: 100%] [MultiSampling: OFF] [Graphics quality: normal] [Video memory usage: high] [Light scale: 20%] [Screen: 0]
0.299 Loading mod core 0.0.0 (data.lua)
0.300 Loading mod base 0.12.17 (data.lua)
0.591 Initial atlas bitmap size is 16384
0.593 Created atlas bitmap 16384x5509
8.529 Info Updater.cpp:752: Downloading https://www.factorio.com/updater/get-av ... iVersion=2
9.841 0 packages available to download (experimental updates enabled).
9.870 Factorio initialised
14.613 Loading map /home/<private>/factorio/saves/nik.zip
14.633 Info Scenario.cpp:123: Map version 0.12.17-0
45.228 Loading map /home/<private>/factorio/saves/nik.zip
45.246 Info Scenario.cpp:123: Map version 0.12.17-0
71.606 Goodbye

Re: [0.12.17] Minimap causes huge slowdowns on Linux

Posted: Wed Nov 18, 2015 3:34 pm
by prg
User not in the video group? (Or however that might work on Arch, check permissions for /dev/nvidia*)

Re: [0.12.17] Minimap causes huge slowdowns on Linux

Posted: Wed Nov 18, 2015 3:34 pm
by Oxyd
Wartorn wrote:I tried running it with sudo. Turns out the game works perfectly if I do. This is not a good solution though. Why would it require root privileges?
Factorio itself doesn't require root privileges. Maybe graphics acceleration isn't available to your user? Or maybe your user is subject to some resource limits.

It used to be that you had to add your user to the video group to gain access to hardware-accelerated graphics. The Arch Wiki says this is no longer needed with systemd, but warns that this is only the case when your logind session isn't broken. So: Are you using systemd? Is your logind session broken?

In either case, if it works under sudo, it sounds like improper configuration of your computer rather than Factorio bug.

Re: [0.12.17] Minimap causes huge slowdowns on Linux

Posted: Wed Nov 18, 2015 3:38 pm
by Wartorn
As I mentioned previously, I do plenty of gaming without issues, no sudo. I'll do some research and see what I can figure out.

Re: [0.12.17] Minimap causes huge slowdowns on Linux

Posted: Wed Nov 18, 2015 3:44 pm
by prg
Just to rule out permission problems: strace -e open ./factorio |& grep /dev/nvidia

Re: [0.12.17] Minimap causes huge slowdowns on Linux

Posted: Wed Nov 18, 2015 6:04 pm
by Wartorn
open("/dev/nvidiactl", O_RDWR) = 9
open("/dev/nvidia0", O_RDWR) = 10
open("/dev/nvidia0", O_RDWR) = 11

Re: [0.12.17] Minimap causes huge slowdowns on Linux

Posted: Wed Nov 18, 2015 6:15 pm
by prg
Looks all happy. That's as user? At least it's not a permission thing then.

Re: [0.12.17] Minimap causes huge slowdowns on Linux

Posted: Wed Nov 18, 2015 10:21 pm
by Wartorn
prg wrote:Looks all happy. That's as user? At least it's not a permission thing then.
Yep, it is.

Re: [0.12.17] Minimap causes huge slowdowns on Linux

Posted: Tue Nov 24, 2015 11:30 am
by kovarex
Any news about this issue?

Is there anyone else having the same problem?

Re: [0.12.17] Minimap causes huge slowdowns on Linux

Posted: Thu Dec 24, 2015 5:24 pm
by Wartorn
Found out what the issue was. I had a file in profile.d that set some environment variables.

Using these in combination will ruin the performance for me:
__GL_THREADED_OPTIMIZATIONS=1
__GL_YIELD="USLEEP"

Re: [0.12.17] Minimap causes huge slowdowns on Linux

Posted: Fri Dec 25, 2015 11:39 am
by kovarex
Thanks for the info, we can use it if someone has the same problem in the future.