P3D crashes on start

I’m trying to work on a project… I ran size(854,480,P3D) and it crashed while loading. Then I took off the P3D and it ran fine… Errors:

Nativewindow X11 IOError: Display 0x7fc0f80f3cb0 (:0): Resource temporarily unavailable
Nativewindow X11 IOError: Display 0x7fc0f80f3cb0 (:0): Resource temporarily unavailable
FATAL ERROR in native method: Nativewindow X11 IOError: Display 0x7fc0f80f3cb0 (:0): Resource temporarily unavailable
	at jogamp.newt.driver.x11.WindowDriver.CreateWindow0(Native Method)
	at jogamp.newt.driver.x11.WindowDriver.CreateWindow(WindowDriver.java:438)
	at jogamp.newt.driver.x11.WindowDriver.createNativeImpl(WindowDriver.java:128)
	at jogamp.newt.WindowImpl.createNative(WindowImpl.java:751)
	at jogamp.newt.WindowImpl.setVisibleActionImpl(WindowImpl.java:1248)
	at jogamp.newt.WindowImpl$VisibleAction.run(WindowImpl.java:1318)
	at jogamp.newt.DisplayImpl.runOnEDTIfAvail(DisplayImpl.java:450)
	at jogamp.newt.WindowImpl.runOnEDTIfAvail(WindowImpl.java:2782)
	at jogamp.newt.WindowImpl.setVisible(WindowImpl.java:1330)
	at jogamp.newt.WindowImpl.setVisible(WindowImpl.java:1335)
	at com.jogamp.newt.opengl.GLWindow.setVisible(GLWindow.java:578)
	at processing.opengl.PSurfaceJOGL$4.run(PSurfaceJOGL.java:441)
	at com.jogamp.common.util.RunnableTask.run(RunnableTask.java:127)
	at jogamp.newt.DefaultEDTUtil$NEDT.run(DefaultEDTUtil.java:375)
Could not run the sketch (Target VM failed to initialize).
For more information, read revisions.txt and Help → Troubleshooting.

EDIT: It only crashes the second time I run it after starting processing.

Which OS? Is Wayland involved?

I’m using Ubuntu 18.04 LTS, 64-bit

@madbrine, did you ever solve this? I’m having the same issue on the same Ubuntu system.