Unreasonable high CPU usage (90-100%)

Having trouble with the game? Report issues and get help here. Read this first!

Moderators: Forum Moderators, Developers

Forum rules
Before reporting issues in this section, you must read the following topic:
Post Reply
usr7468
Posts: 4
Joined: August 27th, 2018, 6:27 pm

Unreasonable high CPU usage (90-100%)

Post by usr7468 » August 27th, 2018, 7:23 pm

hi,

the game uses 90-100% cpu on my machine, while on any map. when opening any menu-dialog, ( e.g. (s)tatistics, or ob(j)ectives or even the right-click context-menu anywhere on the map), it drops back to ~10% until the dialog is closed. this happens on all maps/campaigns i tested, including the tutorial.

i tried to:
- disable fullscreen
- set resoulution to 800x600
- disabled map animation
- disabled unit idle animations
- enable/disable "limit fps"-option

nothing had any impact on this behavior.

starting the game single threaded, with:

Code: Select all

numactl --physcpubind=+1 wesnoth

reduced the cpu usage to ~10% without any game performance issues. no lagging. runs just the same.

high cpu usage let my cpu-fan run crazy, which is annoying. very little i do, makes this fan start spinning.. so am i missing a setting or something? do u have a hidden "support us by mining crypto-currencies"-checkbox? :D

---------------------------------------------------------------------------------------------

-Computer-
Processor : Intel(R) Core(TM) i7-6820HK CPU @ 2.70GHz
Memory : 32881MB
Operating System : Debian GNU/Linux testing (buster)

-Display-
Resolution : 1920x1080 pixels
OpenGL Renderer : GeForce GTX 1070/PCIe/SSE2
X11 Vendor : The X.Org Foundation

-Audio Devices-
Audio Adapter : HDA-Intel - HDA Intel PCH

---------------------------------------------------------------------------------------------
The Battle for Wesnoth version 1.14.4
Running on Debian GNU/Linux testing (buster)

Game paths
==========

Data dir: /usr/share/games/wesnoth/1.14
User config dir: /home/USER/.config/wesnoth-1.14
User data dir: /home/USER/.config/wesnoth-1.14
Saves dir: /home/USER/.config/wesnoth-1.14/saves
Add-ons dir: /home/USER/.config/wesnoth-1.14/data/add-ons
Cache dir: /home/USER/.config/wesnoth-1.14/cache

Libraries
=========

Boost: 1.62
OpenSSL/libcrypto: 1.1.0h (runtime 1.1.0h)
Cairo: 1.15.10 (runtime 1.15.10)
Pango: 1.42.1 (runtime 1.42.4)
SDL: 2.0.8 (runtime 2.0.8)
SDL_image: 2.0.3 (runtime 2.0.3)
SDL_mixer: 2.0.2 (runtime 2.0.2)
SDL_ttf: 2.0.14 (runtime 2.0.14)

Features
========

Experimental OpenMP support: yes
JPG screenshots: yes
Lua console completion: yes
Legacy bidirectional rendering: yes
D-Bus notifications back end: yes

gfgtdf
Developer
Posts: 1091
Joined: February 10th, 2013, 2:25 pm

Re: Unreasonable high CPU usage (90-100%)

Post by gfgtdf » August 27th, 2018, 8:52 pm

So you also get the high Cpu usage on the main screen or in the campaign selection dialog?
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.

usr7468
Posts: 4
Joined: August 27th, 2018, 6:27 pm

Re: Unreasonable high CPU usage (90-100%)

Post by usr7468 » August 27th, 2018, 10:12 pm

no.

i get high cpu usage, in-game, on the map/battlefield only. not on the launch-screen, not in the menus. only in-game where you move ur units and make them fight the enemy :). but when i open any game dialog while playing, the cpu usage goes down again to ~10%. that can be anything, like the right-click-context-menu ( Terrain Description / Set Label / Clear Labels ), or the the battle-dialog which appears, when a fight starts with an other unit . the game battlefield can be behind that dialog. does not matter, as long as any dialog is open, it reduces the cpu usage to ~10% (guess 1 running thread). animations, like the water animation stop, if any dialog is open. so i tried to disable them, but nothing changed. if the dialog is closed, the cpu usage is back to 100%

when i use the command from above, to force the game to use only one cpu-core, not all 8, the performance is not effected. it does not run 8-10 times slower. it runs as always, but the cpu usage stays at ~10% max. so from my point of view, it uses 8-10 times more cpu resources than it should.

gfgtdf
Developer
Posts: 1091
Joined: February 10th, 2013, 2:25 pm

Re: Unreasonable high CPU usage (90-100%)

Post by gfgtdf » August 27th, 2018, 10:33 pm

oh sry i miread your first post. In that case, if you build wesnoth yourself i'd reccomend to try building without 'Experimental OpenMP support'
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.

usr7468
Posts: 4
Joined: August 27th, 2018, 6:27 pm

Re: Unreasonable high CPU usage (90-100%)

Post by usr7468 » August 27th, 2018, 11:13 pm

thank you for your prompt replys :)

unfortunately i am running 1:1.14.4-1(testing); installed with apt; on Debian (buster).

is it possible to disable OpenMP support without building myself? any settings files to edit? or a hidden command line param? did not find anything glancing through 'man wesnoth' and 'wesnoth -h'. when it comes to building stuff myself, i am am the lazy type :P

gfgtdf
Developer
Posts: 1091
Joined: February 10th, 2013, 2:25 pm

Re: Unreasonable high CPU usage (90-100%)

Post by gfgtdf » August 27th, 2018, 11:17 pm

one attempt coudl be setting the enviroment variable OMP_WAIT_POLICY to PASSIVE, not sure how enviroment variables work exactly in particular on linux, so i cannot tell you how this is done exactly.
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.

usr7468
Posts: 4
Joined: August 27th, 2018, 6:27 pm

Re: Unreasonable high CPU usage (90-100%)

Post by usr7468 » August 27th, 2018, 11:32 pm

Code: Select all

export OMP_WAIT_POLICY="passive"
wesnoth
solves my issue. tyvm gfgtdf!

Post Reply