Linux Performance problems

Got a problem with OpenTTD? Find some help here.

Moderator: OpenTTD Developers

Post Reply
spock
Engineer
Engineer
Posts: 12
Joined: 12 Jul 2006 13:00

Linux Performance problems

Post by spock »

I haven't played OpenTTD for a while, and I recently installed the 0.4.8 and today the 0.5RC but they seem to be slow.

I tried running the 0.4.8 in windows (It's a dual boot system) and OpenTTD runs great.

Starting OpenTTD in linux gives really big performance problems. The sound is stuttering. (I don't use the midi music, because I don't like it) The graphics are also stuttering. Sometimes it's fluent, and suddenly the graphics 'hang' for a second. Next to that the mouse seems unresponsive, a lot of clicks seem to be ignored.

Trying to find out what caused it I saw this: (top, first number is CPU, second memory)
45.1 2.6 openttd
33.5 9.9 Xorg
So it seems CPU is suddenly a problem? I have an 1600 mghz CPU here, and like I said, OpenTTD works in windows.

But it seems the high X CPU usage is also caused by OpeNTTD, because when OpenTTD is not running it's a lot lower:
6.6 9.3 Xorg

Is anyone else experiencing this too, or is it just me? And how can I solve it?

Btw, sorry for my bad English
Last edited by spock on 23 Dec 2006 15:12, edited 1 time in total.
User avatar
Darkvater
Tycoon
Tycoon
Posts: 3053
Joined: 24 Feb 2003 18:45
Location: Hong Kong

Re: Linux Performance problems

Post by Darkvater »

spock wrote:But it seems the high X CPU usage is also caused by OpeNTTD, when OpenTTD is not running:
How can OpenTTD cause high CPU usage when it is not running? You'd better check your system :)

You have not provided sufficient information. Music in OpenTTD by timidity uses a ton of CPU, try running with music disabled (./openttd -m null). Also CPU usage depends on the mapsize, number of vehicles, etc. You have not told us about those.
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."
spock
Engineer
Engineer
Posts: 12
Joined: 12 Jul 2006 13:00

Re: Linux Performance problems

Post by spock »

Darkvater wrote: How can OpenTTD cause high CPU usage when it is not running? You'd better check your system :)
Well, you mis-understood me. I changed the sentence a little bit in my original post now. If you looked at the numbers, you saw X is using 6.6% CPU normally, and 33.5% when OpenTTD is running. The OpenTTD process uses 45.1%.
Darkvater wrote: You have not provided sufficient information. Music in OpenTTD by timidity uses a ton of CPU, try running with music disabled (./openttd -m null).
I know that, although by tweaking the settings of timidity you can bring the CPU usage of timidity down a lot. But I hate the music actually, so I always run with -m null
Darkvater wrote: Also CPU usage depends on the mapsize, number of vehicles, etc. You have not told us about those.
Well, to honestly compare, i just used same savegame both under windows and linux. 256x256 mapsize, 113 vehicles.

In windows everything runs smooth, I can actually open some heavy applications while playing. In Linux, without any extra programs but gnome open, it runs with the problems mentioned in the first post.
spock
Engineer
Engineer
Posts: 12
Joined: 12 Jul 2006 13:00

Post by spock »

*bounce*

I've now tested the 0.5RC on the same PC in both windows and linux, and the problem persists.

AFAIK the old version I played (0.3.2 I believe, like I said, didn't play it for a long time) ran fine..

Is there anyone who can help me?
Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

Post by Rubidium »

I'm running linux too, however I'm using Xorg 7.1.1, which version are you running?. But I've never had trouble with it.

However, 6.6 percent of the CPU going to Xorg in an idle situation does not sound ok. On my computer it is (on average) less than 1 percent at 600 MHz (at a resolution of 1920x1200 and a running Konsole with top!). When running OpenTTD at max speed, Xorg still uses less than 5 percent CPU.

I therefore think there is a problem with the configuration of X. I suspect you have not configured it to load a (semi) optimized video driver for your video card, i.e. you use the normal VGA driver it (probably) means that SDL has to write every pixel via Xorg to the video device instead of blitting the whole screen to the videocards memory and that takes a lot of CPU cycles. This can be caused by an software upgrade of the system.
That this doesn't happen in Windows is, assuming I'm correct, due to the fact that in Windows it can just blit the whole screen to the memory of the video card instead of doing it pixel per pixel.
spock
Engineer
Engineer
Posts: 12
Joined: 12 Jul 2006 13:00

Post by spock »

Rubidium wrote:I'm running linux too, however I'm using Xorg 7.1.1, which version are you running?. But I've never had trouble with it.
I'm also running Xorg 7.1.1
Rubidium wrote: I therefore think there is a problem with the configuration of X. I suspect you have not configured it to load a (semi) optimized video driver for your video card
I'm using the Nvidia Driver (There's an GeForce 2 MX in this pc)

Although you're probably right this isn't really openttd's fault. Just by moving the mouse over the screen I can get the Xorg CPU usage to increase quite a bit.

Well, thanks, I'm going to try to maybe downgrade the nvidia driver or something..
SmatZ
OpenTTD Developer
OpenTTD Developer
Posts: 351
Joined: 03 Oct 2006 18:26
Location: Prague, Czech Republic
Contact:

Post by SmatZ »

If you can, try running both OpenTTD versions with the same computer configuration. (the same video driver) That should be no problem - just unpack 0.5.0 into one directory, 0.4.8 into second directory and run them (not simultaneously).

Try "time openttd" to check, if the time is spent in Userspace (ttd code) or System (likely SDL video driver)
spock wrote:I've now tested the 0.5RC on the same PC in both windows and linux, and the problem persists.
Does this mean that problem is only on your Linux system?

For GF2MX try using the Legacy 71.84 driver. http://www.nvidia.com/object/unix.html

edit
Isn't AI working in background?
Last edited by SmatZ on 28 Dec 2006 18:30, edited 1 time in total.
Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

Post by Rubidium »

SDL is also userspace, so it won't show anything.
spock
Engineer
Engineer
Posts: 12
Joined: 12 Jul 2006 13:00

Post by spock »

Well, it seems you were right, I tried SDL_GetVideoInfo();
hw_available? 0
wm_available? 1
blit_hw? 0
blit_hw_CC? 0
blit_hw_A? 0
blit_sw? 0
blit_sw_CC? 0
blit_sw_A? 0
blit_fill? 0
video memory(in K)? 0
bits per pixel? 32
So for some reason I don't seem to have hardware acceleation anymore. Is there a way to check if my nvidia driver still works? (I think it might be caused by the last X upgrade)
SmatZ
OpenTTD Developer
OpenTTD Developer
Posts: 351
Joined: 03 Oct 2006 18:26
Location: Prague, Czech Republic
Contact:

Post by SmatZ »

I found a similiar problem described at SF.net (from known-bugs.txt ...)
http://sourceforge.net/tracker/index.ph ... tid=636365

Changing Color Depth to 8bpp could help you.
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Post by Zuu »

You might want to try to run the OpenGL-demo

Code: Select all

glxgears
if it is available at your system.

Either you see the wheel traveling around at a more or less decent phase or it goes incredible fast.

(On my Debian Etch system it seams like glxgears is not available anymore, duno if it is a XFree86-only tool or why I cant get it anymore)
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Tom_le_mort
Engineer
Engineer
Posts: 41
Joined: 11 Dec 2004 15:23
Location: Lille (France)

Post by Tom_le_mort »

glxgears is available in the mesa-utils package.
maartena
Route Supervisor
Route Supervisor
Posts: 470
Joined: 11 Jul 2003 04:53
Location: California, U.S.A.

Re: Linux Performance problems

Post by maartena »

spock wrote:Starting OpenTTD in linux gives really big performance problems. The sound is stuttering. (I don't use the midi music, because I don't like it) The graphics are also stuttering. Sometimes it's fluent, and suddenly the graphics 'hang' for a second. Next to that the mouse seems unresponsive, a lot of clicks seem to be ignored.
Oddly enough, this is almost identical to the behaviour I have found in Windows Vista.
User avatar
Darkvater
Tycoon
Tycoon
Posts: 3053
Joined: 24 Feb 2003 18:45
Location: Hong Kong

Re: Linux Performance problems

Post by Darkvater »

maartena wrote:
spock wrote:Starting OpenTTD in linux gives really big performance problems. The sound is stuttering. (I don't use the midi music, because I don't like it) The graphics are also stuttering. Sometimes it's fluent, and suddenly the graphics 'hang' for a second. Next to that the mouse seems unresponsive, a lot of clicks seem to be ignored.
Oddly enough, this is almost identical to the behaviour I have found in Windows Vista.
Oddly enough, the two have nothing to do with each other ;)
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: Semrush [Bot] and 7 guests