Page 1 of 1

[2.0.13] 100% CPU utilisation, forever

Posted: Thu Oct 31, 2024 2:31 pm
by akay
On Linux, as soon as the loading screen with "Loading sprites" finishes and I get the Main menu, factorio exhausts all cores on the CPU as long as the game is running. FPS seems to oscillate around 2-5, both on Main menu & in game, depending on what's displayed in the background (in Main menu).
Tried restarting a few times, but didn't help.
Problem didn't exist on 2.0.12.

sway 1:1.10-1
nvidia-dkms 560.35.03-19
10-31-2024, 17-28-56.png
10-31-2024, 17-28-56.png (31.49 KiB) Viewed 444 times
10-31-2024, 17-29-31.png
10-31-2024, 17-29-31.png (11 KiB) Viewed 444 times

Re: [2.0.13] 100% CPU utilisation, forever

Posted: Thu Oct 31, 2024 2:56 pm
by posila

Code: Select all

   0.050 Initialised OpenGL:[1] llvmpipe (LLVM 18.1.8, 256 bits); driver: 4.5 (Core Profile) Mesa 24.2.5-arch1.1
Hello, I can see OpenGL initialized using llvmpipe driver (https://docs.mesa3d.org/drivers/llvmpipe.html) which is software rasterizer - meaning, OpenGL does not use your GPU, it does the rendering on CPU, resulting in low FPS and 100% CPU utilisation. There was no change in flags we use to create OpenGL context, so I don't think this is due to any change we did on our side.

Re: [2.0.13] 100% CPU utilisation, forever

Posted: Thu Oct 31, 2024 3:08 pm
by akay
posila wrote: Thu Oct 31, 2024 2:56 pm

Code: Select all

   0.050 Initialised OpenGL:[1] llvmpipe (LLVM 18.1.8, 256 bits); driver: 4.5 (Core Profile) Mesa 24.2.5-arch1.1
Hello, I can see OpenGL initialized using llvmpipe driver (https://docs.mesa3d.org/drivers/llvmpipe.html) which is software rasterizer - meaning, OpenGL does not use your GPU, it does the rendering on CPU, resulting in low FPS and 100% CPU utilisation. There was no change in flags we use to create OpenGL context, so I don't think this is due to any change we did on our side.
The problem stops when I select X11 as the preferred video driver.
Before I ran factorio, I updated both the nvidia drivers and sway when I turned on the computer and restarted, but that's the only change between running the game perfectly fine on 2.0.12 last night with preferred video driver set to Wayland, and today. Maybe something changed on their side.

Thank you. I'll just use the X11 option for now.

Re: [2.0.13] 100% CPU utilisation, forever

Posted: Fri Nov 01, 2024 11:11 pm
by tlauli
I have the same problem on arch linux.

Code: Select all

sway-git 1.10.r7457.d417a8f-1
wlroots-git 0.19.0.r7285.d835fa81-1
nvidia-open 565.57.01-1
What I noticed is that in the steam logs there is this line:

Code: Select all

libEGL warning: egl: failed to create dri2 screen
Factorio tries to use the gpu, but fails for some reason. I tried to force the usage of gpu acceleration with

Code: Select all

__EGL_VENDOR_LIBRARY_FILENAMES=/usr/share/glvnd/egl_vendor.d/10_nvidia.json steam
but then Factorio unsurprisingly did not even start.

I am not sure where the problem is, whether it is sdl, my system being misconfigured in some way, or just nvidia being crappy, but I will be happy to test things or provide more info.

EDIT: Same situation with sway 1.10 and wlroots 0.18.1 from the official repos.

Re: [2.0.13] 100% CPU utilisation, forever

Posted: Thu Dec 19, 2024 9:39 pm
by crimsonknave
I had the same problem after a Nvidia driver update. Factorio launched from steam would not use my GPU if it was using wayland, but I had the flickering issue if I used X11. Oddly, launching the non steam version of the game worked great in wayland with no issues.

I was able to get the steam version working by setting the following as my launch options. Taken from https://wiki.archlinux.org/title/OpenGL ... kan_(Zink), this set opengl to use vulkan.

Code: Select all

env __GLX_VENDOR_LIBRARY_NAME=mesa __EGL_VENDOR_LIBRARY_FILENAMES=/usr/share/glvnd/egl_vendor.d/50_mesa.json MESA_LOADER_DRIVER_OVERRIDE=zink GALLIUM_DRIVER=zink %command%