Problem with AMD graphics driver and OpenGL under Linux

Hello,

I try to run MovieDemo at my computer (ubuntu 20.04LTS 64bit, Intell core i7-4790, RAM :16GB) with AMD’s GPU (Radeon RX 550 Series), but I get some error.

I am using MATLAB 2020a version and installed PTB-3 from NeuroDebian’s webpage (matlab-psychtoolbox-3 – toolbox for vision research – Matlab bindings — Debian Neuroscience Package Repository).

When I run MovieDemo, in order to check if the PTB-3 settings are correct, then get error message as follows:

PTB-INFO: This is Psychtoolbox-3 for GNU/Linux X11, under Matlab 64-Bit (Version 3.0.17 - Build date: Oct 31 2020).

PTB-INFO: OS support status: Linux 5.8.0-43-generic Supported.

PTB-INFO: Type ‘PsychtoolboxVersion’ for more detailed version information.

PTB-INFO: Most parts of the Psychtoolbox distribution are licensed to you under terms of the MIT License, with

PTB-INFO: some restrictions. See file ‘License.txt’ in the Psychtoolbox root folder for the exact licensing conditions.

PTB-INFO: For information about paid priority support, community membership and commercial services, please type

PTB-INFO: ‘PsychPaidSupportAndServices’.

PTB-INFO: Connected to Advanced Micro Devices, Inc. [AMD/ATI] Lexa PRO [Radeon 540/540X/550/550X / RX 540X/550/550X] GPU with DCE-11.0 display engine [6 heads].

PTB-WARNING: Your graphics driver doesn’t allow me to control syncing wrt. vertical retrace!

PTB-WARNING: Please update your display graphics driver as soon as possible to fix this.

PTB-WARNING: Until then, you can manually enable syncing to VBL somehow in a manner that is

PTB-WARNING: dependent on the type of gfx-card and driver. Google is your friend…

PTB-WARNING: Seems that a Mesa OpenGL software renderer is active! This will likely cause miserable

PTB-WARNING: performance, lack of functionality and severe timing and synchronization problems.

PTB-WARNING: Most likely you are running Psychtoolbox on a Matlab version 8.4 (R2014b) or later and

PTB-WARNING: Matlab is causing this problem by overriding your operating systems OpenGL library with

PTB-WARNING: its own outdated software library. Please run the setup script PsychLinuxConfiguration()

PTB-WARNING: now from your Matlab command window and then quit and restart Matlab to fix this problem.

PTB-WARNING: Actually, it is pointless to continue with the software renderer, as that will cause more trouble than good.

PTB-WARNING: I will abort now. Read the troubleshooting tips above to fix the problem. You can override this if you add the following

PTB-WARNING: command: Screen(‘Preference’, ‘ConserveVRAM’, 64); to get a functional, but close to useless window up and running.

エラー: Screen

See error message printed above.

エラー: MovieDemo (line 124)

[window,windowRect]=Screen(screenNumber,‘OpenWindow’,0,[],[],2);

>>

I try to use PsychLinuxConfiguration(), but get further error below:

com.jogamp.opengl.GLException: X11GLXDrawableFactory - Could not initialize shared resources for X11GraphicsDevice[type .x11, connection :0, unitID 0, handle 0x0, owner false, ResourceToolkitLock[obj 0x7a3ab776, isOwner false, <3418ddd8, 5270b55>[count 0, qsz 0, owner ]]]

at jogamp.opengl.x11.glx.X11GLXDrawableFactory$SharedResourceImplementation.createSharedResource(X11GLXDrawableFactory.java:326)

at jogamp.opengl.SharedResourceRunner.run(SharedResourceRunner.java:297)

at java.lang.Thread.run(Thread.java:748)

Caused by: com.jogamp.opengl.GLException: AWT-EventQueue-0-SharedResourceRunner: Unable to create temp OpenGL context(1)

