Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / CPU @ 100% when DarkGDK window overlapped by another window

Author
Message
Phoenix73
16
Years of Service
User Offline
Joined: 27th May 2008
Location: Australia
Posted: 7th Jul 2008 04:48
I am experimenting with Client/Server with Multisync at the moment and I noticed that when either the client or the server program's window was obscured, the CPU shot up to 100%.

To reproduce the problem, just use the DarkGDK template:



Then run it and put another window over the top of it - like windows explorer or anything for that matter.

On my machine the CPU shoots straight to 100% until you remove the overlapping window.

I've experimented and as long as one pixel of the DarkGDK window is uncovered all is well. But the second there is no part of the DarkGDK window showing the CPU goes mad...
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 7th Jul 2008 05:41
Strange, this always occurs for me with DBP apps. Haven't tested it with DarkGDK, will do later.

Codger
21
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 7th Jul 2008 06:39
On my machine the CPU usage goes from 6% with the window exposed and 50% with the window hidden

System
MacBook Pro
Windows XP Home on Boot Camp
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 7th Jul 2008 06:43 Edited at: 7th Jul 2008 06:43
Dual-core user I'm guessing?

Phoenix73
16
Years of Service
User Offline
Joined: 27th May 2008
Location: Australia
Posted: 7th Jul 2008 06:44
@Codger - it probably goes 50% because you have 2 cores or have hyperthreading enabled. From what I can see, DarkGDK is single-threaded so this would explain you not getting 100% utilisation. I also get 50% cpu utilisation on my dual core machine.
Phoenix73
16
Years of Service
User Offline
Joined: 27th May 2008
Location: Australia
Posted: 7th Jul 2008 06:45
@Benjamin - you beat me to it!
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 7th Jul 2008 19:38
The problem I see is that if I move a GDK game to my second monitor, it slooooowwwwwwwwwwssssssss wwwwwwaaaaaayyyyyy dddddddoooooowwwwwwwnnnnnn!!!!!

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 7th Jul 2008 21:29
That would be a lack of dual-monitor acceleration mode.
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 8th Jul 2008 00:03
Any cure for this?

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 8th Jul 2008 00:12
Well, on my NVIDIA card, it's on option in the driver control panel. But, I have a feeling yours won't have that. It might, though. Just check for something like "Single Monitor Acceleration".
Phoenix73
16
Years of Service
User Offline
Joined: 27th May 2008
Location: Australia
Posted: 8th Jul 2008 03:03
@Lilith - Does the GDK game slow down when part of the screen is displayed on the second monitor - or only when the entire window is on the second monitor?
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 8th Jul 2008 05:14
Both, if that's a valid answer. The monitors are identical and they're using the same video card.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 8th Jul 2008 06:03
This is the setting in the NVIDIA control panel. You'll have to find its ATI equivalent.

Attachments

Login to view attachments
Phoenix73
16
Years of Service
User Offline
Joined: 27th May 2008
Location: Australia
Posted: 8th Jul 2008 07:04
Aside from the dual-screen issue (which may be related) has anyone else been able to reproduce this error?
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 8th Jul 2008 07:05
Quote: "has anyone else been able to reproduce this error? "


Man, do I wish I had the second screen to do so.
Phoenix73
16
Years of Service
User Offline
Joined: 27th May 2008
Location: Australia
Posted: 8th Jul 2008 07:54
@Mahoney - I get this issue on just one monitor.
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 8th Jul 2008 08:15
Oh. Sorry. I thought you meant the dual-screen issue. I'll test it.
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 8th Jul 2008 08:17
Nope. CPU usage doesn't jump. On Vista Home Premium with Aero enabled.
Phoenix73
16
Years of Service
User Offline
Joined: 27th May 2008
Location: Australia
Posted: 8th Jul 2008 08:41
@Mahoney - what video card are you using?
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 8th Jul 2008 08:50
An 8600 GT.
Phoenix73
16
Years of Service
User Offline
Joined: 27th May 2008
Location: Australia
Posted: 8th Jul 2008 09:07
This is only happening on my 2 ATI machines - my one Intel graphics machine is OK.
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 8th Jul 2008 09:28
ATI driver issue, then.
Phoenix73
16
Years of Service
User Offline
Joined: 27th May 2008
Location: Australia
Posted: 8th Jul 2008 09:41
Just upgraded my ATI driver to the latest release. Maybe someone else with an ATI card can verify if they are having the issue.
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 8th Jul 2008 09:43
A recent bug, then.
Phoenix73
16
Years of Service
User Offline
Joined: 27th May 2008
Location: Australia
Posted: 8th Jul 2008 09:53
I don't think that the bug is recent as my laptop's ATI driver is quite old. Maybe this is a WinXP+ATI driver issue. We will just have to wait until someone else with WinXP+ATI test this out.
Phoenix73
16
Years of Service
User Offline
Joined: 27th May 2008
Location: Australia
Posted: 8th Jul 2008 09:54
@Benjamin - did you manage to retest this with GDK - as you have previously experienced this issue with DBP you test results would be very useful. Also, does your current environment still experience this issue with DBP?
sydbod
16
Years of Service
User Offline
Joined: 14th Jun 2008
Location: Just look at the picture
Posted: 8th Jul 2008 19:34 Edited at: 8th Jul 2008 19:36
For what it is worth:

The WW2 flight sim I am working on.

Game Window running in full screen mode rather than windowed mode.
ATI 9550 video card.

"Wait for vertical sysc" disabled in driver.

"dbSyncRate ( 0 );" Produces over 200+ FPS and CPU at 100%

"dbSyncRate ( 10 );" Produces 11 FPS and CPU is still at 100%

No matter how lightly I load things, the CPU is always running at 100%
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 8th Jul 2008 20:28
What processor do both of you have? Also, OS?
Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 8th Jul 2008 22:22
Quote: "ATI 9550 video card"


Hey, me too!

sydbod
16
Years of Service
User Offline
Joined: 14th Jun 2008
Location: Just look at the picture
Posted: 9th Jul 2008 05:28
On this machine: Slowest machine I have, it is test machine to confirm software runs fast enough on what I consider the lowest end machine that I will be developing for.

CPU Sempron 2200+ (Basically AthlonXP cpu type/ socket A /1.5GHz/166MHz FSB)
Operating System Win XP SP2.
Mem 2GB
Video ATI 9550 XT (a slightly faster version of the standard 9550)
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 9th Jul 2008 05:30
That's not that slow, actually. Our slowest is P4 1.5 Ghz with a GeForce 6200.

But, you have the problem on it, too?
sydbod
16
Years of Service
User Offline
Joined: 14th Jun 2008
Location: Just look at the picture
Posted: 9th Jul 2008 05:41
Yes I have same sorts of problems.

I only became aware of it when I included a function to redirect CPU %load to the debug status screen in the game, and found out that it was showing 100% all the time.

At first I thought I messed up the code, but Windows Task Manager confirmed what the extra code was displaying.

I may have to rat through my junk room and power up an Nvidia based machine when I get the time, to see what happens there.
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 9th Jul 2008 05:43
I'd test it on the 6200 machine, but it's going through a virus scan. My brother uses it, and apparently got some viruses. :/
Phoenix73
16
Years of Service
User Offline
Joined: 27th May 2008
Location: Australia
Posted: 9th Jul 2008 05:52
@Mahoney - I have three computers - two have the problem. Two are almost identical P4 WinXPSP2 machines. The only difference - the one having the problem has an ATI-X300 card - the other is just using onboard Intel graphics. My laptop is WinXPSP2-ATI-MobilityRadeon-X1600 Core2Duo and also has the problem. My testbed here seems to indicate this is at least a WinXP+ATI issue.

@Sydbod - I'm in Sydney on the 21st/22nd this month - will I be able to see you at the Opera House?
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 9th Jul 2008 05:58
Alright. Well, I guess I'm not much help in this, then. I only have NVIDIA and Intel.
sydbod
16
Years of Service
User Offline
Joined: 14th Jun 2008
Location: Just look at the picture
Posted: 9th Jul 2008 06:05
Quote: "@Sydbod - I'm in Sydney on the 21st/22nd this month - will I be able to see you at the Opera House? "


Well I am actually in the "LowLife Belt" outer western suburbs.....does that answer your question .

