Linux Performance problems
Moderator: OpenTTD Developers
Linux Performance problems
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
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.
Re: Linux Performance problems
How can OpenTTD cause high CPU usage when it is not running? You'd better check your systemspock wrote:But it seems the high X CPU usage is also caused by OpeNTTD, when OpenTTD is not running:

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."
<@[R-Dk]FoRbiDDeN> "HELP, this litte arrow thing keeps following my mouse, and I can't make it go away."
Re: Linux Performance problems
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: How can OpenTTD cause high CPU usage when it is not running? You'd better check your system
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 nullDarkvater 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).
Well, to honestly compare, i just used same savegame both under windows and linux. 256x256 mapsize, 113 vehicles.Darkvater wrote: Also CPU usage depends on the mapsize, number of vehicles, etc. You have not told us about those.
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.
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.
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.
I'm also running Xorg 7.1.1Rubidium 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 using the Nvidia Driver (There's an GeForce 2 MX in this pc)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
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..
-
- OpenTTD Developer
- Posts: 351
- Joined: 03 Oct 2006 18:26
- Location: Prague, Czech Republic
- Contact:
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)
For GF2MX try using the Legacy 71.84 driver. http://www.nvidia.com/object/unix.html
edit
Isn't AI working in background?
Try "time openttd" to check, if the time is spent in Userspace (ttd code) or System (likely SDL video driver)
Does this mean that problem is only on your Linux system?spock wrote:I've now tested the 0.5RC on the same PC in both windows and linux, and the problem persists.
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.
Well, it seems you were right, I tried SDL_GetVideoInfo();
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)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
-
- OpenTTD Developer
- Posts: 351
- Joined: 03 Oct 2006 18:26
- Location: Prague, Czech Republic
- Contact:
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.
http://sourceforge.net/tracker/index.ph ... tid=636365
Changing Color Depth to 8bpp could help you.
You might want to try to run the OpenGL-demo
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)
Code: Select all
glxgears
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)
Junctioneer (a traffic intersection simulator)
-
- Engineer
- Posts: 41
- Joined: 11 Dec 2004 15:23
- Location: Lille (France)
Re: Linux Performance problems
Oddly enough, this is almost identical to the behaviour I have found in Windows Vista.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.
Re: Linux Performance problems
Oddly enough, the two have nothing to do with each othermaartena wrote:Oddly enough, this is almost identical to the behaviour I have found in Windows Vista.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.

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."
<@[R-Dk]FoRbiDDeN> "HELP, this litte arrow thing keeps following my mouse, and I can't make it go away."
Who is online
Users browsing this forum: Semrush [Bot] and 7 guests