JDK 1.5.0-beta2 is now available

In case you haven’t seen this:
http://java.sun.com/j2se/1.5.0/

Release notes:
http://java.sun.com/j2se/1.5.0/relnotes.html

New 2D features (includes more info about the OGL pipeline):
http://java.sun.com/j2se/1.5.0/docs/guide/2d/new_features.html

There were numerous 2D-related bug fixes and enhancements integrated in 1.5-beta2… I’m sure many of you will be interested in playing with the OGL-based pipeline, which is now also available on Windows. (There were also many bug fixes for the OGL pipeline in general, and to improve stability on Linux.)

You can still enable the OGL-based pipeline using the following system property (on all platforms):
-Dsun.java2d.opengl=true

Note there is a minor change in the flag semantics… If you want to see a message printed to the console stating whether the pipeline could be enabled successfully, use “True” (note the uppercase ‘T’):
-Dsun.java2d.opengl=True

Please download this latest beta2 release and send us your feedback; this is your chance to make sure the 1.5 final release is as stable as possible.

Thanks,
Chris

edit: added link to 2D-specific features list…

I would see this right before I was going to go to bed.

Chris,
is there any documentation about opengl acceleration and other additional features of java2d ?

Mik

At the first try with the Java2Demo I get:

"Could not enable OpenGL pipeline for default config on screen 0 "

Is this a Matrox-ogl related problem ?

I did some other tests on a java2d swing app:

  • on a Nvidia GeForce2/winME latest drivers I always get a black window. Sometimes I get something readable, but the refresh is really slow. The performance falls down.

  • on a ATI Radeon ve7000/win2k latest drivers I always get a dirty window and an hotspot crash:

An unexpected error has been detected by HotSpot Virtual Machine:

EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x05b49440, pid=1532, tid=924

Java VM: Java HotSpot™ Client VM (1.5.0-beta2-b51 mixed mode, sharing)

Problematic frame:

C [atioglxx.dll+0x3e9440]

--------------- T H R E A D ---------------

Current thread (0x009a3710): VMThread [id=924]

siginfo: ExceptionCode=0xc0000005, reading address 0x00001044

Registers:
EAX=0x00000000, EBX=0x18850880, ECX=0x00000000, EDX=0x1802b270
ESP=0x02c4fad8, EBP=0x00000000, ESI=0x00000000, EDI=0x00000001
EIP=0x05b49440, EFLAGS=0x00010202

Top of Stack: (sp=0x02c4fad8)
0x02c4fad8: 1802b2d4 00000000 1802b270 05c98e94
0x02c4fae8: 1802b270 17f409b0 05b495cf 00000000
0x02c4faf8: 00000001 00000000 05760000 02c4fb34
0x02c4fb08: 05b4977c 00000003 05b46aff 05b47201
0x02c4fb18: 05c9b5be 05760000 00000000 00000001
0x02c4fb28: 00085b30 02c4fb48 7ffdf000 02c4fb54
0x02c4fb38: 784630e7 05760000 00000000 00000001
0x02c4fb48: 7ffdf000 00085b30 00086598 02c4fbbc

Instructions: (pc=0x05b49440)
0x05b49430: 06 00 00 00 eb da 5f 33 c0 5d 83 c4 0c c2 04 00
0x05b49440: 8b 85 44 10 00 00 89 44 24 14 8d 04 80 56 8b 74

Stack: [0x02b50000,0x02c50000), sp=0x02c4fad8, free space=1022k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [atioglxx.dll+0x3e9440]

[error occurred during error reporting, step 120, id 0xc0000005]

VM_Operation (0x181af620): exit, mode: safepoint, requested by thread 0x03252a28

--------------- P R O C E S S ---------------

