Bug 188

Summary: PBO performance problem
Product: [JogAmp] Jogl Reporter: Sven Gothel <sgothel>
Component: coreAssignee: Sven Gothel <sgothel>
Status: VERIFIED WONTFIX    
Severity: normal    
Priority: P3    
Version: 1   
Hardware: All   
OS: windows   
Type: DEFECT SCM Refs:
Workaround: ---
Attachments: C++ test case source and Win32 binary
Java/JOGL test case source
Working LWJGL PBO test

Description Sven Gothel 2010-03-24 07:48:14 CET


---- Reported by m4braham 2005-12-23 01:19:19 ----

I found that using a PBO for streaming textures (1024x1024) is very slow with 
JOGL, frame rate drops to around 20fps (as opposed to 125fps with std 
glTexSubImage2D).  The same OpenGL in native C++ code gives me 140fps with std 
glTexSubImage2D, and as much as 250fps with PBOs.

See also http://www.javagaming.org/forums/index.php?topic=11873.0.



---- Additional Comments From m4braham 2005-12-23 01:22:24 ----

Created an attachment
C++ test case source and Win32 binary




---- Additional Comments From m4braham 2005-12-23 01:25:05 ----

Created an attachment
Java/JOGL test case source




---- Additional Comments From kbr 2006-02-24 02:30:51 ----

With the current JOGL nightly build (dated 2/24 or later) some more optimization
has been added to the VBO/PBO error checking code paths which are built in to
JOGL. Combined with other GLContext-related optimizations which have recently
been added, at this point the StreamingTextures test runs at 13-14 milliseconds
per frame and the C++ test case runs at 16-17 ms per frame. Please retest with a
nightly build dated 2/24 and indicate whether the performance problems persist
on your machine.




---- Additional Comments From chaosdeathfish 2006-03-30 06:57:52 ----

Created an attachment
Working LWJGL PBO test




---- Additional Comments From chaosdeathfish 2006-03-31 00:40:33 ----

Just to clarify the attachment I posted: I converted m4braham's JOGL PBO code
over to LWJGL, line by line (for the GL-specific code - the window setup code is
different, as LWJGL doesn't use listeners). It works at full speed on a
dual-head display with PBOs active, no issues at all. This is in an AWTGLCanvas.

Platform:

Dual Xeon 2.4GHz
nVidia Quadro FX 500
LWJGL 0.99 release
JDK 1.5.0_02




---- Additional Comments From m4braham 2006-04-02 00:03:32 ----

I can confirm that the lwjgl pbo demo created by chaosdeathfish works perfectly,
on both displays attached to my 7800GT.  Unfortunately, the same cannot be said
about the JOGL version, even with the latest nightly build!

One observation I made is that the lwjgl version behaves very much like my C++
test case, in that its performance drops sharply when the window is moved to
span across both displays (I'm guessing the driver enters some software path),
whereas the JOGL version runs at the same speed no matter where the window is
placed.

I'm very keen on this issue to be fixed soon; if there's anything I can help
with then please let me know.




---- Additional Comments From kbr 2006-04-02 19:34:18 ----

I've set up a dual-head machine at work with a GeForce FX 5800 Ultra and can
reproduce the behavior. I note that with the LWJGL version of the test case the
frame rate is good, though moving the mouse over the window causes it to perform
similarly to the JOGL test case while the mouse is moving. Can you confirm this
behavior?

I will look into the root cause of this issue this week.




---- Additional Comments From chaosdeathfish 2006-04-03 02:01:50 ----

I don't get the same problem with LWJGL, mouse movement doesn't affect the speed.

But the good news - I've just tried the latest nightly build (2006-04-02) and it
seems to have fixed the PBO problem altogether! I get the same behaviour and
performance on JOGL as on LWJGL; when the window is on one display the framerate
is fine (~6ms per frame on this machine), and spanning two displays the
framerate is as slow on both as JOGL was previously (~75ms per frame).

My driver version is nVidia Forceware 81.67, if that's any help.

I'm not sure if I'd picked up the correct JOGL version before, I may have still
been using the 5th January release; it looks like I had my build path set up
incorrectly.



---- Additional Comments From m4braham 2006-04-03 09:43:56 ----

No change here, with the latest nightly build.  The test runs, and according to
the console output at 5ms per frame, although animation is not really smooth
(not reflected by the frame times!).  Moving the window over to the second
screens stalls the animation, BUT I still get frame timings on the console, and
they are as good as on the primary display.  As mentioned before, when the
window stretches across the two displays the reported frame rate is 70..90ms,
but I get no screen updates.




---- Additional Comments From kbr 2006-04-17 01:11:00 ----

This longstanding issue may ultimately somehow be related to differences in how
JOGL and LWJGL manage their OpenGL contexts. However, a significant amount of
code comparison between the two libraries has been undertaken with no obvious
differences detected which could be the root cause of this issue.

It appears that NVidia's latest driver release (84.21) has fixed this problem,
and since the issue was pretty obviously a driver bug somehow exposed by the
JOGL implementation this bug is being closed as "won't fix". Please reopen this
bug if it appears that more investigation is warranted.




--- Bug imported by sgothel@jausoft.com 2010-03-24 07:48 EDT  ---

This bug was previously known as _bug_ 188 at https://jogl.dev.java.net/bugs/show_bug.cgi?id=188
Imported an attachment (id=68)
Imported an attachment (id=69)
Imported an attachment (id=70)

The original submitter of attachment 68 [details] is unknown.
   Reassigning to the person who moved it here: sgothel@jausoft.com.
The original submitter of attachment 69 [details] is unknown.
   Reassigning to the person who moved it here: sgothel@jausoft.com.
The original submitter of attachment 70 [details] is unknown.
   Reassigning to the person who moved it here: sgothel@jausoft.com.