Problems installing PTB on Linux

The NeuroDebian site is not working so I cannot install PsychToolbox. The line “After selecting a release the setup code will be shown here.” is not being replaced with the needed commands after selecting the OS release. There is a post about this on the NeuroDebian listserve dated Aug 26th but there has been no response. I guess the maintainer is on vacation or something.

So now I’m trying a manual download of the .zip file and then ran the command SetupPsychtoolbox in the Matlab command window per the PTB instructions. I was able to download the file but it asked for a license even though I’m running it on Ubuntu and not Mac or Windows. Has the licensing requirements changed?

I went ahead and accepted the 14 day trial as I am scheduled to start running experiments Monday. The instructions indicated I needed to use the Terminal command sudo apt build-dep psychtoolbox-3 but I got the error message that “You must put some ‘deb-src’ URIs in your sources.list”.

Any suggestions?

Joe

Joe

The solution posted at apt - Error :: You must put some 'source' URIs in your sources.list - Ask Ubuntu solved the deb-src problem. On Ubuntu, I went to the software updates GUI and clicked on “source code” and closed the GUI. After that the udo apt build-dep psychtoolbox-3 command worked.

1 Like

Ran into new error message of Cannot initiate the connection to in.archive.ubuntu.com:80 when performing sudo apt build-dep psychtoolbox-3. The solution was provided at "Cannot initiate the connection to in.archive.ubuntu.com:80" when trying to run "sudo apt-get update" behind proxy - Ask Ubuntu , which was to change the Software Update setting from “server for the US” to “main server”.

New problem is that Matlab command window now comes up as a blank white square after running the PsychLinuxConfiguration script. Rebooted computer but still blank. Tried several times, no good. Google AI suggested using the Terminal with “matlab -cefdisablegpu”. It worked! I googled and couldn’t even find where it got this idea! Anyway, even more strangely, it fixed the problem. I can start Matlab even from the symbolic link without needing this option any more. No idea what is going on. Yet more funky behavior by Matlab2025a’s new graphics engine I am guessing.

1 Like

I’m also getting error messages from apt about neurodebian’s public key being invalid, so neurodebian seems to be completely off-line, at least for now.

For context, I’m trying to install PTB 3.0.22.1 on Ubuntu 24.04.3 dual boot with Windows 11 with Matlab R2025a Release 1 on a Dell Optiplex 7090 with 16GB RAM and an Nvidia GeForce GTX 1660 SUPER video card (tried a Radeon W5700 video card last year but it didn’t work. hoping it might work this time, once I’ve got everything else working).

Running a PTB test script, received error message about a “Mesa OpenGL software renderer is active” that terminated it. Am changing from the proprietary nvidia proprietary driver to the nouveau open source driver by using the Terminal command apt-get purge nvidia* and rebooting. Terminal commandsudo lshw -c video shows success.

The Matlab command window is blank again and matlab -cefdisablegpu did not help. Following another google AI suggesion, resetting matlab preferences by changing ~/.matlab/R2025a to R2025a_old so that it would create new directory fixes the Matlab problem.

New PTB error with the test script:

PTB-ERROR: You are trying to run a Screen() implementation meant only for a native XOrg X-Server
PTB-ERROR: under a XWayland fake X-Server, on top of a Wayland desktop GUI session. This is not
PTB-ERROR: supported, as XWayland has various bugs which would make Psychtoolbox hang/malfunction!
PTB-ERROR:
PTB-ERROR: Please resolve this issue now, by logging out of your desktop session and then logging in
PTB-ERROR: again while choosing a classic X11/XOrg GUI, which uses a suitable native XOrg X-Server.
PTB-ERROR: On Ubuntu Linux, there is usually a drop-down session chooser on your login screen (e.g.,
PTB-ERROR: reachable by clicking onto a little gear icon in the bottom-right corner of the screen),
PTB-ERROR: which offers options with (X11) or (Xorg) in its name, e.g., “Plasma (X11)” or
PTB-ERROR: “Ubuntu on Xorg” or “GNOME on Xorg”. These would be the right choices.
PTB-ERROR: If you really know what you are doing and absolutely want to force running under XWayland
PTB-ERROR: you could execute “clear all; setenv(‘WAYLAND_DISPLAY’); Screen(‘Preference’,‘ConserveVRAM’, 2^19);”
PTB-ERROR: and then retry. This may malfunction or hang in various ugly ways, you have been warned!