Java Threads: ( => current thread )
0x0342be10 JavaThread “TimerQueue” daemon [_thread_blocked, id=1256]
0x002366f0 JavaThread “DestroyJavaVM” [_thread_blocked, id=1356]
0x03420d40 JavaThread “Intro” [_thread_in_native, id=1516]
0x03252a28 JavaThread “AWT-EventQueue-0” [_thread_blocked, id=1484]
0x0325f2c8 JavaThread “Java2D Disposer” daemon [_thread_blocked, id=1476]
0x00a093f8 JavaThread “AWT-Shutdown” [_thread_blocked, id=732]
0x009ac348 JavaThread “Low Memory Detector” daemon [_thread_blocked, id=1336]
0x009aad60 JavaThread “CompilerThread0” daemon [_thread_blocked, id=1324]
0x009a74a0 JavaThread “Finalizer” daemon [_thread_blocked, id=476]
0x009a5f98 JavaThread “Reference Handler” daemon [_thread_blocked, id=1392]

Other Threads:
=>0x009a3710 VMThread [id=924]

VM state:at safepoint (shutting down)

VM Mutex/Monitor currently owned by a thread: ([mutex/lock_event])
[0x00235c88/0x0000030c] Threads_lock - owner thread: 0x009a3710

Heap
def new generation total 640K, used 36K [0x2b920000, 0x2b9d0000, 0x2be00000)
eden space 576K, 6% used [0x2b920000, 0x2b9290a8, 0x2b9b0000)
from space 64K, 0% used [0x2b9b0000, 0x2b9b0000, 0x2b9c0000)
to space 64K, 0% used [0x2b9c0000, 0x2b9c0000, 0x2b9d0000)
tenured generation total 7524K, used 5126K [0x2be00000, 0x2c559000, 0x2f920000)
the space 7524K, 68% used [0x2be00000, 0x2c301a70, 0x2c301c00, 0x2c559000)
compacting perm gen total 8192K, used 1324K [0x2f920000, 0x30120000, 0x33920000)
the space 8192K, 16% used [0x2f920000, 0x2fa6b3f0, 0x2fa6b400, 0x30120000)
ro space 8192K, 62% used [0x33920000, 0x33e20348, 0x33e20400, 0x34120000)
rw space 12288K, 46% used [0x34120000, 0x346aba58, 0x346abc00, 0x34d20000)

Dynamic libraries:
0x00400000 - 0x0040c000 C:\WINNT\SYSTEM32\java.exe
0x78460000 - 0x784e2000 C:\WINNT\system32\ntdll.dll
0x79260000 - 0x792c2000 C:\WINNT\system32\ADVAPI32.dll
0x796b0000 - 0x7976f000 C:\WINNT\system32\KERNEL32.DLL
0x77120000 - 0x77191000 C:\WINNT\system32\RPCRT4.DLL
0x78000000 - 0x78045000 C:\WINNT\system32\MSVCRT.dll
0x6d630000 - 0x6d7b4000 C:\Programmi\Java\jre1.5.0\bin\client\jvm.dll
0x77e10000 - 0x77e75000 C:\WINNT\system32\USER32.dll
0x77f40000 - 0x77f7e000 C:\WINNT\system32\GDI32.DLL
0x77550000 - 0x77581000 C:\WINNT\SYSTEM32\WINMM.dll
0x68050000 - 0x68057000 C:\WINNT\SYSTEM32\serwvdrv.dll
0x665e0000 - 0x665e7000 C:\WINNT\SYSTEM32\umdmxfrm.dll
0x2b900000 - 0x2b917000 C:\WINNT\SYSTEM32\Dgwav.dll
0x2b800000 - 0x2b812000 C:\WINNT\SYSTEM32\Sal.dll
0x77820000 - 0x77827000 C:\WINNT\system32\VERSION.dll
0x75980000 - 0x75986000 C:\WINNT\system32\LZ32.DLL
0x6d280000 - 0x6d288000 C:\Programmi\Java\jre1.5.0\bin\hpi.dll
0x68f70000 - 0x68f7b000 C:\WINNT\SYSTEM32\PSAPI.DLL
0x6d600000 - 0x6d60c000 C:\Programmi\Java\jre1.5.0\bin\verify.dll
0x6d2f0000 - 0x6d30d000 C:\Programmi\Java\jre1.5.0\bin\java.dll
0x6d620000 - 0x6d62f000 C:\Programmi\Java\jre1.5.0\bin\zip.dll
0x6d000000 - 0x6d166000 C:\Programmi\Java\jre1.5.0\bin\awt.dll
0x77800000 - 0x7781e000 C:\WINNT\SYSTEM32\WINSPOOL.DRV
0x79780000 - 0x79790000 C:\WINNT\system32\MPR.DLL
0x75e30000 - 0x75e4a000 C:\WINNT\SYSTEM32\IMM32.dll
0x77a50000 - 0x77b3f000 C:\WINNT\system32\ole32.dll
0x693e0000 - 0x694a7000 C:\WINNT\SYSTEM32\opengl32.dll
0x6fa30000 - 0x6fa50000 C:\WINNT\SYSTEM32\GLU32.dll
0x51000000 - 0x51047000 C:\WINNT\SYSTEM32\DDRAW.dll
0x72840000 - 0x72846000 C:\WINNT\SYSTEM32\DCIMAN32.dll
0x6e380000 - 0x6e386000 C:\WINNT\system32\INDICDLL.dll
0x77590000 - 0x777dc000 C:\WINNT\system32\shell32.dll
0x70a70000 - 0x70ad5000 C:\WINNT\system32\SHLWAPI.DLL
0x71710000 - 0x71794000 C:\WINNT\system32\COMCTL32.DLL
0x6d240000 - 0x6d27e000 C:\Programmi\Java\jre1.5.0\bin\fontmanager.dll
0x05760000 - 0x05d61000 C:\WINNT\SYSTEM32\atioglxx.dll
0x6d4b0000 - 0x6d4c3000 C:\Programmi\Java\jre1.5.0\bin\net.dll
0x74fe0000 - 0x74ff4000 C:\WINNT\SYSTEM32\WS2_32.dll
0x74fd0000 - 0x74fd8000 C:\WINNT\SYSTEM32\WS2HELP.DLL
0x6d4d0000 - 0x6d4d9000 C:\Programmi\Java\jre1.5.0\bin\nio.dll
0x181b0000 - 0x181b6000 C:\PROGRA~1\Logitech\MOUSEW~1\SYSTEM\LGMOUSHK.dll
0x6d1c0000 - 0x6d1e3000 C:\Programmi\Java\jre1.5.0\bin\dcpr.dll
0x6d3b0000 - 0x6d3cf000 C:\Programmi\Java\jre1.5.0\bin\jpeg.dll

