www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: Disastorm on July 01, 2011, 11:45:35 pm

Title: nvidia quadro JRE crashes?
Post by: Disastorm on July 01, 2011, 11:45:35 pm
Hello, I normally do not run my game on nvidia quadro, but the other day I tried it on 2 laptops that have Nvidia Quadro FX 880M and it seems like it crashes often (on one laptop it crashes as soon as it starts) with an error:
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0000000069fa6356, pid=6244, tid=7452
#
# JRE version: 6.0_26-b03
# Java VM: Java HotSpot(TM) 64-Bit Server VM (20.1-b02 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# C  [nvoglv64.DLL+0xaa6356]

Do you know if there is some problem with Nvidia Quadro, is it not possible to run on this video card?
Title: Re: nvidia quadro JRE crashes?
Post by: EgonOlsen on July 01, 2011, 11:54:52 pm
I've an older Quadro card in my machine at work. Everything works fine on it. You seem to run the 64bit version of windows? Are you using compiled objects? If so, try to set Config.glUseVBO=true before creating the FrameBuffer.
Title: Re: nvidia quadro JRE crashes?
Post by: Disastorm on July 02, 2011, 12:27:57 am
I believe the version of the game I tried had that set to true already, however I will double check when I get home by building my game again and running it on this laptop.  Are there any other possible suggestions or is that the only one?
Title: Re: nvidia quadro JRE crashes?
Post by: EgonOlsen on July 02, 2011, 12:30:32 am
If it's set to true, try false instead. Which renderer are you using? Native GL or AWTGL?
Title: Re: nvidia quadro JRE crashes?
Post by: Disastorm on July 02, 2011, 12:44:13 am
Ok Ill try both true and false when I get home and let you know if one of them fixes it.  I'm not sure of the renderer I am using, is there a default? Sorry I'm not home right now so I can't check the code.  I just know that I have software disabled, actually I didn't even know there was more than one OpenGl renderer, perhaps I can also try changing that, too.
Title: Re: nvidia quadro JRE crashes?
Post by: Disastorm on July 05, 2011, 11:10:38 am
Sorry I havn't gotten aroudn to trying this yet, but I was wondering how to use AWTGL renderer? When I tried to use it, it has an error saying my Mouse is not Created.  If I try Mouse.create() somewhere, it says error that Display must be created. 

Also, I saw some threads from years ago that said AWTGL is faster on multi core cpus, is this still the case, is it basically faster than the regular GL renderer?
Title: Re: nvidia quadro JRE crashes?
Post by: EgonOlsen on July 05, 2011, 11:21:58 am
No, it requires an AWT Canvas to work and none of the LWJGL native mouse, keyboard and display stuff will work. Instead, you would have to use the AWT equivalents like MouseListener. It might be faster, because it's multi-threaded by nature. But you can configure the normal OpenGL renderer in the same way, so that's not a pro anymore.
Title: Re: nvidia quadro JRE crashes?
Post by: Disastorm on July 05, 2011, 11:34:45 am
Ah I see thanks, Ill just use the regular one then.  Are you referring to the boolean useMultipleThreads?  is this set to true by default?

hmm if i set this to true, i get the same mouse error.
Title: Re: nvidia quadro JRE crashes?
Post by: EgonOlsen on July 05, 2011, 12:02:00 pm
If you set it to true, you can't access the mouse before the display has been created, which happens in another thread then. You can check for XXX.isCreated() before querying mouse, keyboard or display.
Title: Re: nvidia quadro JRE crashes?
Post by: Disastorm on July 06, 2011, 09:06:53 am
It looks like the multiple thread thing messes up my FengGUI initialization, so I was wondering if I can set multiple threads to true later on and it will start doing that, or if its one of the configs that u need to do befoer starting the renderer.
Title: Re: nvidia quadro JRE crashes?
Post by: EgonOlsen on July 06, 2011, 09:26:06 am
No, it has to be set before creating the renderer. However, if it doesn't work, just don't use it. It's not needed in most cases anyway.
Title: Re: nvidia quadro JRE crashes?
Post by: Disastorm on July 06, 2011, 09:29:30 am
Oh ok, it doesn't increase performance too much?
Title: Re: nvidia quadro JRE crashes?
Post by: EgonOlsen on July 06, 2011, 10:17:14 am
It might help, but on systems that have multiple cores, performance is usually high enough anyway....unless you are using a crappy GPU but with that, multiple threads can't help either.
Title: Re: nvidia quadro JRE crashes?
Post by: Disastorm on July 11, 2011, 09:11:14 pm
looks like vbo on or off still crashes my quadro.
Title: Re: nvidia quadro JRE crashes?
Post by: EgonOlsen on July 11, 2011, 10:12:20 pm
Have you actually tried to update the drivers?
Title: Re: nvidia quadro JRE crashes?
Post by: Disastorm on July 12, 2011, 12:10:45 am
yea they are up to date.

