OpenXcom Forum

OpenXcom => Troubleshooting => Topic started by: hansimmer on October 04, 2015, 07:17:27 pm

Title: OS X 10.11 and CPU usage
Post by: hansimmer on October 04, 2015, 07:17:27 pm
Hello.

1. I have OpenXcom 1.0 and OS X 10.11. The fonts are not displayed correctly here. Does anyone know how to fix this?

2. I am running OpenXcom on a Macbook Pro 2015, 2.7 GHZ. The CPU usage is very high and the fans kick in immediately even in the options menu. Is that normal?

Thanks for your answers!
Title: Re: OS X 10.11 and CPU usage
Post by: hansimmer on October 05, 2015, 07:55:04 pm
This is what it looks like. Any ideas?
Title: Re: OS X 10.11 and CPU usage
Post by: Arthanor on October 05, 2015, 08:08:05 pm
Crazy resolution! I could fit almost fit 9 of my laptop's screen in one of yours..!

My guess is that you have a display filter enabled (check in options -> video) as that changes the way things are displayed and also uses a lot of cpu. And the higher the resolution of your game, the more work the filter has to do..
Title: Re: OS X 10.11 and CPU usage
Post by: yrizoud on October 05, 2015, 08:14:32 pm
I think some filters have issues when you use them with different zoom factors than they are designed for (like a scale3x algorithm on a 4x zoom)

You can also try one of the OpenGL filters (the ones with a *), if it's implemented efficiently on your platform, it should be less expensive than the software filters.
Title: Re: OS X 10.11 and CPU usage
Post by: Warboy1982 on October 06, 2015, 02:06:19 am
try either disabling the opengl filter and using the frame rate limit, or enable vsync in your config.
Title: Re: OS X 10.11 and CPU usage
Post by: hansimmer on October 06, 2015, 09:22:47 pm
Thanks for your help everyone! I played around with the settings, although without any success. Disabling the opengl filters causes even more cpu load. Changing the resolution to whatever (even 640*480) has no noticeable effect. However, running OpenXcom in windowed mode (no matter what resolution) helps a lot. Switching back to fullscreen instantly increases cpu power consumption by 200% and the temperature raises from around 60 °C to almost 100 °C (idle is between 35 and 40). I think the CPU will shut down at 105. I also tried limiting the frame rate to 30 fps or lower, also without any noticeable effect. I did not find the vsync setting.
Title: Re: OS X 10.11 and CPU usage
Post by: Arthanor on October 06, 2015, 09:37:32 pm
The "looks" issue is certainly a filter issue. As a first step, try to use no filters to get the default look.

When you run in windowed mode, the window is the size dictated by the resolution you request from the game. Lower resolution, smaller window, higher resolution, bigger window. The one thing that doesn't change is that 1 game pixel = 1screen pixel.

When you run in full screen mode, the resolution is "stretched", so it is no longer true that 1 game pixel = 1 screen pixel, instead, 1 game pixel = # of screen pixel/# of game pixels. This means your computer has to convert "on the fly" and I know for me it just crashes the game since my computer sucks. It sounds like yours can handle it, but doing the colours conversion for every pixel multiple times a second is causing you crazy cpu load.

Long story short, what happens when:
1- you run in windowed mode, at native resolution, no filter?
2- you run in full screen, at native resolution, with no filter?

The game should look tiny surrounded by a lot of black. You should then be able to use the battlescape and geoscape scalings (I can't remember the exact term, but it's in the video options. Something like 3x game and 1/3 display) to make the game more visible.
Title: Re: OS X 10.11 and CPU usage
Post by: hansimmer on October 06, 2015, 10:24:34 pm
Arthanor: Thank you very much for your answer. I disabled the filter, but the look is still the same, as you can see in the attached screenshot. Only difference is, that the frame rate drops to 15. Choosing one of the other filters does not change the fonts either.

I understand the pixel conversion issue and why it can cause more cpu load. I think the retina display or the way the OS handles the resolution is the problem. Sadly, I was not able to fix it. The native resolution is 2560*1600. The OS by default can scale to 1024*640, 1280*800 (which is standard), 1440* 900 and 1680*1050. With a little tool called Retina Displaymenu you have access to all kinds of supported resolutions. I tried setting the display to the native resolution and a few others. The result is always the same: windowed mode is ok, although in 2560*1600 the cpu gets a little hot as well. In fullscreen mode, the temperature goes through the roof (especially in 2560*1600). I always set the game resolution to the system resolution. So in theory, with 1280 system and game resolution, there should be no pixel conversion that can cause that much cpu load. Instead, there should just be pixel doubleing. I guess there must be some kind of scaling going on in the background, that I don't understand - even when set to 1280.

Warboy1982: I found the vsync setting in options.cfg. It was already switched on.
Title: Re: OS X 10.11 and CPU usage
Post by: darklord42 on October 17, 2015, 04:14:30 am
The font issue looks very much like what RedEclipse is suffering.  They said it looks like a driver issue. 
https://redeclipse.net/forum/viewtopic.php?f=7&t=816&sid=544e3d75840d2b81d559315ae24da2fa

Apple also changed their system font, I don't know if that could have possible affected it.

