The International Simutrans Forum

 

Author Topic: Performance problems under Linux (Xubuntu 12.10_x64)  (Read 15820 times)

0 Members and 1 Guest are viewing this topic.

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4596
  • Languages: EN, DE, AT
Re: Performance problems under Linux (Xubuntu 12.10_x64)
« Reply #35 on: January 29, 2013, 06:49:50 PM »
Maybe you need to install 64bit version of this library?

Offline donjuan

  • *
  • Posts: 13
  • Languages: EN,GER
Re: Performance problems under Linux (Xubuntu 12.10_x64)
« Reply #36 on: January 29, 2013, 08:01:15 PM »
The solution was, to manually download the 32-Bit-Editions of  "libsdl-mixer1.2_1.2.12-3" and "libbz2-1.0_1.0.6-4" from http://packages.debian.org, just for the log. Now everything works fine, like a few days ago.

But i need help with my compiled code (remember, i am no programmer, but i want to help). Check if i do right:
1. Copy file with the name "sim" in ./trunk/build/default ,  to ./trunk/simutrans
2. Download pak64 to ./trunk/simutrans
3. Try to start it in terminal (but it doesn't start). Terminal output is:
Code: [Select]
user@P67A-UD3-B3:~/trunk/simutrans$ ./sim
Use work dir /home/user/trunk/simutrans/
Reading low level config data ...
parse_simuconf() at config/simuconf.tab: Reading simuconf.tab successful!
Preparing display ...
Loading font 'font/prop.fnt'
font/prop.fnt successfully loaded as old format prop font!
Init done.
user@P67A-UD3-B3:~/trunk/simutrans$

What do i wrong?

Offline Markohs

  • DevTeam, Coder/patcher
  • Devotees (Inactive)
  • *
  • Posts: 1559
  • Languages: EN,ES,CAT
Re: Performance problems under Linux (Xubuntu 12.10_x64)
« Reply #37 on: January 29, 2013, 08:26:07 PM »
execute the ../get_lang_files.sh insode the folder you copied "sim", I think will be enough. Thanks your your help donjuan!

Offline donjuan

  • *
  • Posts: 13
  • Languages: EN,GER
Re: Performance problems under Linux (Xubuntu 12.10_x64)
« Reply #38 on: January 29, 2013, 09:00:06 PM »
I've copied "get_lang_files.sh" to ./trunk/simutrans and ./trunk/simutrans/text (i guess the lang. file must be in there) and executed it. The language-files are installed, but  when i start "sim" i get the same output as before.

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4596
  • Languages: EN, DE, AT
Re: Performance problems under Linux (Xubuntu 12.10_x64)
« Reply #39 on: January 30, 2013, 07:39:18 AM »
You have to start get_lang_files in the trunk/ directory (ie in its original location, no copying of script-file necessary)

Offline whoami

  • Devotees (Inactive)
  • *
  • Posts: 693
Re: Performance problems under Linux (Xubuntu 12.10_x64)
« Reply #40 on: January 30, 2013, 09:46:31 AM »
Regarding performance: It seems that nobody yet mentioned the binding (Windows: affinity) of the ST process (threads) to one CPU core, which in itself may improve performance by better cache usage patterns, but also allows to set only one core to maximum performance (same for two cores, if multithreading is enabled).

Offline donjuan

  • *
  • Posts: 13
  • Languages: EN,GER
Re: Performance problems under Linux (Xubuntu 12.10_x64)
« Reply #41 on: January 30, 2013, 03:26:36 PM »
Quote
You have to start get_lang_files in the trunk/ directory (ie in its original location, no copying of script-file necessary)
Yes, thats right (I havent read the script yesterday). All lang-files are correctly stored to "./simutrans/text" but it still doesn't work.

I even tried to place the self-compiled "sim"-file to a gcc3-nighly-build directory - with no success. I think that this have to work, because my "sim"-file and the original simutrans-file are depending on the same directory structure. Maybe this proof that the problem is my "sim"-file itself ?

An idea: To finally test the hack of Markohs, can somebody send me an e-mail with a working modified st-package, that i can test on my system? (I reveal my email-adress by pm)

Offline Markohs

  • DevTeam, Coder/patcher
  • Devotees (Inactive)
  • *
  • Posts: 1559
  • Languages: EN,ES,CAT
Re: Performance problems under Linux (Xubuntu 12.10_x64)
« Reply #42 on: January 30, 2013, 03:34:21 PM »
mmm... I tested the fix and it isn't working. I have to make a few modifications to the code still, when I have a solution I'll contact you. Thanks for your time, donjuan. :)

