Sign in to follow this  
Juliean

Poor performance

Recommended Posts

Hi,

I've recently come to a point where my game suddently only ran at 22-26 fps (both debug and release mode) instead of 50(debug) - 179 (release). First of all, I know that measuring fps isnt the best way, but obviously the game isnt running fluently anymore, and its quite a huge drop. Also, given that both debug and release mode make no difference at all anymore, it is quite obvious that the cpu isn't guilty, too. This alone makes my problem seem rather strange, because this is what I've got running on my gpu recently:

- 1 simple cube and one 100k tri skybox (only models in game)
- Hdr tonemapping and atmospheric scattering
- deferred rendering (1 ambient light source)
- Basic postprocessing pipeline (no effects applied)

To be honest, I wasnt satisfied with the performance in first place. But now, I'm totally desperate. What could have gone wrong? I remember a day ago running my game with 60 fps in debug mode, and on the next day it was that slow. I didnt change much in the meanwhile, just playing around with ssao, but resetting my shaders didnt help much.

So, does anyone have some idea what could be wrong? My system is an C2D E8400 and one Geforce 260gtx. More than enough power to handle a simple game! Only thing I did was re-install directx sdk because controll panel wasnt working anymore.. Could this be the cause? Thanks in advance for any ideas!

Share this post


Link to post
Share on other sites
What DirectX version are you using? Have you enabled the debug layer? Any errors/warnings?

One or some of your shaders is probably causing unnecessary overhead, or your doing something weird on CPU side... Use a profiling tool to see if your either CPU/GPU bound, from there you will know what part of the game is causing the slow down and hopefully you will be able to fix it

Share this post


Link to post
Share on other sites
I am using DirectX9, and yes, I tried both enabeling/disabling debug mode and debug
output. No errors and no warnings except
of some redundant state changes (which were there since I started using effect files).

As I said, I'm certainly not cpu bound. Debug/release mode doesnt change anything, and so does deactivating my whole game logic. As Im only doing 2 draw calls, cpu is most likely innocent.

The weird thing is, I really dont have any shaders that could cause much overhead. I am drawing only one cube ambient lighted, so this isnt likely the bottleneck, and otherwise.. Atmospheric scattering has been used by me for quite some time without changes and a decent speed, so again, no incident on a bottleneck. Hdr, my last complex shader (all the other just read some texture and output it to the model) doesnt do any complex calculations/other stuff too, so its not very likely, too. I quess I can't say that for sure until I profile, which I can't do until the weekend.. By the way, are there any other gpu profilers other than PIX (which has never been working for me for no reason).

Any more suggestions on what could cause this bottleneck (it definately isnt the cpu)?

Share this post


Link to post
Share on other sites
nVidia PerfHUD is a great profiler if you have a nVidia GPU. ATI has the GPU PerfStudio but I'm not sure if it supports DirectX 9.
There's also Intel GPA.

In PerfHUD you can see which draw calls are using more CPU/GPU time, when you know which one is maybe you can post your shaders and someone might be able to help you

Share this post


Link to post
Share on other sites
@TiegoCosta: I am already using PerfHud, it is really great but the profiling unit isnt working. Ive read something about that I need to use a certain instrumented driver (windows xp). Is this true?

@Daniel_RT: Yes, this is one of the features im going to implent soon, however as I said Im only rendering one cube and a skysphere, so this isnt going to save anything at all. Definately not vertex bound ;)

Some more suggestions about what could be wrong?

Share this post


Link to post
Share on other sites
[quote name='The King2' timestamp='1318362643' post='4871571']
@TiegoCosta: I am already using PerfHud, it is really great but the profiling unit isnt working. Ive read something about that I need to use a certain instrumented driver (windows xp). Is this true?
[/quote]

Yes, but when you install PerfHUD, the driver instrumentation is also installed. You just have to run/enable it. Also make sure that your driver is compatible with PerfHUD

Share this post


Link to post
Share on other sites
Ah, I see. Will the newest nvidia driver be compatible with PerfHUD? Or do I have to install an older driver (please no..)?

Additionally, I forget to menation one thing. On my titlescreen, I also have a highly reduced performance. I used to have around 2000 fps drawing just 5 textured quads and 3 lines of text. Now I only get around 200 fps! So shaders are almost out of question, as I only use a simple shader for Outputting vertex position and the texture for the quads. There is no stuff from the game itself loaded so far, I'm using a nice OO scene design :)