VM Arguments:
jvm_args: -Dsun.java2d.opengl=True
java_command: java2demo.jar

Environment Variables:
JAVA_HOME=“C:\j2sdk1.4.2_04”
CLASSPATH=“C:\Programmi\Java\j2re1.4.2_04\lib\ext\QTJava.zip”
PATH=C:\WINNT;C:\WINNT\SYSTEM;C:\WINNT\SYSTEM32;C:\WINNT\SYSTEM32\WBEM;C:\DIGISOFT\MQSDK\BIN;C:\DIGISOFT\MQSDK\TOOLS;C:\DIGISOFT\DIGIUTIL;C:\DIGISOFT\DIGIUTIL\TOOLS;C:\Programmi\File comuni\Sonic Shared;;C:\Programmi\ATI Technologies\ATI Control Panel;C:\Programmi\Microsoft Visual Studio\Common\Tools\WinNT;C:\Programmi\Microsoft Visual Studio\Common\MSDev98\Bin;C:\Programmi\Microsoft Visual Studio\Common\Tools;C:\Programmi\Microsoft Visual Studio\VC98\bin
USERNAME=Administrator
OS=Windows_NT
PROCESSOR_IDENTIFIER=x86 Family 6 Model 6 Stepping 2, AuthenticAMD

--------------- S Y S T E M ---------------

OS: Windows 2000 Build 2195 Service Pack 4

CPU:total 1 family 6, cmov, cx8, fxsr, mmx, sse

Memory: 4k page, physical 785904k(559384k free), swap 2788448k(2570236k free)

vm_info: Java HotSpot™ Client VM (1.5.0-beta2-b51) for windows-x86, built on May 13 2004 02:09:25 by “java_re” with MS VC++ 6.0

installing now!!

:edit:

oh it needs 1.5beta1 uninstalling 1st…

:edit:

haha, uninstalling beta1 caused it to add a webstart link to my desktop!!

Irritation alert
They’ve changed the default install paths under Win32 to jre1.5.0 and jdk1.5.0 (instead of j2se1.5.0 and j2sdk1.5.0). Broke a whole bunch of things with such a simple change. Grr.