does this help anything:

Code: [Select]
Current thread (0x00000000003ab800):  JavaThread "main" [_thread_in_native, id=6432, stack(0x0000000002910000,0x0000000002a10000)]

siginfo: ExceptionCode=0xc0000005, reading address 0x0000000015092000

Registers:
RAX=0x00000000000038b8, RBX=0x0000000000000003, RCX=0x00000000146b0740, RDX=0x0000000015092000
RSP=0x0000000002a0efd8, RBP=0x0000000002a0f070, RSI=0x0000000069500000, RDI=0x0000000019aa92d8
R8 =0x0000000000000008, R9 =0x0000000000000838, R10=0x0000000000000008, R11=0x0000000000000008
R12=0x0000000009f57ee0, R13=0x0000000009f57ee0, R14=0x0000000041654900, R15=0x0000000008822c50
RIP=0x0000000069e02330, EFLAGS=0x0000000000010202

Top of Stack: (sp=0x0000000002a0efd8)
0x0000000002a0efd8:   0000000069f13d95 0000000000000010
0x0000000002a0efe8:   0000000000000000 0000000009fefc00
0x0000000002a0eff8:   0000000000000000 0000000000000d05
0x0000000002a0f008:   0000000009f57ee0 0000000008822e94
0x0000000002a0f018:   0000000069f151fd 0000000000000003
0x0000000002a0f028:   0000000000001238 0000000069500000
0x0000000002a0f038:   0000000000000000 0000000008822e80
0x0000000002a0f048:   0000000069e02320 000000000000000b
0x0000000002a0f058:   0000000002a0f070 0000000041654900
0x0000000002a0f068:   00000000087e0000 00000000146ab740
0x0000000002a0f078:   00000000087e0000 0000000041654900
0x0000000002a0f088:   1080000000000082 0000000009f57ee0
0x0000000002a0f098:   0000000013d4f400 0000000008822dd8
0x0000000002a0f0a8:   0000000000000000 0000000000000004
0x0000000002a0f0b8:   0000000000001405 0000000000000000
0x0000000002a0f0c8:   00000000087e0000 0000000000001238

Instructions: (pc=0x0000000069e02330)
0x0000000069e02310:   d2 41 83 e9 01 89 41 fc 75 e6 48 8b c1 c3 cc cc
0x0000000069e02320:   4d 63 d0 66 66 66 66 66 0f 1f 84 00 00 00 00 00
0x0000000069e02330:   8b 02 48 83 c1 08 89 41 f8 8b 42 04 49 03 d2 41
0x0000000069e02340:   83 e9 01 89 41 fc 75 e8 48 8b c1 c3 cc cc cc cc


Register to memory mapping:

RAX=0x00000000000038b8 is an unknown value
RBX=0x0000000000000003 is an unknown value
RCX=0x00000000146b0740 is an unknown value
RDX=0x0000000015092000 is an unknown value
RSP=0x0000000002a0efd8 is pointing into the stack for thread: 0x00000000003ab800
RBP=0x0000000002a0f070 is pointing into the stack for thread: 0x00000000003ab800
RSI=0x0000000069500000 is an unknown value
RDI=0x0000000019aa92d8 is an unknown value
R8 =0x0000000000000008 is an unknown value
R9 =0x0000000000000838 is an unknown value
R10=0x0000000000000008 is an unknown value
R11=0x0000000000000008 is an unknown value
R12=0x0000000009f57ee0 is an unknown value
R13=0x0000000009f57ee0 is an unknown value
R14=0x0000000041654900 is an unknown value
R15=0x0000000008822c50 is an unknown value


