Any P3D sketch fails to run outputting 4k to external screen.

Using TV as (sole) external monitor (with laptop lid closed) over HDMI.

If I set the resolution to anything over 1080p, then no sketch using P3D runs, no matter how small the sketch size is. I have no problems when using the built in screen at any resolution with pixelDensity(2) though.

I get "Could not run the sketch (Target VM failed to initialize)," which I understand is related to an attempt to use more memory than available. But...

It seems strange to me that I can't run any P3D sketch at all when I have no trouble on the built in screen.

I also have no trouble with gigantic sketches with the normal renderer.

Using: Processing 3.2.2 OSX, 10.11.6 Macbook pro, Mid 2014

Thanks for any help!



  • @IsaBison -- could you give a concrete example of a very simple sketch that fails, and the full error message?

    It sounds like it is something with size(200,200,P3D) ... and screen(2) ... and pixelDensity(?)

  • edited November 2016


    ^ Fails when external is connected and running at higher than 1080p, e.g. 3840 x 2160.


    ^ Runs fine when using the built in screen.

    The full error message is: "Could not run the sketch (Target VM failed to initialize). For more information, read revisions.txt and Help → Troubleshooting."

  • Thank you re: the error message Could you please give a complete example of the code for a very simple sketch that fails? I'm not clear from your descriptions if size() is the only thing that causes the error, or if you also have to call screen() / pixelDensity() / both to experience the bug.

  • edited November 2016

    The code in the previous message is the complete program in both cases.

    e.g. here is the program attempting to run while the monitor is connected:

    I know, weird, huh?

    My original reference to pixelDensity() was just to say that I can run very large and intensive sketches when the external monitor is not connected (or not running at sizes over 1080p).

    I also just realized the OSX's crash report has details. I'm looking through them now, too long to post though.

  • Possibly relevant:

    . . .

    Crashed Thread: 4

    Exception Type: EXC_BREAKPOINT (SIGTRAP) Exception Codes: 0x0000000000000002, 0x0000000000000000 Exception Note: EXC_CORPSE_NOTIFY

    Application Specific Information: *** CFEqual() called with NULL first argument ***

    . . .

    Thread 4 Crashed: 0 0x00007fff8f5b4130 CFEqual + 480 1 0x00007fff8f629479 CFArrayGetFirstIndexOfValue + 249 2 libnewt.jnilib 0x0000000131eebb3a Java_jogamp_newt_driver_macosx_ScreenDriver_getMonitorMode0 + 698 3 ??? 0x00000001103c0c84 0 + 4567338116 4 ??? 0x00000001103a90c0 0 + 4567240896 5 ??? 0x00000001103a90c0 0 + 4567240896 6 ??? 0x00000001103a933d 0 + 4567241533 7 ??? 0x00000001103a8d80 0 + 4567240064 8 ??? 0x00000001103a90c0 0 + 4567240896 9 ??? 0x00000001103a933d 0 + 4567241533 10 ??? 0x00000001103a8d80 0 + 4567240064 11 ??? 0x00000001103a933d 0 + 4567241533 12 ??? 0x00000001103a9382 0 + 4567241602 13 ??? 0x00000001103a90c0 0 + 4567240896 14 ??? 0x00000001103a933d 0 + 4567241533 15 ??? 0x00000001103a17a7 0 + 4567209895 16 libjvm.dylib 0x000000010f6ecf8a JavaCalls::call_helper(JavaValue*, methodHandle*, JavaCallArguments*, Thread) + 1710 17 libjvm.dylib 0x000000010f723d82 jni_invoke_static(JNIEnv_, JavaValue*, _jobject*, JNICallType, _jmethodID*, JNI_ArgumentPusher*, Thread*) + 447 18 libjvm.dylib 0x000000010f71caf9 jni_CallStaticVoidMethod + 349 19 java 0x000000010e02d931 JavaMain + 2500 20 libsystem_pthread.dylib 0x00007fff8da8b99d _pthread_body + 131 21 libsystem_pthread.dylib 0x00007fff8da8b91a _pthread_start + 168 22 libsystem_pthread.dylib 0x00007fff8da89351 thread_start + 13

  • edited November 2016 Answer ✓

    @IsaBison == If it is crashing with just the monitor and a simple size() and the thread crashes on getMonitorMode0 ... yes, it seems that some conjunction of OpenGL, your graphics drivers, and/or that specific monitor hate each other.

    I'd say report this to Processing Issues with the details about your Mac model and the monitor, the example "sketch" (line), the PDE console error, and the Mac Console crash log. They may have much better ideas about detective work.

  • Yea... I was afraid of that.

    If anyone else comes across this, future developments will be here:

Sign In or Register to comment.