Cas :slight_smile:

What version of opengl does the opengl pipeline require?

I’m getting
"Could not enable OpenGL pipeline for default config on screen 0 "

I believe my graphics drivers support 1.3 but not 1.4.

Addendum for Chris,

OGL acceleration works almost perfectly on a nVidia Geforce 3 TI winXP. The problem here is that I get lower performance than without opengl acceleration ???

  • Can you suggest a board type where we can be sure it works at best ?

  • Have you got some performace hints about getting the best with java2d and the ogl pipeline ?

  • Re-iteration: have you got some more cmdline switches to better control the ogl pipeline ?

Cheers,

Mik

[quote]Irritation alert
They’ve changed the default install paths under Win32 to jre1.5.0 and jdk1.5.0 (instead of j2se1.5.0 and j2sdk1.5.0). Broke a whole bunch of things with such a simple change. Grr.

Cas :slight_smile:
[/quote]
LOL ! ::slight_smile: After all the effort Sun’s marketing dept went through to STOP people from using the term “JDK” to refer to the JDK…IIRC it was 1998 when they first put out the command “thou shalt not refer to the unholy JDK; thou shalt always refer to the sun product J2SDK or Java 2 SDK or Java 2 Software Development Kit or be set upon by a pack of reavenous lawyers”.

But it didn’t stick because it had been JDK for several years already, and J2 was an entirely meandingless prefix, and SDK an entirely generic suffix :).

I agree that unannounced changes suck, especially in a mid-beta revision, but I’m all in favour of going back to the “old” name :wink:

Just tested it with my benchmark.
Sadly the performance is much worse than plain
Java2D (10x slower and worse). :-/
I am using a Quadro4 750 under Win XP. Upgrading
the driver from 45.23 to 56.72 did not speed things
up. I feel as if its not hardware accelerated at all…

Gregor

For those that mention that openGL pipeline is much worse on Windows, remember that ON WINDOWS you were already getting an accelerated pipeline with DirectDraw/Direct3D. The openGL pipeline is far newer and really meant for giving the first HW acceleration to Linux/Solaris.

Of course still report all the bugs and performance issues.

Now if performance was worse on Linux someone REALLY goofed :slight_smile:

If you really want to see how slow the opengl pipeline is with windows just give Netbeans a try. If you thought Netbeans was slow before, I can say without hyperbole that this is a hundred times worse. It has to be using the MS software renderer or copying large rectangles across the bus. Good lord. That is on nvidia hardware with their always solid opengl drivers.

[quote]Chris,
is there any documentation about opengl acceleration and other additional features of java2d ?

Mik
[/quote]
Hi Mik,

I just updated my original post with a link to the 2D-specific page of new features, which includes more details about the OGL pipeline on Windows.

Chris

Welllllll, some things are actually slower on Linux too. And still crashing a lot. And corupted. Not looking too good on few configs I tried. Time to post some bugs, I guess.

[quote]Addendum for Chris,

OGL acceleration works almost perfectly on a nVidia Geforce 3 TI winXP. The problem here is that I get lower performance than without opengl acceleration ???

  • Can you suggest a board type where we can be sure it works at best ?

  • Have you got some performace hints about getting the best with java2d and the ogl pipeline ?

  • Re-iteration: have you got some more cmdline switches to better control the ogl pipeline ?

Cheers,

Mik
[/quote]
Regarding the issues you reported above:

  • The OGL pipeline probably can’t be enabled on most Matrox boards, because they don’t support the newer pbuffer and render_texture extensions

  • On your GeForce 2, if you’re running a complex Swing app, you’ll likely run out of VRAM rather quickly, and there is a known bug in Nvidia’s drivers such that they don’t report an error when VRAM is exhausted, and then they render black. We’re in the process of reporting this bug to Nvidia (there is no workaround; see 5026186).

  • There are a few basic problems in ATI’s latest drivers (4.4 I think?) that make the OGL pipeline unusable on Radeon boards (crashes, artifacts, etc, as you’ve reported). We’re tracking this under 5033205; we’ll submit the relevant bugs to ATI and hopefully they will be fixed soon.

  • In general, you might find performance lacking if there is a lot of software rendering going on (if your images cannot be cached in textures). This will happen if you’re grabbing the DataBuffer and mucking with the pixels; we will have to use glDrawPixels(), which is notoriously slow on x86 OGL drivers. We have a workaround that we will implement in an upcoming release (see 5020009).

  • Swing performance is also likely to be slower due to relatively poor performance of pbuffer->screen copies. We have some ideas about allocating the Swing backbuffer in the native OGL backbuffer, which helps reduce context switching and also increases back->front copy speeds. There are some problems with this approach, so look for a fix in an upcoming release.

