Author Topic: [fixed] Major lag & 100% CPU usage in 3.3.5  (Read 2689 times)

Rylar22

  • Guest
[fixed] Major lag & 100% CPU usage in 3.3.5
« on: 7 July 2010, 03:15:44 »
Having played Glest for a while and moving on to Mega Glest, I've been looking forward to multi-player Glest for a long time. I was very excited to see this new feature because this is just what open source gaming needs to compete with commercial games.

Mega Glest 3.3.4 ran great on my machine. I could even use max detail settings with out any change in game performance. The loading was a bit slow on the main screen, I assumed because of all the stupid intro affects, but nothing major. However, in game the game play was smooth and flawless. Upgrading to the new version has caused a 20 fold drop in frame rates and a massive increase in CPU usage. In fact, it now uses so much CPU that the game in an idle game screen with nothing moving consumes 100% of my 2 gig CPU permanently.

Is there anything I can do to get the current version of MegaGlest to run as well as the last version? I tried turning down all the detail settings and running the game in extreme low resolution, but it consumes just as many resources with minimum settings as it did with max settings. I'm running the latest version of 32 bit Ubuntu with the 32 bit installer downloaded from SF.

ultifd

  • Airship
  • ********
  • Posts: 4,443
  • The Glest Video Guy :) The one and only. :P
    • View Profile
    • My Youtube Channel
Re: Major lag & 100% CPU usage in 3.3.5
« Reply #1 on: 7 July 2010, 03:22:31 »
Hmm, well...all I can say is that..maybe the updated version which is coming later will help. We might need more specifics if this is a big issue. For me, I never really check the CPU usage because that is kinda hard...if you play full screen.  :|
You are sure that it was megaglest that was the CPU usage? not any other applications right? Just wondering...

Well...for Windows I did not notice anything like this. Then again, it is Windows by M$$...Let's see if others with Ubuntu have the same or similar problem.  :|

Good Luck?

Rylar22

  • Guest
Re: Major lag & 100% CPU usage in 3.3.5
« Reply #2 on: 7 July 2010, 03:58:40 »
Full screen apps in the latest version of Ubuntu cause a blank screen so I've had to play Glest (and Wesnoth for that matter) in windowed mode. A bit annoying from an ambiance point of view. But, very helpful to see my CPU monitor. Yes, I'm certain it was mega-glest 3.3.5 using 100% of the CPU. I ran 3.3.4 and it ran like a champ. It sounds very similar to the other post about Intel hardware. I will try again with another machine later (a desktop) and see how it runs.

Obviously, if it's just some new features needing a more expensive machine, that is understandable, but given the huge difference in performance from 3.3.4 and 3.3.5 I figured I should report my experience.


Little Helper

  • Guest
Re: Major lag & 100% CPU usage in 3.3.5
« Reply #3 on: 7 July 2010, 04:13:21 »
Well it kind of depends on what mod you are using too right? Truthfuly MG did drop some FPS well thats my view. Everyone has different computers with hundreds to thousands of files.
TRY GAME DEFRAG. :)

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Re: Major lag & 100% CPU usage in 3.3.5
« Reply #4 on: 7 July 2010, 05:47:32 »
Yes admitedly there are some things I'm lookign at to try to track it down. I hope to get something figured out in the near future.

Julius

  • Summoner
  • **
  • Posts: 46
    • View Profile
Re: Major lag & 100% CPU usage in 3.3.5
« Reply #5 on: 7 July 2010, 08:38:25 »
Full screen apps in the latest version of Ubuntu cause a blank screen so I've had to play Glest (and Wesnoth for that matter) in windowed mode. A bit annoying from an ambiance point of view. But, very helpful to see my CPU monitor. Yes, I'm certain it was mega-glest 3.3.5 using 100% of the CPU. I ran 3.3.4 and it ran like a champ. It sounds very similar to the other post about Intel hardware. I will try again with another machine later (a desktop) and see how it runs.

Obviously, if it's just some new features needing a more expensive machine, that is understandable, but given the huge difference in performance from 3.3.4 and 3.3.5 I figured I should report my experience.


Have you tried to disable compiz (desktop effects)? It can cause strange effects with OpenGL games, likely also causing your black screen problem.

hairy cat

  • Guest
Re: Major lag & 100% CPU usage in 3.3.5
« Reply #6 on: 7 July 2010, 09:10:12 »
well, this might not help, but i had the same problem or almost, so i deleted everything and redownloaded it, reinstalled it and it worked great!

ultifd

  • Airship
  • ********
  • Posts: 4,443
  • The Glest Video Guy :) The one and only. :P
    • View Profile
    • My Youtube Channel
Re: Major lag & 100% CPU usage in 3.3.5
« Reply #7 on: 7 July 2010, 19:39:07 »
Quote from: Softcoder from rev.642
- attempt to improve rendering speed by rolling back render code to be more like 3.3.4
So I guess we will see.  ;)  :O Hope this doesn't make it slower for others...  :|

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Re: Major lag & 100% CPU usage in 3.3.5
« Reply #8 on: 8 July 2010, 00:18:33 »
Ok please try 3.3.5.1-alpha1 as we have tried to address this somewhat (not fully).