But if you look carefully at the arched roof structure when you get to the Opera House, you may still be able to see my footsteps from where I tried to run up the outside of the roof structure about 15 years ago.
Phoenix73
16
Years of Service
User Offline
Joined: 27th May 2008
Location: Australia
Posted: 9th Jul 2008 06:33
@sydbod - I wouldn't call it 'The LowLife Belt'! I'm not too snobby about 'The West'. I have lived in 'Sevo' (Seven Hills) for a while, 'Balko' (Baulkham Hills) for a bit, was born in Liverpool (South west now?), work (occasionally) in Parramatta and my parents live in Ryde (inner west?)... I even have friends in Luddenham (if that's far out west enough for you!) 'Just look at the picture' indeed!
sydbod
16
Years of Service
User Offline
Joined: 14th Jun 2008
Location: Just look at the picture
Posted: 9th Jul 2008 07:05
@Phoenix73 - Well I live in Erskine Park , just south of Mt Druit.

You obviously have not seen my front lawn........ if you did, you would agree with "LowLife Belt".
Phoenix73
16
Years of Service
User Offline
Joined: 27th May 2008
Location: Australia
Posted: 9th Jul 2008 09:27
@sydbod - Back on topic - you say:

Quote: ""dbSyncRate ( 0 );" Produces over 200+ FPS and CPU at 100%
"dbSyncRate ( 10 );" Produces 11 FPS and CPU is still at 100%
No matter how lightly I load things, the CPU is always running at 100%
"


Did you try to reproduce the issue with my code from the top of the post:
sydbod
16
Years of Service
User Offline
Joined: 14th Jun 2008
Location: Just look at the picture
Posted: 9th Jul 2008 16:14
Quote: "Did you try to reproduce the issue with my code from the top of the post:"


Yes I did.

If you minimize the window completely the CPU usage goes to 100%
If you totally cover the window the CPU usage goes to 100%

Otherwise CPU usage is only a few small % and the FPS is in the 80FPS range with the "Wait for Vertical Sync" DISABLED.
Phoenix73
16
Years of Service
User Offline
Joined: 27th May 2008
Location: Australia
Posted: 9th Jul 2008 17:52
@sydbod - Counting your one WinXPSp2 + ATI graphics machine along with my two WinXPSp2 + ATI graphics machines we have a total of three affected systems. How many do you think we need before this can be confirmed to be a bug?
Phoenix73
16
Years of Service
User Offline
Joined: 27th May 2008
Location: Australia
Posted: 9th Jul 2008 17:54
@Codger - Can you please confirm your O/S and video card?
Matt W
18
Years of Service
User Offline
Joined: 4th Mar 2006
Location:
Posted: 10th Jul 2008 00:22
Quote: "dbSyncRate ( 0 );" Produces over 200+ FPS and CPU at 100%
"dbSyncRate ( 10 );" Produces 11 FPS and CPU is still at 100%
No matter how lightly I load things, the CPU is always running at 100%"


You could try sleeping for a millisecond or two every loop
(I have no idea whether it's bad coding practice or not, but I do it )
sydbod
16
Years of Service
User Offline
Joined: 14th Jun 2008
Location: Just look at the picture
Posted: 10th Jul 2008 13:46
@Matt W
Quote: "You could try sleeping for a millisecond or two every loop "
Well that would be one way to solve a divide by zero problem I was having with my %CPU Usage routine when the loop was going full speed...... although I hate providing an artificial limit to the usage time that a CPU can operate for.

@Phoenix73
Quote: "How many do you think we need before this can be confirmed to be a bug? "

I dont think we can confirm it is a bug.
There may be a very good reason for this behaviour.
It may be some sort of optimising procedure where the behaviour we are seing is just a byproduct....... Just because it looks to be hapening with only ATI cards means nothing..... We do not see any failure (ie something that stops working properly).
Phoenix73
16
Years of Service
User Offline
Joined: 27th May 2008
Location: Australia
Posted: 10th Jul 2008 14:23
@sydbod - I agree that this might be a side effect of an optimization of some sort. E.g. A certain windows message is not sent to an invisible window to save cpu but darkgdk needs that event to time its redraw routine. Either way the end result is unintended and undesirable.
sydbod
16
Years of Service
User Offline
Joined: 14th Jun 2008
Location: Just look at the picture
Posted: 11th Jul 2008 09:46
@ Phoenix73,

Does it really matter if the game loop is going a a ZILLION FPS or whatever when one can not see it.

The actual redraw time should never be used for things like timing for movement, or other similar activities. Independent loop timers should be used for that.

My only concern is that at 100% CPU usage the background tasks that windows does (eg: the network data handling from the data buffers, out to the net and backflow data) may not get enough time to work properly.

Maybe the suggestion by "Matt W" to add a few millisecond sleep time may actually be a very good idea just in case.????
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 12th Jul 2008 12:44
I can't reproduce the hidden window or multi-screen behaviour (don't have 2 displays), but I can reproduce the minimised behaviour.

What I did to solve that is to change the dbSyncOn to dbSyncOff - this adds the sleep in during the dbSync automatically.

Try it on the hidden window scenario to see if it fixes it.

Phoenix73
16
Years of Service
User Offline
Joined: 27th May 2008
Location: Australia
Posted: 12th Jul 2008 13:03
@ianm - Thanks for the advice. I am just in an airport lounge now but will give this a try once I get home in front of my dev machine. Do you have any ideas why the gdk acts differently when the window is minimised?
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 12th Jul 2008 15:55
sydbod
16
Years of Service
User Offline
Joined: 14th Jun 2008
Location: Just look at the picture
Posted: 12th Jul 2008 16:20
Quote: "What I did to solve that is to change the dbSyncOn to dbSyncOff - this adds the sleep in during the dbSync automatically."


Most unusual results here using dbSyncOff()inside of a real time game.

Running my game now with "Wait For Vertical Sync" enabled in the video driver:
CPU Utilization ~90% and producing 60FPS.

Running the game now with "Wait For Vertical Sync" disabled in the video driver:
CPU Utilization ~80% and producing 180FPS.
Lower CPU utilization and 3 times the frame rate....strange.

With the lower 60 FPS in the above test, we should have expected around ~30% CPU utilization.

Login to post a reply

Server time is: 2024-11-20 17:32:04
Your offset time is: 2024-11-20 17:32:04