To answer your specific questions above…

  • I’ve found that performance/stability is best on GeForce 4 and above. The current problems with Radeon boards are frustrating, but hopefully ATI will have them sorted out in the near future.

  • There are really no OGL-specific performance hints. (Well, there’s only one I can think of: use power-of-two dimensions for your image if you’re using TexturePaint, since that’s the only way we can accelerate TexturePaints optimally). This may change in the future, so I wouldn’t go out of my way to use this optimization…

  • There are no other system properties related to the OGL pipeline. (I’d like to keep things as simple as possible; we already have too many flags for the Windows and X11 pipelines.)

Thanks,
Chris

[quote]For those that mention that openGL pipeline is much worse on Windows, remember that ON WINDOWS you were already getting an accelerated pipeline with DirectDraw/Direct3D. The openGL pipeline is far newer and really meant for giving the first HW acceleration to Linux/Solaris.

Of course still report all the bugs and performance issues.

Now if performance was worse on Linux someone REALLY goofed :slight_smile:
[/quote]
Yes, please file bugs if you come across any quality or performance issues with the OGL pipeline. But first, please take a look through the bug database to see if something’s been filed already (search for the keyword “OGL”). We’ve already filed quite a few bugs for many of the issues reported here today.

And Scott, don’t be surprised if performance of the OGL pipeline is still worse (than X11) in some cases on Linux. There are some outstanding driver issues that need to be resolved before we can try to enable this stuff by default. It’s not that we’ve “goofed”, but more like we’ve got 18 billion different driver/hardware/platform combinations to support, and we want to make sure we’ve covered all our bases before this becomes our default pipeline. These things take time…

Thanks,
Chris

Triple buffering doesn’t work (createBufferStrategy(3)) in Balls.jar it dies in a variety of ways. (blank black, blank white, single frame rendered then freeze, JVM crash, etc etc)

GF2gts 32mb (drivers 56.72) WinXP, vsync totally disabled in drivers.

performance wise, its slightly faster than DirectDraw accelerated blits.
(opengl=true got 3300 balls @ 30fps,
opengl=false got 2900 @ 30fps).

VolatileImages don’t appear to work either - im just getting a white ractangle (might be something wrong in my code - though it works fine without the opengl flag)

I’d love to know exactly what is accelerated through the opengl pipeline - any chance of a doc covering what (in optimal conditions) is accelerated?

I’ll check out the triple-buffering problems you’ve reported…

There is no official doc about what is/isn’t accelerated with the OGL pipeline, although I think I’ll have to come up with something more official soon. In the meantime, I keep answering this question partially, so let me just point to one such response:
http://archives.java.sun.com/cgi-bin/wa?A2=ind0404&L=java2d-interest&P=R997&D=0&I=-3

Chris

edit: I think the triple-buffering problem is the same as all the other VolatileImage problems on Nvidia boards. (As I described above, they don’t properly report when VRAM is exhausted, and that’s why you’re seeing the white/black screens, and then potentially a crash. This is already reported under 5026186.)

Is there a beta1 -> beta2 fix/feature change list somewhere ? I can’t find it in the release docs anyway.

Cheers,
Mikael

Thanks for your replies and for your support to the Java2D community, Chris.

I have some more question (yes, I’m filtering among several thousands ones):

  • is OGL acceleration available when blitting/transforming into an offcreen graphics2d context (ie the one I get from a bufferedImage).

  • is antialiased text ogl accelerated ((kind of reiterated question) I had some feedback from Jon Meyer about the fact he had to tesselate in order to accelerate text output in Agile2D).

Mik