Offline captain crunch

  • *
  • Posts: 116
Re: Performance problems under Linux (Xubuntu 12.10_x64)
« Reply #43 on: March 01, 2013, 09:27:13 PM »
Today when I noticed that simutrans 111.2 runs unreasonably slow on my 1.7GHz
Celeron M laptop under Ubuntu Precise, I found this thread when looking for
possible solutions.
  Interestingly, I tried running the win32 version with wine and I am
flabbergasted that it works very well this way.
  As far as I know the Celeron M does not support frequency scaling, at least I
could not activate it with the tools supplied by Ubuntu Precise. Also the
Celeron M has only one core (-8.
HTH

Offline whoami

  • Devotees (Inactive)
  • *
  • Posts: 693
Re: Performance problems under Linux (Xubuntu 12.10_x64)
« Reply #44 on: March 01, 2013, 09:34:41 PM »
Did you run it with (edit:) parameters "-nomidi" and "-nosound" on Linux? This is the work-around for a well-known performance problem with sound output.
« Last Edit: March 01, 2013, 09:40:05 PM by whoami »

Offline captain crunch

  • *
  • Posts: 116
Re: Performance problems under Linux (Xubuntu 12.10_x64)
« Reply #45 on: March 01, 2013, 10:47:46 PM »
Did you run it with (edit:) parameters "-nomidi" and "-nosound" on
Linux?
Thanks for suggesting this, but this did not help very much. I noticed in wine
the MIDI sound is disabled upon program start and it is not working later.
Here is what I found:
Code: [Select]
Simutrans version/OS      fps   idle(ms) simloops  sound midi
111.2.2-1 Ubuntu Linux    4     25       4,3       off   off
111.2.2-1 Ubuntu Linux    3     25       3,0       on    on
112.1 r6212 W32 with wine 14    25       4,7       on    off



Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4596
  • Languages: EN, DE, AT
Re: Performance problems under Linux (Xubuntu 12.10_x64)
« Reply #46 on: March 02, 2013, 08:21:20 AM »
You could also try a recent nightly build, which should be a little faster than the last release.

I also ask you to upload your savegame. Maybe there are some unusual patterns in there, as sometimes also the style of playing matters.

Offline captain crunch

  • *
  • Posts: 116
Re: Performance problems under Linux (Xubuntu 12.10_x64)
« Reply #47 on: March 04, 2013, 05:23:52 PM »
You could also try a recent nightly build, which should be a little faster than the last release.
Yes, I built 112.1.1 Nightly from git for i386-linux-gnu configured with
"BACKEND=mixer_sdl". With this configuration I get 20fps and
4.1 simloops. I wonder what make the ubuntu packaged version run so much
slower, their config.default does not differ significantly.

I also ask you to upload your savegame. Maybe there are some unusual patterns in there, as sometimes also the style of playing matters.
It is only the savegame built into the pak and vanilla simconf.tab.


Offline Jando

  • *
  • Posts: 500
Re: Performance problems under Linux (Xubuntu 12.10_x64)
« Reply #48 on: June 02, 2014, 08:33:53 PM »
Apologies for posting in an old thread but the original post describes what I see in Linux Mint (Ubuntu fork) as well. 32 bit version Linux on a 2-core AMD CPU. Performance is very bad, especially when scrolling the map. Sadly makes Simutrans unplayable for me.

Downloaded Simutrans from Sourceforge, both version 112.3 and the new version 120 release candidate. Tried with Experimental as well (Thanks, James, for the new compiled Linux version). All versions have very bad performance, with Experimental sadly showing the worst performance.

2 observations (trees and passengers/pedestrians off):

- FPS drops really fast to 4 or 5 frames per second (from about 11 or 12) when the game is paused. Pausing the game makes performance worse. :)
- Both CPU cores are at 20-40% when running Simutrans.
« Last Edit: June 02, 2014, 08:44:11 PM by Jando »