Also I should note, it's nothing to do with high res retina displays, and is a problem with 10.11 in general.  I have the same thing on my my 5 year old laptop with my non retina display 1680x1050x
Title: Re: OS X 10.11 and CPU usage
Post by: hansimmer on October 19, 2015, 03:44:05 pm
darklord42: Thanks for the info. A driver issue makes sense. I still don't have a clue, why the temperature goes up that much in full screen mode. The problem does not exist in other games, for example GZDoom. That one runs in full screen 1440*900 and the temperature stays below 40°C.
Title: Re: OS X 10.11 and CPU usage
Post by: darklord42 on October 20, 2015, 07:08:18 am
As to strange heating increases.  IDK. According to the Activity Monitor, on my 5 year old macbook pro, with 2 I7s,  OpenXCom is using a constant 130% of my CPU.   By comparison, running the original game in Boxer (OSX focused version of dosbox using Cocoa/Objective-C and other OSX technologies) only uses 30-50%.  And that is full on Emulation...  It would explain the heat...   Why does OpenXCom use the CPU so much?   Boxer uses shaders too.. (even much less efficiently then OpenXcom and runs slow.)
Title: Re: OS X 10.11 and CPU usage
Post by: hansimmer on October 20, 2015, 11:19:36 pm
Does your CPU get so hot in full screen mode, that it is close to shutting itself down? What happens when you run OpenXcom in window mode? Very little heat increase I guess.
Title: Re: OS X 10.11 and CPU usage
Post by: darklord42 on October 21, 2015, 12:22:54 am
Honestly no, it doesn't seem to be shutting down...  But it does run hot.  (Note: Apple laptops almost always run hot when using the cpu...)  I didn't run it for all that long though..It's not playable as with the font issue, and boxer lets me use coremidi with the timbres of heaven soundfont.
I don't think there is a difference in cpu usage from window to fullscreen. (though it is hard to take a look at the activity monitor while in full screen, i have to go to windowed, alt enter, and look quickly) If I had to guess, I wouldn't think it's rendering...
Title: Re: OS X 10.11 and CPU usage
Post by: hansimmer on October 21, 2015, 10:42:51 pm
Yes, it is difficult to monitor anything when in fullscreen mode. I use Intel Power Gadget to check temperature, cpu clock and energy consumption in the background.

https://software.intel.com/en-us/articles/intel-power-gadget-20

This is what it looks like, when i switch from windowed mode to fullscreen for 30 seconds and then back to windowed mode. The temperature would have climbed steadily of course if I stayed in fullscreen. I didn't do anything in the game - I just looked at the main menu for 30 seconds. ;)

Driver issue or bug maybe?
Title: Re: OS X 10.11 and CPU usage
Post by: darklord42 on October 22, 2015, 05:42:07 am
Bug certainly.  Xcom shouldn't be this intensive on the CPU... I don't think it's a  driver issue, or it would be the GPU that would be getting cooked, not the CPU, right?
Title: Re: OS X 10.11 and CPU usage
Post by: darklord42 on October 22, 2015, 06:48:28 pm
Wait, for clarification, you had the font issue in 10.10?!  When I used it then, it worked fine... I was certain it was a 10.11 issue.
Title: Re: OS X 10.11 and CPU usage
Post by: hansimmer on October 23, 2015, 12:46:38 am
I think they are both getting cooked, CPU and GPU. Please look at the screenshot I posted below (same as yesterday, Intel Power Gadget). The strange thing is, that the CPU frequency stays very low in fullscreen mode - even lower than in windowed mode, although the CPU consumes 3x the energy and heats up quickly. I have no idea how this is possible and why. At the same time, in fullscreen mode, the GPU frequency is as high as it can be (it is the green GT graph). The difference here between windowed and fullscreen mode does not seem a lot, but the GPU is clearly running at 100% in fullscreen mode all the time.

I also attached two screenshots of Macs Fan Control - one before and one after a few seconds of fullscreen mode (main menu, just looking at the buttons again and not doing anything). The CPU increase is about 40 C° and the GPU is 37 C°. Even the SSD gets a little hotter, but that might be due to the whole system heating up. 
Title: Re: OS X 10.11 and CPU usage
Post by: darklord42 on October 23, 2015, 06:37:12 am
Wow, tosty... That ain't right, something has to be wrong there.  It is strange, if it were a Driver issue, you would think other games would be suffering the same thing?  I really don't know.
Title: Re: OS X 10.11 and CPU usage
Post by: darklord42 on October 24, 2015, 04:34:08 pm
On the RedEclipse thread, they are claiming it will be a long while for Apple to fix their bug and are hoping it is fixed in the latest SDL 2 release which OpenXcom doesn't use.  Thing is, I haven't noticed any font issues in any other SDL1 apps so it may be unrelated.
Title: Re: OS X 10.11 and CPU usage
Post by: hansimmer on October 24, 2015, 05:43:52 pm
Ok. I actually don't care so much for the font, because the game is still playable. However, the heating problem concerns me. I don't want to kill my laptop. My iMac already died a few months back soon after the system reported a broken gpu diode sensor. I will not play OpenXcom in fullscreen until I know what is going on. There must be other Mac users here. Did anyone else notice heating problems?
Title: Re: OS X 10.11 and CPU usage
Post by: darklord42 on January 17, 2016, 06:36:00 pm
These really are bad bugs that can't be ignored.  They basically make the project unusable for modern OSX.  Please, please look into it.