silnarm

  • GAE Team
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: Major lag & 100% CPU usage in 3.3.5
« Reply #9 on: 14 July 2010, 12:56:05 »
You may not want to see this softcoder, but here's the results of a two minute profile with branches/release3.3.5.1 @ rev670



It looks suspiciously like streflop is the cause of the problems.

Some attention to the Glest functions high on the list will certainly help, but streflop is a killer.
Glest Advanced Engine - Code Monkey

Timeline | Downloads

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Re: Major lag & 100% CPU usage in 3.3.5
« Reply #10 on: 18 July 2010, 05:37:18 »
The next Alpha coming soon should correct some of the performance issues further. Please read the FAQ sticky topic also regarding disabling Compiz (if enhabled) as it is some cases drastically kills your 3D performance.

Rylar22

  • Guest
Re: Major lag & 100% CPU usage in 3.3.5
« Reply #11 on: 1 August 2010, 18:12:38 »
I'm happy to give megaglest alpha another run. As for compiz, my compiz has been set to "none" due to design weaknesses in compiz. The blanking of the screen is an ubuntu bug relating to power management unrelated to glest and hopefully fixed sooner or later.

I saw the downloads for installing the patch. Is there a download to install the latest alpha version after having completely removed megaglest? Or, should I download and install from the current installer and then download and execute the patch?


tomreyn

  • Local Moderator
  • Airship
  • ********
  • Posts: 2,764
    • View Profile
    • MegaGlest - the free and open source cross platform 3D real-time strategy game
Re: Major lag & 100% CPU usage in 3.3.5
« Reply #12 on: 2 August 2010, 09:42:33 »
Rylar22, first let me say I experienced the same as you did with 3.3.5. My CPU resource consumption went pretty high and a lot of RAM was being used and/or swapped to disk.

I do, however, not have decent hardware on the system I was testing with, and I had not played much with previous releases  so I concluded that the high resource consumption had to be related to my hardware (and I still think it is to a high degree). I also started a related thread on Intel GPU performance. I should note that those GPUs are known to perform badly because of their lack of dedicated memory - having to share memory for graphics processing with RAM means a lot of front side bus bandwidth gets dedicated to memory management, transfers take considerably longer than on dedicated GPU RAM, and when there is much FSB bandwidth in use, less remains for other concurrent processes - as well as for offloading calculations to the CPU, which even more so reduces available FSB bandwidth and slows down GPU calculations (but then, being directly mounted to the GPU instead of being an add-in card makes things faster again, but not enough to compensate). For office work this doesn't matter at all, and not that much for 2D games, but it sure does matter for 3D games like MegaGlest is one.

But then, based on what you wrote, you are probably not actually using a shared memory GPU but some dedicated one. And, more importantly, you are comparing how two different versions perform, the old one of which you say performed good, and the new one which does not. I think this should make it unnecessary to further inspect your hardware for now (other than for determining the reasons of the slowdown if it was unique to your system setup), though it would still be of interest to me.

I can confirm that on Ubuntu 10.04, which I run, too, the 3.3.5 release was rather slow and resource hungry. Luckily this has improved measurably since (in development builds), and while the game still increases my overall CPU load to up to 100% (of 200% possible on this dual core system), this is less than before, and memory resource consumption has decreased a lot (no more than 512M now), and at the same time, FPS has increased by about one third over 3.3.5.0 for me.

I think there will soon be a 3.3.5.1 (actually this may get renamed to 3.3.6 instead since it also introduces new features) which fixes this and several other issues. Until then, there will be at least one more alpha release (probably sometime tonight in terms of central US time), so I recommend you give those a try - or wait for the next release/bug fix (which may take some more weeks - and that's just my personal guess, not being one of the core developers).
« Last Edit: 2 August 2010, 09:59:23 by tomreyn »
atibox: Ryzen 1800X (8 cores @3.6GHz), 32 GB RAM, MSI Radeon RX 580 Gaming X 8G, PCI subsystem ID [1462:3417], (Radeon RX 580 chipset, POLARIS10) @3440x1440; latest stable Ubuntu release, (open source) radeon (amdgpu) / mesa video driver
atibox (old): Core2Quad Q9400 (4 cores @2.66GHz), 8 GB RAM, XFX HD-467X-DDF2, PCI subsystem ID [1682:2931], (Radeon HD 4670, RV730 XT) @1680x1050; latest stable Ubuntu release, (open source) radeon / mesa video driver
notebook: HP envy13d020ng
internet access: VDSL2+

· · · How YOU can contribute to MG · Latest development snapshot · How to build yourself · Megapack techtree · Currently hosted MG games · · ·

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: Major lag & 100% CPU usage in 3.3.5
« Reply #13 on: 2 August 2010, 10:10:32 »
Thanks silnarm for mentioning this tool! Looks like its also available for linux!
http://developer.amd.com/cpu/codeanalyst/codeanalystlinux/Pages/default.aspx
This will hopefully really help us to find the performance trouble.

But for the things you see there, I'm not really shure that libstreflop is the main reason. Of course it takes obviously a lot of ressources, but all these calculations happen in every method of the program! So its no wonder its called very often and takes a lot of cpu time.
But you are right it doesn't really look good, I hope softcoder already found something and the current svn version looks a bit better.
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios