Up to date hardware recommendations

Hi,

I’m trying to set up a new psychology lab, which means buying stimulus presentation PCs.

I have read all the posts on this on the official Psychtoolbox website and browsed through relevant topics on this forum. I tried installing it on a couple of PCs we already have. So far, only 1 setup seemed to deliver appropriate performance and no sync trouble: Dell Precision 3431 Small Form Factor Workstation with Radeon Pro WX2100 while running Ubuntu 20.04 and after disabling the built-in Intel graphics.

My supervisor insists on getting PTB to work also on a Windows system so my questions are:

  1. Is there anyway to let Windows use AMD card by default? I tried to follow some instructions on how to do this but with no effect.
  2. If we choose to buy a different PC, is the idea to get one without hybrid graphics and preferably with AMD card? Could anyone recommend any particular PC they have in the lab that works reliably in Windows?

Thank you all in advance!

Great that you chose Linux for a better life! Note: At least the timing should be equally excellent on the Intel graphics as on the AMD card, iow. you can operate both at the same time if you want. You should assign them to separate X-Screens though.

Wrt. Windows:

  1. There’s this https://pureinfotech.com/set-gpu-app-windows-10/ for selecting the default gpu to use for Matlab or Octave.Works at least for me on an up to date Windows-10. Other than that, the firmware setup of your computer would likely have some setting to disable the internal graphics, and/or booting without displays connected to the internal graphics also usually does the trick.

  2. Yes, preferably AMD, so you can Linux optimally. Wrt. hybrid graphics, there are PC’s with nice AMD Ryzen processors and good integrated AMD graphics, and the hybrid graphics can be dealt with by point 1, but if you don’t intend to use both gpu’s at the same time, you can save yourself the money for either integrated or discrete graphics card. No recommendations from me for what works well under Windows-10 though.

Hi Mario, thanks, that’s very helpful.

Especially regarding the gpu-app setting on Windows10 - it seems I haven’t managed to locate this procedure in the meanders of all the settings. I have set it as instructed, Matlab started using the Radeon card but SyncTest kept failing. I then went to fiddle with more Radeon settings and finally the Test executed fine. There’s still a “Windows DWM desktop compositor is active” warning but from what I read it seems impossible to fix so I’ll ignore it for now.
I’ll use Linux for most experiments but good to have a Windows version somewhat working now to make everyone in the Lab happy.

Regarding the hardware, we ordered an AMD processor powered HP now, so we’ll see how that goes.

Yes, it has changed a few times across Windows 10 releases, and wasn’t there at all in older versions.

That’s the Windows experience :wink: - It is often very non-deterministic, and i find myself spending minutes to hours fiddling, and often for the same reason it didn’t work before/after a reboot/after a change of weather…, it suddenly starts working again for no apparent reason. I don’t know why people voluntarily expose themselves to this when there are alternatives.

You’ll always see at least one such warning when running on Windows-10, because there’s nothing PTB could do atm. in software to reliably detect (or fix) issues caused by the DWM. Microsoft disabled the API’s that we were able to use under Windows Vista and 7 to deal with DWM. The only indirect sign that something may be wrong is frequent or permanent sync test failures because the measured timestamps are too noisy for PTB’s taste. However, absence of such PTB warnings or errors does not mean everything is working correctly (Chance of false negatives). The only way to “trust” Windows is to verify independently with some measurement equipment, ie. don’t trust it at all.

Good.
-mario

Hello Mario,

The HP machine we ordered has arrived and PTB works reasonably well on Windows (as in, no major issues setting it up except for the desktop compositor) but now I’m having trouble getting it to work on Linux.

The machine has the following specs:
Processor: AMD® Ryzen 5 pro 3400g with radeon vega graphics × 8
Graphics: Radeon RX550/550 Series (POLARIS12, DRM 3.35.0, 5.4.0-47-lowlatency, LLVM 10.0.0)

I have disabled the integrated card in BIOS and only the dedicated card is now seen.
I have installed Matlab and PTB and run the PsychLinuxConfiguration script.

When I try to launch Matlab from the terminal I get the following errors appear:
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

Predictably, when I try to launch PTB test script, the following is shown:
PTB-INFO: Failed to map GPU low-level control registers for screenId 0 [Operation not permitted].
PTB-INFO: Beamposition timestamping on NVidia and AMD gpu's, and other special functions on AMD gpu's, disabled.
PTB-INFO: You need to run the setup script PsychLinuxConfiguration once, followed by a reboot, for this to work.
PTB-INFO: Additionally, on machines with EFI firmware, EFI secure boot must be disabled, or kernel lockdown lifted.
PTB-INFO: If you are using the open-source graphics drivers, then this usually doesn't matter for typical use.
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.

Matlab’s own opengl info command leads to a low-level graphics crash.

Can anything be done about this?

Have you installed the matlab-support package? Without it, at least on my workstations with a Radeon Pro WX5100 GPUs and Ubuntu 20.04 + MATLAB 2020a, MATLAB’s hardware OpenGL always fails by default.

sudo apt-get install matlab-support

You point it to where your MATLAB is installed, and agree for it to replace the C++ libs[1], and then hardware OpenGL works fine, check using opengl info in MATLAB.

If you update MATLAB, you will need to reapply this, which requires a purge then reinstall:

sudo apt-get purge matlab-support
sudo apt-get install matlab-support

[1] I’m not sure if this is strictly necessary, this problem was supposed to be fixed, but I just always do it anyway…

1 Like

Ian’s solution is the right one, with the tweak that after a Matlab update, you could do:

sudo dpkg-reconfigure matlab-support

to only type one command instead of two to reconfigure, but both methods will work.

The problem here is a Mathworks/Matlab induced one, and unfortunately Mathworks does a very poor job at this. Matlab ships its own outdated libraries that override the proper modern libraries shipping with Ubuntu. Depending on what Matlab version you install on which Linux distro version, Matlab’s libs will either be recent enough and work, or not – but more often not. Same problem happens on other operating systems, but the symptoms differ by OS. On Linux this is the typical symptom: Failure of OpenGL hw graphics to work by default.

A good thing to check is always if it works with Octave as a well integrated solution which many times fully fulfills the needs as well as Matlab.

@Ian-Max-Andolina thank you!!! I have installed matlab-support but didn’t agree to replace the C++ libs. Now I’ve done purge and reinstall with replacement and it works! I should definitely write this down for future use as it seems my memory fails me.

@mariokleiner I know that Octave is in principle better but I’m kind of used to the Matlab interface so it’s easier to stick to it. In addition, with Octave I never managed to get the paths to work - Octave doesn’t find PTB unless I manually add path to the installation folder.

Glad that it works now. Ofc. use of Matlab is fine. Both Matlab and Octave have their strength and weaknesses, whatever you like. The mos important choice to make is to use Linux if possible. That should bring the most quality of life improvement, compared to the alternatives.

Wrt. Octave path, that would be weird though that you’d have to manually add the PTB path. The setup is (and this has not ever failed for anyone to my knowledge) that PTB is automatically added to octave’s path if you sudo apt install octave-psychtoolbox-3 installed PTB for Octave from NeuroDebian or your Ubuntu/Debian Linux distribution. Likewise, if you installed via DownloadPsychtoolbox, UpdatePsychtoolbox or SetupPsychtoolbox setting a permanent path should have been taken care of?