[SOLVED] P2D/P3D sketches won't start on fresh Ubuntu 18.04 installation

EDIT: Solution that worked for me is rolling back to from 3.4 to 3.3.6. Here’s the link to this version:

I don’t have any prior experience with anything Linux, but I have been using Processing on Windows machines for multiple months now. I managed to start Processing on Ubuntu Desktop 18.04. Sketches in default (JAVA2D) mode work fine, but when I try to switch it to P2D or P3D, I get this error:

java.lang.RuntimeException: Profile GL4bc is not available on X11GraphicsDevice[type .x11, connection :0, unitID 0, handle 0x7fd4ac01ee10, owner true, ResourceToolkitLock[obj 0x247bc369, isOwner true, <2044433e, 6546c952>[count 1, qsz 0, owner <main-FPSAWTAnimator#00-Timer0>]]], but: [GLProfile[GLES1/GLES1.hw], GLProfile[GLES2/GLES3.hw], GLProfile[GL2ES1/GLES1.hw], GLProfile[GL4ES3/GL4.hw], GLProfile[GL2ES2/GL4.hw], GLProfile[GL4/GL4.hw], GLProfile[GLES3/GLES3.hw], GLProfile[GL4/GL4.hw], GLProfile[GL3/GL4.hw], GLProfile[GL2GL3/GL4.hw]]
	at processing.opengl.PSurfaceJOGL$2.run(PSurfaceJOGL.java:410)
	at java.lang.Thread.run(Thread.java:748)

My GPU is AMD Radeon R5 M330

Any attempts on googling any part of the error result in me finding questions about same(or similar) errors in other applications, which have their own solutions, which I’m not sure can be applied to Processing.

What should I do to get P2D/P3D sketches working?

2 Likes

More than 5 years I don’t use Linux. :penguin:
But when I did, I had a closed source version driver for my nVidia video. :racing_car:
And Processing worked well w/ it. :ok_hand:

I guess I should try installing or updating graphics drivers for my AMD GPU too. However, none seem to support my R5 M330. AMD’s site, when trying to look up drivers for that GPU, simply offers only Windows drivers, and any open source AMD drivers that I found don’t support it(at least in the supported GPUs list - and I don’t want to take risks with this).

The funny part is that 3D games seem to run faster on this fresh Ubuntu installation than they did on this same hardware on Windows 10 with appropriate drivers!

There’s no such thing as a closed source AMD graphics driver on Linux (any more). A good reason to choose AMD over nVidia!

So, is this card using the Radeon or AMDGPU driver? I have no problems with the AMDGPU driver on Ubuntu 18.04. Are you using latest Processing?

There should be no need to install a driver not included in Ubuntu. That will likely screw things up further.

I don’t think I use either of those - I didn’t install any graphics drivers, because of reasons mentioned above - and also because I’ve heard that Ubuntu already comes with built-in AMD drivers, so I didn’t bother.

Yes, I’m using latest Processing - downloaded it from the site about 3 hours ago.

Yes, the two mentioned! It should be using one of them. It will have been installed automatically. There are a few issues in the Processing queue related to this (or similar) exception too.

Allright, good to know.
But I don’t know how to check which one my GPU is using. How do I do that?

edit: Just tried to check using

lspci -k | grep -EA3 'VGA|3D|Display' 

And it says that both AMDGPU and Radeon are available, but it uses Radeon.

Could this be a problem? How do I switch to AMDGPU?

If your card is supported by both, you could look at eg. https://askubuntu.com/questions/927601/i-think-im-using-radeon-instead-of-amdgpu-how-do-i-change

Do not try this unless you’re confident you know how to revert without a graphical interface (just command line) if it fails.

Well, I’m not confident that I know how to revert if it fails - and I suspect it will - so I’d want to avoid that by now.

Is there any other way to make P2D/P3D sketches work?

Actually, if you know how to get into grub on boot you can try adding the blacklist command with the edit option. That will revert on reboot so safer!

Not sure there is another option. I think it’s related to various JOGL bugs. Processing already ships with a patched version of this. @gohai might have an idea why this is still failing here?

Just changed it to AMDGPU. That command above now says that I’m using that.
However, the error that Processing gives is still exactly the same, that didn’t help.

(P.S. Is it just me, or text fonts seem to be a tiny bit different now?)

Except generally Nvidia has best opengl support.

1 Like

I think glxinfo should be instructive

1 Like

Historically maybe, but times are changing, and I’ve had far more issues with closed source drivers screwing up systems in the past.

What is glxinfo?
I tried typing that into the terminal, it spewed out a large amount of display and OpenGL related information, in which I don’t see anything particularly interesting.

Dang! So it’s not just interaction between Processing and the driver then. Something about your system / GPU too.

You could have a try at setting PJOGL.profile values from 1 to 4 - see https://github.com/processing/processing/wiki/Advanced-OpenGL

You haven’t installed anything that would have installed libjogl from Ubuntu packages have you?

It’s possible different drivers trigger slightly different font rendering.

Tried setting PJOGL.profile to different values and running the sketch - 0,1,2,3,4,5,9999… Nothing changed at all, same error message each time.

(to clarify, test sketch I’m using is nothing more than size(500,500,P2D); and rect(mouseX,mouseY,50,50); )

In settings() not setup()? If so, I’m fresh out of other ideas. I recommend posting an issue on GitHub.

Oh, I tried it in setup(). However, I just retried it in settings() too, but still no effect.
Although, setting it to 1 gives a different error:


com.jogamp.opengl.GLException: Not a GL2ES2 implementation
	at jogamp.opengl.es1.GLES1Impl.getGL2ES2(GLES1Impl.java:4959)
	at processing.opengl.PJOGL.getGL(PJOGL.java:260)
	at processing.opengl.PSurfaceJOGL$DrawListener.init(PSurfaceJOGL.java:888)
	at jogamp.opengl.GLDrawableHelper.init(GLDrawableHelper.java:644)
	at jogamp.opengl.GLDrawableHelper.init(GLDrawableHelper.java:667)
	at jogamp.opengl.GLAutoDrawableBase$1.run(GLAutoDrawableBase.java:431)
	at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1291)
	at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:1147)
	at com.jogamp.newt.opengl.GLWindow.display(GLWindow.java:759)
	at com.jogamp.opengl.util.AWTAnimatorImpl.display(AWTAnimatorImpl.java:81)
	at com.jogamp.opengl.util.AnimatorBase.display(AnimatorBase.java:452)
	at com.jogamp.opengl.util.FPSAnimator$MainTask.run(FPSAnimator.java:178)
	at java.util.TimerThread.mainLoop(Timer.java:555)
	at java.util.TimerThread.run(Timer.java:505)

Maybe this is relevant too actually? https://github.com/processing/processing/issues/5476

You could try 3.3.6.