Quantcast

[Ardor3d][JogAmp] Performance issue under Ubuntu

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Ardor3d][JogAmp] Performance issue under Ubuntu

Stefan
Hi,

I am developing an Eclipse 4 RCP application using Ardor3D and JogAmp 2.3.2 (JoglSwtCanvas). I am experiencing a performance issue under Ubuntu.

When I load a 'big' geometry (11 mio. vertices; 3.6 mio. triangles) into my scene, it looks like something is slowing down the UI thread of the operating system. It seems like something is spending too much time during the frame update. The effect is that the mouse cursor feels slow, like it only gets updated with 15fps or so. Under Windows 7, the same code works without any problems.

My configuration:
- Ubuntu 12.04, 64Bit
- Nvidia Quadro K2100M
- Nvidia Driver 346.47

glxinfo | grep "OpenGL version"
OpenGL version string: 4.5.0 NVIDIA 346.47

This this the code of the game loop that triggers the refresh:

private void doUpdateFrame() {
  final Display defaultDisplay = Display.getDefault();
 
  if(defaultDisplay.isDisposed()) return;

  defaultDisplay.syncExec(new Runnable() {
    public void run() {
      try {
        frameHandler.updateFrame();
      } catch (Exception e) {}
    }
  });
}

Sometimes the problem is less strong, sometimes it is unusable. Can anybody provide me a hint what the problem could be? I have a screen shot of a VisualVM Sampler session but could not append it to this post. Of course, I can provide further information on demand. Thanks!

Regards,

Stefan
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Ardor3d][JogAmp] Performance issue under Ubuntu

gouessej
Administrator
Hi

There is no platform specific performance issue with JogAmp's Ardor3D Continuation which is heavily tested under GNU Linux as I'm under Mageia. You wrote that "Sometimes the problem is less strong, sometimes it is unusable", the culprit is probably elsewhere. Are you sure that you need syncExec? Is asyncExec enough?

Moreover, you don't give enough information. The same hardware can behave differently with two operating systems. Do you reproduce your slowdown with another OpenGL software not using JogAmp's Ardor3D Continuation?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Ardor3d][JogAmp] Performance issue under Ubuntu

Stefan
Hey Julien,

thanks for your response! I am aware that my description was not perfect, but I wanted to start somewhere.

In my software, the problem does not appear when I limit the frame rate to 5 FPS. With 100% GPU load it would achieve about 25 FPS on my laptop - including the mentioned problems.

I recognized the following: If I start a CUDA program like this one

http://wili.cc/blog/gpu-burn.html

I experience the same effect: the UI thread of Ubuntu gets slowed down. The GPU sheduling seems to suppress the UI thread.

Moreover, I run the "glmark2" benchmark. The glmark2 benchmark does not cause any problems or side-effects.

Perhaps the difference between Windows and Linux has to do with the Nvidia Optimus support by the NVidia drivers.

Currently, I am rendering the scene in every frame - no matter whether something got changed or not. I want to try to redraw the frame only when something got changed. This should limit the problem. Do you know whether there is an example for this in the Ardor3D examples project? As far as I have seen, all examples render the scene in every frame.

Thanks for your feedback!

Regards,

Stefan
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Ardor3d][JogAmp] Performance issue under Ubuntu

gouessej
Administrator
Hi

Stefan wrote
Perhaps the difference between Windows and Linux has to do with the Nvidia Optimus support by the NVidia drivers.
This is the most important information. Optimus is NOT supported by JogAmp and by numerous similar APIs. It's possible to use NV GPU affinity in C to force a software to use a particular GPU but it's not supported in JOGL and anyway, Optimus is a huge source of trouble as it allows a program that starts by using a GPU to switch to another one at runtime whereas almost no program is designed to support such changes as it would be like starting by running a Ferrari Testarosa and ending with a Trabi. Nothing will be done to support Optimus.

You can simply call your own redraw mechanism (or directly FrameHandler.updateFrame()) in your event listeners, it's not up to JogAmp's Ardor3D Continuation to do it for you.

When Optimus switches to the Intel GPU, don't expect good performance especially on large meshes.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Ardor3d][JogAmp] Performance issue under Ubuntu

Stefan
Hey Julien,

good to know that Optimus is not supported. So, JOGL-based applications always run on the main GPU? Who decides this? The hardware, the driver, or the application?

Regarding the redraw mechanism in Ardro3d: Is there any support to recognize when the scene got changed? You mentioned event listeners. I also recognized this interface but I have never used it. Is there a nice example around?

Thanks!

Regards,

Stefan
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Ardor3d][JogAmp] Performance issue under Ubuntu

gouessej
Administrator
Hi

Stefan wrote
good to know that Optimus is not supported. So, JOGL-based applications always run on the main GPU? Who decides this? The hardware, the driver, or the application?
It's not the software as it can't use NV GPU affinity. You can force the use of a particular GPU for a particular software or for all softwares in the GUI installed on machines support Optimus under Windows. I think that it's the operating system that decides which GPU to use depending on the power consumption and other criteria.

Stefan wrote
Regarding the redraw mechanism in Ardro3d: Is there any support to recognize when the scene got changed? You mentioned event listeners. I also recognized this interface but I have never used it. Is there a nice example around?
I was talking about SWT event listeners. You can use this method to know whether something is "dirty":
http://jogamp.org/deployment/ardor3d/javadoc/com/ardor3d/scenegraph/Spatial.html#isDirty-com.ardor3d.scenegraph.event.DirtyType-
Loading...