100% CPU while running openttd

Got a problem with OpenTTD? Find some help here.

Moderator: OpenTTD Developers

Pajarico
Engineer
Engineer
Posts: 12
Joined: 26 Jan 2005 18:37

100% CPU while running openttd

Post by Pajarico »

Hi, i'm on linux and when i run openttd it eats my CPU no matter if i run it windowed or fullscreen, the speed of the game seems normal and smooth but every 5 seconds pauses for a moment (i guess is when the cpu hits the peak value of 100%).
:wink:
Moriarty
Tycoon
Tycoon
Posts: 1395
Joined: 12 Jun 2004 00:37
Location: United Kingdom of Great Britain and Northern Ireland
Contact:

Post by Moriarty »

Does it still use 100% when full animation is turned off? That's the single biggest CPU user in my experience (short of full-speed which makes a point of using 100% of your CPU (that's how it works ;) ))
CruDeLioS
Engineer
Engineer
Posts: 19
Joined: 13 Jan 2005 13:21

Post by CruDeLioS »

Are you using timidity for the midi files? That's most probably the cause... Try disabling music (start the game with "-m null") and see if cpu usage drops...
Pajarico
Engineer
Engineer
Posts: 12
Joined: 26 Jan 2005 18:37

Post by Pajarico »

CruDeLioS tried your tip and tried compiling openttd without timidity support, same result.

Moriarty i can't find that option, where is it?

:wink:
User avatar
Sionide
Director
Director
Posts: 523
Joined: 10 Oct 2004 10:54
Location: England
Contact:

Post by Sionide »

Image

Click on this icon, then go to "Full Animated" and "Full Detail"

....
...Synthetic Intelligent Organism Normally for Infiltration and Dangerous Exploration...
...sionide.net...
Pajarico
Engineer
Engineer
Posts: 12
Joined: 26 Jan 2005 18:37

Post by Pajarico »

Click on this icon, then go to "Full Animated" and "Full Detail"
"Full Animated" disabled and "Full Detail" enabled and now it uses around 20%. Is that common rule, it's me or is a possible bug?
I've an amd64 +3000 and 1GB RAM.
Moriarty
Tycoon
Tycoon
Posts: 1395
Joined: 12 Jun 2004 00:37
Location: United Kingdom of Great Britain and Northern Ireland
Contact:

Post by Moriarty »

20% is an improvement.

That is most likely a bug, or weird hardware stuff. My slower amd2600 with 512mb ram runs at less than 1% CPU usage an instance of OTTD (with full animation off).
Maybe it's the 64 bit stuff. Don't know.
Jango
Traffic Manager
Traffic Manager
Posts: 189
Joined: 28 Aug 2004 12:13

Post by Jango »

actually, i had the same problem. Running in Linux with a 3200+ AMD 64 CPU.

I'd recommend that first you check 'top' to ensure that it is OpenTTD using up the CPU instead of X. You may find it's actually X.

If so, this suggests an SDL bug, imo.

I assume you are running a 32-bit Linux distro. I've compiled SDL/X and OpenTTD in 64-bit and the problem is not there. If you have enough Linux experience, I recommend getting Gentoo AMD64, if not, then try something else like SuSE 9.x for AMD64.
Pajarico
Engineer
Engineer
Posts: 12
Joined: 26 Jan 2005 18:37

Post by Pajarico »

Thanks to you both.

Jango I'm running Gentoo in pure 64 environment. Everything is compiled from scratch, SDL, X (xorg-6.8.1.901 actually) and openttd included.
I'm starting to suspect that this has something to do with composite extension or maybe with composite manager (i'm using xfce4 that comes with its own manager).
I'm going to compile xfce4 without composite enabled and see what happens. If that doesn't work i'll compile xorg without composite and see what happens (again :P ). I'll post results.

Jango, tell me if you are experiencing this problem now. And tell me if you are using composite in X and in window manager (for shadows and transparenncies).
I'd recommend that first you check 'top' to ensure that it is OpenTTD using up the CPU instead of X. You may find it's actually X.
You were right :) :
-X: 95%
-openttd: 2%

Greets :wink:
User avatar
Observer
Logo Creator
Posts: 2189
Joined: 19 Nov 2002 12:21
Location: Zoetermeer, The Netherlands
Contact:

Post by Observer »

