Skip to main content

Aiming for GPU limit

5 replies [Last post]
morne
Offline
Joined: 2008-03-22
Points: 0

I'm writing a small applet that will attempt to benchmark a user's GPU before they install my application. To do this, I'm trying to throw enough triangles at the screen that it's GPU limited at various resolutions, and comparing this against my dev machine to give a rough indication of how well the application will run.

At the moment, I'm rendering about 500k textured, lit triangles and up to 8 lights. Also included are 2 Behaviors, both of which WakeupOnElapsedFrames(0); one is a RotationInterpolator that animates the lights, one is a custom class that alters parameters in the TexCoordGeneration.

Right. So.

My problem is this : on my fairly elderly machine I get the same (or well within error) frame rate for both 800x600x32@85 and 2048x2536x32@65, a difference of 6.5x pixels - it's fairly clearly being limited by something other than the GPU. The task manager shows javaw.exe at a fairly consistent 98% or 99%.

I've tried profiling with Eclipse's TPTP, and I've read about avoiding 100% CPU. Apparently, Behaviors are the culprits, but I still get the same problem with both Behaviors absent from the scene graph.

I've tried various combinations of VirtualUniverse.setJ3DThreadPriority(Thread.MIN_PRIORITY) and View.setMinimumFrameCycleTime(...), but nothing is helping.

So, how can I encourage J3D to load the graphics system as much as possible, while loading the CPU as little as possible? Can I even do this?

Thanks,

\m/

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
aces
Offline
Joined: 2003-07-17
Points: 0

check your FPS with FRAPS.

I guess you have vsync on, locking frame rate to default 60Hz.

Also there is a recent thread about vsync on NVidia using CPU cycles, when it should release cpu and wait application.

morne
Offline
Joined: 2008-03-22
Points: 0

> check your FPS with FRAPS

At the moment I'm counting frames with another Behavior (a modified version of Selman's FpsBehavior). I think the Behavior is reliable enough for now.

> I guess you have vsync on, locking frame rate to default 60Hz.

Yep. I don't think I can disable it from a fullscreen applet. I'm nowhere near the FPS cap though - I get (say) 30 fps at both the lowest and highest resolutions which are capped at 85Hz and 65Hz respectively.

> Also there is a recent thread about vsync on NVidia using CPU cycles, when it should release cpu and wait application.

Aha... I do have an nVidia card. You mean this thread : http://forums.java.net/jive/thread.jspa?messageID=285086 ?

Well, that's a problem. I guess there's no way around it from the height of J3D?

Marking this as answered - thanks, aces - but I'd still like to hear if anyone has managed to solve this situation before.

\m/

aces
Offline
Joined: 2003-07-17
Points: 0

You are welcome ;)

>Aha... I do have an nVidia card. You mean this thread : http://forums.java.net/jive/thread.jspa?messageID=285086 ?

Yes

> Well, that's a problem. I guess there's no way around it from the height of J3D?

This is a NVidia video driver issue. As video card control panel settings overrides application settings, afaik there nothing we can do disable vsynch.

In some cases, the Java3D D3D pipeline gives very high FPS numbers. Thought D3D lacks some features as line width and shaders.

chaose71
Offline
Joined: 2008-04-15
Points: 0

Hi there,

just stumbled over this thread.

> This is a NVidia video driver issue. As video card control panel settings
> overrides application settings, afaik there nothing we can do disable vsynch.

Is there realy no way to turn VSYNC on/off via Java3D? In the NVIDIA Control Panel I have the VSync Options "Force On", "Foce Off" and "Use 3D Application Settings" (default). The last suggests that there is a way to enable/disable it at runtime. It would be great to be able to have the java3d application choose if it prefers to run with vsync on or off ...

Best Regards;
Ingo

morne
Offline
Joined: 2008-03-22
Points: 0

Humbug. That should of course be 2048x[b][i]1[/i][/b]536x32@65.