How to revert PsychLinuxConfiguration() modifications

Dear all,

I am running Ubuntu 20.04.2 LTS (Focal Fossa) on a AMD Ryzen 7 4800H and Nvidia RTX 2060. I disabled my nvidia GPU, so my my system runs on iGPU (Radeon graphics). Last week I ran the PsychLinuxConfiguration.m script because I was not able to use PyschImaging() function and PTB recommended to me do that. However, after running this config script I am getting these errors on my terminal;

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

and these line in matlab on startup;

com.jogamp.opengl.GLException: X11GLXDrawableFactory - Could not initialize shared resources for X11GraphicsDevice[type .x11, connection :0, unitID 0, handle 0x0, owner false, ResourceToolkitLock[obj 0x60b8ad49, isOwner false, <43c301f3, 590a400f>[count 0, qsz 0, owner <NULL>]]]
	at jogamp.opengl.x11.glx.X11GLXDrawableFactory$SharedResourceImplementation.createSharedResource(
Caused by: com.jogamp.opengl.GLException: AWT-EventQueue-0-SharedResourceRunner: Unable to create temp OpenGL context(1)
	at jogamp.opengl.x11.glx.X11GLXContext.createImpl(
	at jogamp.opengl.GLContextImpl.makeCurrentWithinLock(
	at jogamp.opengl.GLContextImpl.makeCurrent(
	at jogamp.opengl.GLContextImpl.makeCurrent(
	at jogamp.opengl.x11.glx.X11GLXDrawableFactory$SharedResourceImplementation.createSharedResource(
	... 2 more

Also, my fans are going full speed while running matlab.

I tried to revert PsychLinuxConfiguration configurations by removing the files that are created by it such as

  • /etc/security/limits.d/99-psychtoolboxlimits.conf
  • /etc/modprobe.d/amddeepcolor-psychtoolbox.conf
  • /etc/udev/rules.d/psychtoolbox.rules
    … and etc.

But deleting them did not solve my issue. Is there a way to revert all these changes?

PsychLinuxConfiguration is not the reason for your issues, Matlab is. What our script does is it enables hardware accelerated OpenGL, instead of Matlab’s ancient software renderer. The error messages you see are due to Matlab C++ library conflicts, and other Matlab awfulness.

If you run Psychtoolbox on Octave, you will notice things work. How to fix or avoid this is described in our Download and installation instructions, also on the forum if you search for words like the ones in the error messages:


Hey Mario,

Thanks for your reply!

sudo apt-get install matlab-support

fıxed the error messages.

  • My fans are still running at full speed, but I guess it is a coincidence since they also don’t lower down while doing non-Matlab stuff.


Maybe some out of control application consuming lots of cpu is causing the fans speeding. I’d use the top command from a terminal to check for top cpu consumers, or some GUI process monitor of your choice, e.g., System monitor.

1 Like

Btw. to also answer the original question, although it wasn’t the solution for your problem:

You do what you did. Manually deleting the files and directories that PsychLinuxConfiguration copied into place or created, or undo the changes it made, by looking through the scripts code, searching for the various sudo command snippets. You’d also need to issue a
system('sudo update-initramfs -u -k all'); at the end to update the initramfs with the changed settings, and reboot once.

Most of the changes are just about creating a new Unix user group “psychtoolbox”, providing members (=user accounts / login names) of those Unix group more privileges wrt. memory and cpu and gpu use for improved realtime behaviour, access to experiment hardware like photometers, etc., and offering to automatically add the current user or selected users to that Unix user group.