1 Like

Followed these instructions by logging back in with x11 option. Despite still having nouveau driver active according to sudo lshw -c video, got the message again:

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.

Given that nouveau is in fact an openGL mesa driver, I guess the question is why it seemed to work at one point.

To avoid risk of forgetting to use x11 option when logging in, Changed the default back to x11 by editing the etc/gdm3/custom.conf file to set the wayland flag to false.

https://linuxconfig.org/how-to-enable-disable-wayland-on-ubuntu-20-04-desktop

Matlab window went blank again. Had to reset matlab preferences folder again.

Have been encouraged to try Octave to deal with at least some issues and also because PTB not charging license with Octave.

https://wiki.octave.org/Octave_for_Debian_systems

sudo apt-get install octave sudo apt-get install octave-doc (octave-info and octave-htmldoc and octave-dbg resulted in error messages)

sudo apt-get install octave-control octave-image octave-io octave-optim octave-signal octave-statistics

This resulted in an old version: 8.4.0

AppCenter version is likewise several years out of date.

https://flathub.org/setup/Ubuntu

sudo apt install flatpak

flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo

sudo apt install gnome-software-plugin-flatpak

reboot

Desktop icon at: /usr/share/applications/org.octave.Octave.desktop

The 8.4.0 version is at /usr/bin/octave

simply clicking on the install button at https://flathub.org/en/apps/org.octave.Octave

or download the .flatpakref file did no good.

Clicking on the popup menu button next to the Install button brought up the commands:

flatpak install flathub org.octave.Octave

flatpak run org.octave.Octave --gui

worked! Running octave 10.2.0

edited /usr/share/applications/org.octave.Octave.desktop

that was installed by the 8.4.0 version so that it had the line:

Exec=flatpak run org.octave.Octave –gui

then rebooted. Now runs the 10.2.0 version.

SetupPsychtoolbox

PTB warns 10.2.0 Octave is too new!
Will go back to 8.4.0

Changing .desktop file back.

Even after rebooting, still starting up 10.2.0 version.

Calling it a day.

Uninstalling Octaves:
flatpak list –app
flatpak uninstall --delete-data org.octave.Octave
flatpak uninstall –unused

sudo apt-get remove octave
apt-get remove octave-doc

Installing Octave 7.1.0 via Ubuntu’s App Center.

SetupPsychtoolbox

ERROR: WaitSecs-MEX does not work, most likely other MEX files will not work either.
ERROR: One reason might be that your version 7.1.0 of Octave is incompatible.
ERROR: Another conceivable reason would be missing or incompatible required system libraries on your system.

ERROR: After fixing the problem, restart this installation/update routine.

Installation aborted. Fix the reported problem and retry.

Using App Center to uninstall Octave 7.1.0

https://www.geeksforgeeks.org/linux-unix/how-to-install-gnu-octave-in-linux/

sudo apt-add-repository ppa:octave/stable

sudo apt-get update

sudo apt-get install octave octave Command line Octave 8.4.0 octave –gui Octave gui starts up with 8.4.0

SetupPsychtoolbox

worked!

Was getting error messages about help files when starting up Octave.

Fixed Octave error messages by installing sqlite.

https://bugs.launchpad.net/ubuntu/+source/octave/+bug/1924836

https://www.howtoinstall.me/ubuntu/18-04/libqt5sql5-sqlite/

sudo apt install libqt5sql5-sqlite