[1.1.35] Linux - Lower FPS on Steam version than on non Steam version

Bugs that are actually features.
posila
Factorio Staff
Factorio Staff
Posts: 5341
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: [Oxyd] [1.1.35] Linux - Lower FPS on Steam version than on non Steam version

Post by posila »

andrfgs wrote: Tue Jul 06, 2021 5:06 pm Not a stupid question at all. I do understand your thinking, it could be the platform issuing expensive syscalls to the OS, but unfortunately, nothing changes. The non steam version runs at 60fps regardless.
andrfgs wrote: Fri Sep 10, 2021 11:40 am when running Steam Native and the FPS is still low. Sorry to insist on this, might it actually be the specific implementation of Factorio for steam on Linux that's a bit inneficient?
And what happens if you add the standalone version to the Steam Library and run it through Steam? I am asking, because we don't do anything to add Steam Overlay, Steam intercepts OpenGL calls and adds it automatically. And it does it even if you run non-Steam games through Steam. So, I am wondering, if standalone Factorio would slow down too, if ran through Steam.
andrfgs
Inserter
Inserter
Posts: 21
Joined: Fri Sep 04, 2020 10:12 pm
Contact:

Re: [Oxyd] [1.1.35] Linux - Lower FPS on Steam version than on non Steam version

Post by andrfgs »

Running the standalone version with Steam as an external game enables the overlay and the FPS is high (stable 60fps).

So its not the overlay. Because it also works on the standalone version and there is no FPS loss.
Definition of Evil: put train lines at (0, 0) with a constant stream of trains passing by.
evg-zhabotinsky
Inserter
Inserter
Posts: 22
Joined: Wed Dec 09, 2020 3:53 pm
Contact:

Re: [Oxyd] [1.1.35] Linux - Lower FPS on Steam version than on non Steam version

Post by evg-zhabotinsky »

I finally downloaded standalone Factorio for Linux and tested performance.

The ways of running Factorio that I tested:
- Standalone
- Standalone through Steam: runtime and overlay disabled, LD_PRELOAD and LD_LIBRARY_PATH force-unset
- Standalone through Steam: runtime and overlay enabled
- Steam: runtime and overlay disabled, LD_PRELOAD and LD_LIBRARY_PATH force-unset
- Steam: runtime disabled, overlay enabled
- Steam: runtime and overlay enabled
In all cases:
- Version is the latest (1.1.39-0)
- Config is exactly the same (copied from Steam version), graphics are at max
- "vblank_mode=0 primusrun" is used to start game on dGPU with unlocked FPS
- Saves are exactly the same (copied from Steam)
- Viewed scenes are exactly the same
- OS environment is the same
Tested saves:
- Creative mode, smelting 4 blue belts of iron ore to steel, speed x10
- "Default" mode, huge factory, the one I'm playing

Results:
In all cases, FPS/UPS was exactly the same. At default zoom 120~130/~500 for creative and 40/40 for actual factory.
Even with Steam Runtime and overlay enabled! That actually surprized me.

Conclusion:
Cannot reproduce the problem. Performance seems the same no matter how you run Factorio.
(At least on my laptop. Specs: i7 4700mq, 32G RAM, Quadro K2100m, 2G VRAM, 1920x1080@60, SSD. OS: Manjaro, nVidia driver: 390.144)

Possible suggestions for OP:
- Try copying config from Steam (~/.factorio/config/config.ini) to standalone ($gamedir/config/config.ini) or vice-versa, the problem might be with settings
- Try loading exactly the same save (they are in {~/.factorio,$gamedir}/saves/ ) and looking at exactly the same scenes there, maybe it's factory lagging
- Try putting "env -u LD_PRELOAD -u LD_LIBRARY_PATH" everywhere, both steam and non-steam, ideally ensure all environment is exact same
- Try comparing performance without prime-run, maybe it's a driver-ish issue
- If the cause of performance difference still isn't clear, I can only suspect libsteamapi, but I don't think it is supposed to actually do much.
andrfgs
Inserter
Inserter
Posts: 21
Joined: Fri Sep 04, 2020 10:12 pm
Contact:

Re: [Oxyd] [1.1.35] Linux - Lower FPS on Steam version than on non Steam version

Post by andrfgs »

Damn it I finally found the problem.

Its when I run with "prime-run" argument. Running without it appears to run the game at 60 FPS on Steam as well, when the laptop only has the nvidia card enabled.

This makes no sense to me because all prime-run does is select NVidia as the intended graphics card:

Code: Select all

#!/bin/bash
export __NV_PRIME_RENDER_OFFLOAD=1
export __GLX_VENDOR_LIBRARY_NAME=nvidia
export __VK_LAYER_NV_optimus=NVIDIA_only
export VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/nvidia_icd.json
exec "$@"
The non steam version is also slowed down by running it with prime-run it turns out, so its not a Steam issue for sure.

Anyways, its indifferent when I'm using the Nvidia card only. Doesn't make much sense though, other games run fine as well with this both Steam and non steam games. I remember this only happened when I hooked my laptop into an external monitor and played there. If I was using the laptop with both cards, I would need this, otherwise Factorio would run on the integrated GPU.

Regardless, thanks to everyone here who lost their time helping me with this. Can't believe it was such a tiny thing.
Definition of Evil: put train lines at (0, 0) with a constant stream of trains passing by.
evg-zhabotinsky
Inserter
Inserter
Posts: 22
Joined: Wed Dec 09, 2020 3:53 pm
Contact:

Re: [Oxyd] [1.1.35] Linux - Lower FPS on Steam version than on non Steam version

Post by evg-zhabotinsky »

If so, looks like a prime-offload issue, and needs to be reported elsewhere. The feature is supposed to be transparent to the apps so even if Factorio is "responsible" this shouldn't be its problem. Can't do any testing myself since my dGPU doesn't have prime-offload-compatible drivers, I use bumblebee/primus.
Post Reply

Return to “Not a bug”