Stack: [0x0000000002910000,0x0000000002a10000],  sp=0x0000000002a0efd8,  free space=1019k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [nvoglv64.DLL+0x902330]  DrvPresentBuffers+0xad260

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
J  org.lwjgl.opengl.GL11.nglDrawElementsBO(IIIJJ)V
J  com.threed.jpct.CompiledInstance.renderVBO(ZLcom/threed/jpct/IRenderHook;)V
J  com.threed.jpct.CompiledInstance.render(ILcom/threed/jpct/GLBase;Ljava/nio/FloatBuffer;[FZLcom/threed/jpct/Camera;[[FZ[Ljava/lang/Object;)V
J  com.threed.jpct.GLRenderer.drawVertexArray(Lcom/threed/jpct/VisList;IILcom/threed/jpct/FrameBuffer;Lcom/threed/jpct/World;)V
j  com.threed.jpct.World.draw(Lcom/threed/jpct/FrameBuffer;ZIII)V+438
J  game.project3d.Main.loop()V
j  game.project3d.Main.<init>(Lcom/threed/jpct/FrameBuffer;Ljava/io/ObjectOutputStream;Ljava/io/ObjectInputStream;Ljava/net/Socket;)V+530
j  game.project3d.LoginScreen.mainLoop()V+66
j  game.project3d.LoginScreen.execute()V+22
j  game.project3d.LoginScreen.main([Ljava/lang/String;)V+28
v  ~StubRoutines::call_stub

Title: Re: nvidia quadro JRE crashes?
Post by: EgonOlsen on July 12, 2011, 10:38:50 am
No idea then...can you somehow narrow the problem down to a simple test case?
Title: Re: nvidia quadro JRE crashes?
Post by: majestik_m00se on April 04, 2012, 10:02:45 pm
I have been running on an older machine with one of these nVidia Quadro FX cards, and have had similar crashes (see stack trace below). I think I may have found what is causing this, at least with my code.

stack:
Code: [Select]
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  org.lwjgl.opengl.GL11.nglDrawElementsBO(IIIJJ)V+0
j  org.lwjgl.opengl.GL11.glDrawElements(IIIJ)V+28
j  com.threed.jpct.CompiledInstance.renderVBO(ZLcom/threed/jpct/IRenderHook;)V+287
j  com.threed.jpct.CompiledInstance.render(ILcom/threed/jpct/GLBase;Ljava/nio/FloatBuffer;[FZLcom/threed/jpct/Camera;[[FZ[Ljava/lang/Object;)V+2300
j  com.threed.jpct.AWTGLRenderer.drawVertexArray(Lcom/threed/jpct/AWTDisplayList;I)V+1909
J  com.threed.jpct.AWTJPCTCanvas.paintGL()V
j  org.lwjgl.opengl.AWTGLCanvas.paint(Ljava/awt/Graphics;)V+172
j  org.lwjgl.opengl.AWTGLCanvas.update(Ljava/awt/Graphics;)V+2
j  sun.awt.RepaintArea.updateComponent(Ljava/awt/Component;Ljava/awt/Graphics;)V+6
j  sun.awt.RepaintArea.paint(Ljava/lang/Object;Z)V+263
j  sun.awt.windows.WComponentPeer.handleEvent(Ljava/awt/AWTEvent;)V+107
j  java.awt.Component.dispatchEventImpl(Ljava/awt/AWTEvent;)V+849
j  java.awt.Component.dispatchEvent(Ljava/awt/AWTEvent;)V+2
j  java.awt.EventQueue.dispatchEvent(Ljava/awt/AWTEvent;)V+46
j  java.awt.EventDispatchThread.pumpOneEventForFilters(I)Z+204
j  java.awt.EventDispatchThread.pumpEventsForFilter(ILjava/awt/Conditional;Ljava/awt/EventFilter;)V+30
j  java.awt.EventDispatchThread.pumpEventsForHierarchy(ILjava/awt/Conditional;Ljava/awt/Component;)V+11
j  java.awt.EventDispatchThread.pumpEvents(ILjava/awt/Conditional;)V+4
j  java.awt.EventDispatchThread.pumpEvents(Ljava/awt/Conditional;)V+3
j  java.awt.EventDispatchThread.run()V+9
v  ~StubRoutines::call_stub

After much experimenting, I narrowed it down to some code I had which was adding a 3D sphere primitive, wrapping a spherical texture map, and then compiling the object:

Code: [Select]
a = (Object3D)Primitives.getSphere(50,astro.diameter/10+SKYDOME_DISTANCE);
a.setTexture("bluesky");
a.setEnvmapped(false);

a.setTransparency(current_atm.sky_transparency);

a.setSortOffset(10001);
a.invertCulling(true);
a.build();
a.compile();
a.setVisibility(true);
world.addObject(a);

With this code as-is, I get the crash in my draw code when I exec buffer.displayGLOnly() .
When I comment out the a.compile() , things run fine.  Not sure what the required Object3D methods are amongst the above to cause it to happen, didn't narrow it down beyond this.  Same code runs fine on the Mac, only a Quadro FX issue for me. 

Maybe not something worth looking into, but just some bread crumbs in case anyone else has a similar issue..
Ed
Title: Re: nvidia quadro JRE crashes?
Post by: EgonOlsen on April 05, 2012, 08:56:33 am
That's no wonder, because without calling compile, the engine does completely different stuff, i.e. no batched geometry, no VBOs...

You might want to try to disable VBO support in Config. Are you running this from inside Eclipse? If so, try to run it stand-alone.
Title: Re: nvidia quadro JRE crashes?
Post by: majestik_m00se on April 05, 2012, 04:48:30 pm
Turning off VBO has no effect, other than the stack is slightly different (see below). 
I just tried running standalone outside of Eclipse, thought it was working at first but eventually it crashed in the same manner.

I've got multiple Object3Ds, I found that I have to disable compilation on most of them to avoid the crash.  Interestingly (or maybe not), I have a bunch of OBj3D's that are created via the Loader loadMD2()/load3DS() functions that seem to be ok if I leave them as compiled.

-Ed

Code: [Select]
[error occurred during error reporting (printing native stack), id 0xc0000005]

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  org.lwjgl.opengl.GL11.nglDrawElements(IIIJJ)V+0
j  org.lwjgl.opengl.GL11.glDrawElements(ILjava/nio/IntBuffer;)V+34
j  com.threed.jpct.CompiledInstance.compileToDL()V+294
J  com.threed.jpct.GLBase.compileDLOrVBO()V
J  com.threed.jpct.AWTGLRenderer.drawVertexArray(Lcom/threed/jpct/AWTDisplayList;I)V
J  com.threed.jpct.AWTJPCTCanvas.paintGL()V
j  org.lwjgl.opengl.AWTGLCanvas.paint(Ljava/awt/Graphics;)V+172
J  sun.awt.RepaintArea.paint(Ljava/lang/Object;Z)V
j  sun.awt.windows.WComponentPeer.handleEvent(Ljava/awt/AWTEvent;)V+107
J  java.awt.Component.dispatchEventImpl(Ljava/awt/AWTEvent;)V
J  java.awt.Component.dispatchEvent(Ljava/awt/AWTEvent;)V
j  java.awt.EventQueue.dispatchEvent(Ljava/awt/AWTEvent;)V+46
J  java.awt.EventDispatchThread.pumpOneEventForFilters(I)Z
j  java.awt.EventDispatchThread.pumpEventsForFilter(ILjava/awt/Conditional;Ljava/awt/EventFilter;)V+30
j  java.awt.EventDispatchThread.pumpEventsForHierarchy(ILjava/awt/Conditional;Ljava/awt/Component;)V+11
j  java.awt.EventDispatchThread.pumpEvents(ILjava/awt/Conditional;)V+4
j  java.awt.EventDispatchThread.pumpEvents(Ljava/awt/Conditional;)V+3
j  java.awt.EventDispatchThread.run()V+9
v  ~StubRoutines::call_stub
Title: Re: nvidia quadro JRE crashes?
Post by: EgonOlsen on April 05, 2012, 09:02:54 pm
I've no idea then. You are using the AWTGLRenderer, i.e. you are rendering into an awt canvas. This is know to be a little bit...shaky. Isn't it an option to use the native gl renderer instead?