Offline Miziiik

  • *
  • Posts: 84
    • Mizíííkův Simutrans
  • Languages: CZ, EN
Re: Performance problems under Linux (Xubuntu 12.10_x64)
« Reply #49 on: June 03, 2014, 07:12:31 AM »
What version of SDL do you use? Maybe it can be problem of SDL or another library (old version,...) I can post here my version compiled from latest SVN rep. on Ubuntu afternoon...

Odesláno z mého NEXT pomocí Tapatalk


Offline Jando

  • *
  • Posts: 500
Re: Performance problems under Linux (Xubuntu 12.10_x64)
« Reply #50 on: June 03, 2014, 09:13:03 AM »
What version of SDL do you use? Maybe it can be problem of SDL or another library (old version,...) I can post here my version compiled from latest SVN rep. on Ubuntu afternoon...

Odesláno z mého NEXT pomocí Tapatalk

I don't even know what SDL is. :)  It's just a standard Mint installation, kept up-to-date with the Mint Update Manager.

Offline Miziiik

  • *
  • Posts: 84
    • Mizíííkův Simutrans
  • Languages: CZ, EN
Re: Performance problems under Linux (Xubuntu 12.10_x64)
« Reply #51 on: June 03, 2014, 11:08:22 AM »
It' maybe that problem :D Wait 3 hours and I post here my binary and test it

Odesláno z mého NEXT pomocí Tapatalk


Offline Markohs

  • DevTeam, Coder/patcher
  • Devotees (Inactive)
  • *
  • Posts: 1559
  • Languages: EN,ES,CAT
Re: Performance problems under Linux (Xubuntu 12.10_x64)
« Reply #52 on: June 03, 2014, 12:14:52 PM »

 I wrote  this (page one) time ago, can you try it and see if it fixes your problem?

Can you please run:

cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

And post the result here?

 If it doesn't output "Performance", do:

echo "Performance" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

 And test the game again to see if we get any difference?

 You might need to do this for cpu0, cpu1,... all your cpu's:

EDIT: Extra reflexion:

...


Offline Jando

  • *
  • Posts: 500
Re: Performance problems under Linux (Xubuntu 12.10_x64)
« Reply #53 on: June 03, 2014, 12:42:32 PM »
I wrote  this (page one) time ago, can you try it and see if it fixes your problem?

Markohs, you're a genius. :) That completely fixes the problem.

Governor settings for both CPUs was OnDemand, after using your echo command the settings changed to Performance. Performance problem fixed for me.

Note for other people having the same problem: switch to root before using the echo command sequence, otherwise it won't let you use the command.

Edit: also my apologies for not spotting this solution on the first page of the thread. Somehow I missed it between all the other techno-speak. :)
« Last Edit: June 03, 2014, 12:52:04 PM by Jando »

Offline Markohs

  • DevTeam, Coder/patcher
  • Devotees (Inactive)
  • *
  • Posts: 1559
  • Languages: EN,ES,CAT
Re: Performance problems under Linux (Xubuntu 12.10_x64)
« Reply #54 on: June 04, 2014, 12:58:47 PM »
No problem :-D  I'm glad it helped you.