at jogamp.opengl.x11.glx.X11GLXContext.createImpl(X11GLXContext.java:368)

at jogamp.opengl.GLContextImpl.makeCurrentWithinLock(GLContextImpl.java:759)

at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:642)

at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:580)

at jogamp.opengl.x11.glx.X11GLXDrawableFactory$SharedResourceImplementation.createSharedResource(X11GLXDrawableFactory.java:297)

… 2 more

MovieDemo

MovieDemo.m is short. Read it to see how easy it

is to show movies.

PTB-INFO: This is Psychtoolbox-3 for GNU/Linux X11, under Matlab 64-Bit (Version 3.0.17 - Build date: Oct 31 2020).

PTB-INFO: OS support status: Linux 5.8.0-43-generic Supported.

PTB-INFO: Type ‘PsychtoolboxVersion’ for more detailed version information.

PTB-INFO: Most parts of the Psychtoolbox distribution are licensed to you under terms of the MIT License, with

PTB-INFO: some restrictions. See file ‘License.txt’ in the Psychtoolbox root folder for the exact licensing conditions.

PTB-INFO: For information about paid priority support, community membership and commercial services, please type

PTB-INFO: ‘PsychPaidSupportAndServices’.

PTB-INFO: Connected to Advanced Micro Devices, Inc. [AMD/ATI] Lexa PRO [Radeon 540/540X/550/550X / RX 540X/550/550X] GPU with DCE-11.0 display engine [6 heads].

PTB-ERROR:[glXCreateContext() failed] OpenGL context creation failed!

PTB-ERROR[Low-Level setup of window failed]:The specified gpu + display + gfx-driver combo may not support some requested feature.

エラー: Screen

See error message printed above.

エラー: MovieDemo (line 124)

[window,windowRect]=Screen(screenNumber,‘OpenWindow’,0,[],[],2);

Also, when I typed the ptb3-matlab code from the Linux command prompt, it returned the following error:

libGL error: MESA-LOADER: failed to open radeonsi (search paths /usr/lib/x86_64-linux-gnu/dri:$${ORIGIN}/dri:/usr/lib/dri)

libGL error: failed to load driver: radeonsi

libGL error: MESA-LOADER: failed to open radeonsi (search paths /usr/lib/x86_64-linux-gnu/dri:$${ORIGIN}/dri:/usr/lib/dri)

libGL error: failed to load driver: radeonsi

libGL error: MESA-LOADER: failed to open swrast (search paths /usr/lib/x86_64-linux-gnu/dri:$${ORIGIN}/dri:/usr/lib/dri)

libGL error: failed to load driver: swrast

I’m using the latest Linux kernel (5.8.0-43-generic) and probably using the latest driver of amdgpu (not amdgpu-pro), so I don’t know why I’m getting the error message above. Does anyone have a solution?

Thanks for the support!

This question has been asked and answered many times before, searching the forum for snippets of the error messages will do wonders:

-mario

Mario, I wonder if this common mistake can be flagged in PsychLinuxConfiguration.m somehow? Currently you do check software opengl for old matlab versions: Psychtoolbox-3/PsychLinuxConfiguration.m at master · kleinerm/Psychtoolbox-3 · GitHub — I’m not sure the best way to probe for this, we need to confirm matlab-support is installed and the libraries have been replaced, that may be too flakey to reliably probe for?

1 Like

Dear Mario,

Thank you for your comment. I can solve the problem!

Probably not impossible, but this quickly gets convoluted, especially as/if Mathworks shuffles things around in different versions. We have the same problems with the macOS and Windows versions, just the symptoms caused by them are different on each OS. And with Apples trainwrecks one never quite knows what is whose fault, although most of the time it is Apple. I wish Mathworks software engineering in certain areas like graphics/plotting system, or their installer wouldn’t be so poor, given this is a premium price product.

What i did yesterday is rewrite our download instructions on the website once again, adding more guidance towards this issue.

-mario

1 Like