I have an AMD64 3200+ also. Im a big fan of gentoo, but this is the only pc left in my room still running windows..
Im planning on installing gentoo64 anytime soon... I would not like for any of this cpu misbehaviour to happen here, so Im awaiting your results with much interest.
Just wanted to let you know.
Never fear, I is here...
User avatar
Celestar
Director
Director
Posts: 574
Joined: 02 Jul 2004 10:56
Contact:

Post by Celestar »

You might want to install better graphic drivers.

Celestar
Pajarico
Engineer
Engineer
Posts: 12
Joined: 26 Jan 2005 18:37

Post by Pajarico »

Compiled xfce4 without composite, same result, maybe a bit faster. The problem is when i try to scroll the screen.. is bloody slow :cry:
You might want to install better graphic drivers.
I'm having trouble with nvidia drivers (specially 6629)

:wink:
Jango
Traffic Manager
Traffic Manager
Posts: 189
Joined: 28 Aug 2004 12:13

Post by Jango »

pajarico, i think you might find my reply inadequate. I've never used composites, and I can't tell you which versions I'm running, and I've only been using gentoo for a few days.

Basically my system is set up:

Latest stable gentoo xorg
Latest stable gentoo xfce4
Latest stable gentoo sdl
Latest stable gentoo nvidia-glx / nvidia-kernel

I'm using DRI and GLX extensions within xorg, and I've not tried Xinerama yet, although I almost certainly will.
Pajarico
Engineer
Engineer
Posts: 12
Joined: 26 Jan 2005 18:37

Post by Pajarico »

My system:
Latest unstable xorg
Latest unstable xfce4 (4.2.0, but not a single crash since it went out)
Latest stable gentoo
No nvidia-glx / nvidia-kernel

All the stuff to make binaries (gcc, binutils, ld...) is stable too. My CCFLAGS are very simple (-O2 -pipe).

I've disabled composite in xorg.conf but to no avail.
Does anyone know of a game in sdl? Just to check if is a sdl problem or a x problem...
:wink:
User avatar
dominik81
OpenTTD Developer
OpenTTD Developer
Posts: 768
Joined: 16 Aug 2003 12:55
Location: Bonn, Germany

Post by dominik81 »

Frozen Bubbles is SDL.
"There's a readme that comes with the source. I suggest you read it."
- Korenn
Pajarico
Engineer
Engineer
Posts: 12
Joined: 26 Jan 2005 18:37

Post by Pajarico »

dominik81 wrote:Frozen Bubbles is SDL.
Tried frozen-bubble, is slow as hell. Again same problem, X eats my CPU.
The game is playable but when there are many elements in the screen the cpu rises inmediately to ridiculous high values.
Exactly the same as in openttd, is playable but when there are lots of traffic it turns slow.

I'm going to ask in gentoo forums, to see if this is generalizated.

:wink:
Pajarico
Engineer
Engineer
Posts: 12
Joined: 26 Jan 2005 18:37

Post by Pajarico »

Please, read this (specially devs) and tell me what do you think:
http://forums.gentoo.org/viewtopic.php?t=286730

:wink:
User avatar
Celestar
Director
Director
Posts: 574
Joined: 02 Jul 2004 10:56
Contact:

Post by Celestar »

SDL_CALL SDL_Delay(1);

does he mean that part?

I'm running a full game at around 30% on my notebook, with CPU running at minimum clock speed (500MHz) and a totally crappy shared memory "card".

Celestar
Jango
Traffic Manager
Traffic Manager
Posts: 189
Joined: 28 Aug 2004 12:13

Post by Jango »

i only saw it on the 64-bit processor. And I only had the problem when i was running sdl/X/openttd in 32-bit mode.

I don't think that suggests a code problem.
User avatar
Darkvater
Tycoon
Tycoon
Posts: 3053
Joined: 24 Feb 2003 18:45
Location: Hong Kong

Post by Darkvater »

It also works just fine on Windows when run with the SDL library. Not that anyone wants it, but just to show that it is not the SDL-noobness problem that that guy blindly suggested on the gentoo forums.
TrueLight: "Did you bother to read any of the replies, or you just pressed 'Reply' and started typing?"
<@[R-Dk]FoRbiDDeN> "HELP, this litte arrow thing keeps following my mouse, and I can't make it go away."
Post Reply

Return to “OpenTTD Problems”

Who is online

Users browsing this forum: No registered users and 6 guests