This begins to occur really strange to me. Could it be a software defect of my pc? Though Im not reaching the 60fps mark on my titlescreen, it still takes 10 times longer than before to render everything.. Some more ideas?

Share this post


Link to post
Share on other sites
[quote name='The King2' timestamp='1318433876' post='4871878']
Ah, I see. Will the newest nvidia driver be compatible with PerfHUD? Or do I have to install an older driver (please no..)?
[/quote]
I'm not sure... try it using the most recent driver then try this:
[quote]
[i]XP builds of PerfKit 6.62 include an instrumented version of the 195.62 driver.
[/quote]
Maybe you have to use driver 195.62 on XP... Btw, when you uninstall PerfHUD you have to mannually delete registries entries related to PerfHUD
[/i]
[quote name='The King2' timestamp='1318433876' post='4871878']
This begins to occur really strange to me. Could it be a software defect of my pc? Though Im not reaching the 60fps mark on my titlescreen, it still takes 10 times longer than before to render everything.. Some more ideas?
[/quote]
Maybe the driver you have installed has some kind of bug... Try different drivers

Are you running your game on a notebook?? If so, maybe your notebook uses switchable graphics and its running your game on integrated graphics instead of the GPU...

Share this post


Link to post
Share on other sites
[quote name='The King2' timestamp='1318357307' post='4871528']
To be honest, I wasnt satisfied with the performance in first place. But now, I'm totally desperate. What could have gone wrong? I remember a day ago running my game with 60 fps in debug mode, and on the next day it was that slow. I didnt change much in the meanwhile, just playing around with ssao, but resetting my shaders didnt help much.
[/quote]


If you are using version control, just update to the previous revision (to make sure it's still 60fps). Then a quick scan over the last couple of commits will immediately highlight the problem.
If you're not using version control, it might be a good time to start using it! (because your only other option is to use a profiler to help identify the hot spots)

Share this post


Link to post
Share on other sites
[quote name='The King2' timestamp='1318357307' post='4871528']I've recently come to a point where my game suddently only ran at 22-26 fps (both debug and release mode) instead of 50(debug) - 179 (release). [/quote]Perhaps it's just coincidence but I also had a drop a few weeks ago (I'm hitting 14 fps in debug now). I've spent the whole day running through the profiler and I have only managed some minimal gains (about 8%).


Have you managed to run PerfHud or PIX?
What is your CPU and core load?

Share this post


Link to post
Share on other sites
@TiagoCosta: thanks, I'll give it a try! No, I'm running on desktop, I doubt there'd be a notebook with a 260gtx graphics chip.. ;)

@RobTheBloke: Unfortunately I didn't use any version control. However Ill probably start using it now, seems like a great idea..

@Krohm: well, unfortunate for you, but good to see I'm not alone.. I didnt get perfHUD to
work yet, and I'll have no option to do so till saturday.. CPU and core load are marginal, especially on my titlescreen there is no chance on earth my 3ghz core2duo could be the cap, there is only a minimum cpu work involved..

@Kobo: Well now you say it i got to thinking, though I'm sure I ran Crysis 2 the same day with normal speed to test out my new monitor (2560x1600 px resolution, that alone reduced the performance of my program from 80 tp 60..). Would it help that, given I don't manage to allocate the bug myself, I upload my exe
for you to test out? Maybe it is my machine after all.

At this point I would like to say thanks for all the help! I'd be really disappointed if my dream of making my own (3d)game would die because of some odd performance issue..

Share this post


Link to post
Share on other sites
Hm, that could be anything :(

It won't probably help you, but I've already noticed sometimes in the past illogical drops in performance and the causes were:

- DirectX debug runtimes with the highest output level, writing tons of "redundant state changes" warnings (the state changes weren't the performance problem, it was the slow writing to the output window). But you said you tried enabling and disabling debug runtimes, so this won't be it for you.
- I'm noticing a quite noticable drop in FPS when my application is running in a window and there's a partly transparent Miranda (messanger) window somewhere else on the screen. But again, this is just a shoot in the dark, just to show you that the source can be in the least expected place.

Share this post


Link to post
Share on other sites
I just got home and tried out my app.. and quess what! I've got 80 FPS again all the sudden, with all models loaded (200k tris total). It seems like it was a problem with my machine after all. Well, still I'm not too happy with the performance, as I'll probably be fill-rate limited pretty soon (FPS stay the same with or without my 200k models (consisting of 50 vertex buffer/texture switches; each postprocessing-effect takes significant time to proceed, even with downsampling). However I'm ready to go again. Thanks for all the help though!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this