hi, i'm attempting to setup a Linux/MATLAB/Psychtoolbox system for the very first time (on a 2011 MacBook Pro with OS X 10.9.4).
i have searched the interwebs and found various bits and pieces of information, but so far i haven't been able to locate a single coherent up-to-date method.
Ja, because there isn't any atm. Everything is in transition as always, even our Wiki is in transition...
stumbling around in the semi-dark, so far i have:
- installed Ubuntu 14.04 LTS 64 bit into a Parallels VM (just for convenience at this stage, once i am familiar with the method i will create a new physical machine on another volume)
-> Just to be clear: PTB will not work in any meaningful way inside a VM. That's just one abstraction layer between the true hardware/os and ptb too much. And timing goes out of the window inside a VM. If it detects it is running in a VirtualBox VM, it will enter some compat mode to at least limp along for basic testing - i'm compiling inside VM's, so i need that. On other VM's you'll likely stumble from one sync failure or timing problem to the next.
-
installed a low-latency kernel with: sudo apt-get install linux-lowlatency
-> Good.
- installed MATLAB 2014a 64 bit
-> Good. Although you should probably give octave a good try. Since 14.04-LTS, octave 3.8.1 ships. It has a reasonably working GUI, so if you don't need special Matlab toolboxes, GUI programming, or classdef object oriented programming, octave might be good enough. I essentially only work in octave by now and fire up Matlab only for final compilation/testing of PTB before a release.
-
installed freeglut using: sudo apt-get install freeglut3-dev
-> Don't need this if you use NeuroDebian repos. They will auto-install anything needed.
- added the NeuroDebian repo to the package apt package management system
-
installed the Psychtoolbox using: sudo apt-get install octave-psychtoolbox-3
-> Good. Now you have everything you need to run "octave --force-gui", fire up octave and use PTB. The only thing you should probably do is run PsychLinuxConfiguration once, follow its instructions and then reboot the machine once. It will allow realtime scheduling and enable access to various hardware, e.g., CRS and VPixx equipment, etc. without the need to run the software as system adminstrator. Ok, unless you're in a Virtual machine. Then running that script is pointless.
- i also installed the psychtoolbox-common, -lib, and -dbg packages using apt (although i have no idea if these are strictly necessary)
- added /usr/lib/psychtoolbox-3 to the MATLAB path
- added /usr/share/psychtoolbox-3 to the MATLAB path
-> These 3 steps are not needed, Neurodebian will have set this up already.
However, now you've only installed mex files for octave, not for Matlab. If you do a
sudo apt-get install matlab-psychtoolbox-3
it will also get all Matlab specific stuff. It won't add PTB to the Matlab path though. There's some wrapper command "ptb3-matlab" you can call which will start Matlab with the path added during that session, or you add the path manually. See the following page, which is not advertised on NeuroDebians software list, because they don't like to advertise use of proprietary software like Matlab - they see it as a "neccessary evil" / stop-gap measure until all Matlab toolkits have been perfectly ported to octave:
matlab-psychtoolbox-3 – toolbox for vision research – Matlab bindings — Debian Neuroscience Package Repository
Then it should likely work, although i always overlook something.
There are optional packages matlab-psychtoolbox-nonfree and octave-psychtoolbox-nonfree. These contain the mex files for Eyelink and Datapixx. In the case of Datapixx this is just historical, it doesn't need to be in a "non-free" package, as its code is open-source. In case of Eyelink this is because it requires SR-Research's proprietary runtime libraries.
Ok, further stuff related to graphics drivers, once you actually run on real hardware:
"help SyncTrouble" explains in a Linux specific section how to setup the graphics drivers optimally for good timing precision.
Graphics driver recommendations:
On a Intel gpu, use the open-source drivers. Well there aren't any other drivers, so obviously you use those. But they are of better quality for vision science applications than the drivers on OSX (bearable) or Windows (disaster) anyway. Obviously you'll need a recent Intel gpu for good performance, old Intel parts are just not good enough for most vision science apps.
On a AMD gpu, use the open-source drivers. They have many goodies for vision science applications. If those don't work for your specific graphics card, you can install AMD's proprietary Catalyst drivers and hope for the best while expecting the worst. They have a bit higher absolute performance, but lack all the cool vision science bonus features and have more bugs, ie., they are just as bad as on MS-Windows or to some degree on OSX.
On a NVidia gpu, i'd usually say the same as on AMD. Try the open-source driver, back off to the NVidia proprietary driver if the oss driver doesn't work well. Except that the NVidia proprietary driver is usually of very good quality, and the oss driver is pretty much unuseable for vision science in Ubuntu 14.04-LTS. We are working on fixing those bugs, so the oss driver "nouveau" should be a good choice again in the future, but this is still ongoing work.
In general, the open-source drivers are a good initial pick. They work well on most hardware, don't require any installation, and i'm working with the developers on these drivers, so they have a couple of cool bonus features and improvements for vision science applications. If those are not good enough, because you encounter a bug or limitation on your specific hardware/for your specific task, there are the proprietary drivers from NVidia and AMD as a backup solution, which are as good as or better than what you get for Windows or OSX in the case of NVidia, and equally bad as what you get on Windows or OSX in the case of AMD.
What else? Choice of desktop environment. Ubuntu's default desktop "Unity" works well for single display setups, and not great at all (in 14.04) for multi-display. Other desktops you can install like KDE, GNOME-2, GNOME-3, ... work well in multi-display configs.
Then there's the issue of screens:
If you use all your displays for fullscreen stimulus presentation on all attached displays on PTB screen 0 aka x-screen 0, everything is fine.
If you need a separate PTB screen (aka x-screen) for stimulus and Matlab/Octave GUI, then extra configuration is needed. The forum contains bits and pieces about creating custom "xorg.conf" files for that.
Multi-display handling on Linux is different from the other os'es, well it's different on each os, but you usually don't notice this if you only work on one os.
That for a starter, oh and welcome to a better world - at least on average, and in the long-run, even if it doesn't feel to you like that so far :)
-mario
if i attempt to run Screen i get this error message:
In place of the expected mex file this placeholder file was executed:
Screen
This mex file seems to be missing or inaccessible on your Matlab path or it is dysfunctional:
Screen.mexa64
Hmm. I cannot find the file on your Matlab path?!?
One reason could be that your Matlab path is wrong or not up to date
for the current Psychtoolbox. You may want to run SetupPsychtoolbox to
fix possible path problems.
however SetupPsychtoolbox does not exist in the distro. nor does Screen.mexa64 as far as i can see.
the other packages that the error output of AssertOpenGL mentions (the USB and 1394 libs) appear to come installed with Ubuntu by default.
at this point as a Linux noob i'm not sure what to do next, and i'd rather not semi-randomly install packages with my fingers crossed...
any helpful hints would be much appreciated!