For those interested, I think I’ve had luck successfully building manylinux2010 wheels for psychtoolbox. The repository can be found at https://github.com/aforren1/ptb-wheels, and wheels for python 3.6 and 3.7 can be found at https://github.com/aforren1/ptb-wheels/releases. The demos seem to work (minus a segfault in the HID example if I didn’t set sudo setcap cap_sys_nice=eip ... on python).
This may also require a newer version of pip (19.0+?)
That’s fantastic news. I didn’t know that manylinux2010 was generally available. Nice!
We’ll need to chat about how to coordinate - I’m currently maintainer of the project on PyPI so either I need to add you to that or I need to copy over your recipe so I can build the wheels myself.
I am not very experienced in Ubuntu administration and I have been really struggling with getting psychopy (ver 3.2) installed on 18.4.
First I had tried it with Anaconda utilizing various hints on the net, but gave up after several days, because always some component was missing or apparently the wrong version, when I tried to run demos or own scripts.
Since I decided to use system python it seems I am almost there.
With a lot of help from Google and some trial and error I found I had to downgrade pyglet to 1.3.2 and wxpython to 4.02 for example, but I just can’t make psychtoolbox work.
I had tried many and probably stupid ways of installing psychtoolbox (like apt octave-psychtoolbox-3 and pip3 install psychtoolbox), which I think led to “module not found” or something in psychopy.
Now with one of the wheels mentioned above
(https://github.com/aforren1/ptb-wheels/releases/download/0.0.20/psychtoolbox-3.0.16-cp36-cp36m-manylinux2010_x86_64.whl) psychtoolbox seems at least to be recognized by psychopy, which was a great relief. However, all scripts requiring keyboard input are crashing with the error message
“PTB-CRITICAL: In call to PsychSetThreadPriority(): Failed to set new basePriority 2, tweakPriority 1, effective 1 [REALTIME] for thread (nil) provided!”.
Can anybody help with that?
Btw I had upgraded pip to the latest version following the above remark concerning HID but for obvious reasons cannot tell whether that helped.
Detlef
SOLVED!
Jon, thanks for your comment.
It was my understanding as well that the problem lies in psychopy’s or psychtoolbox’s inability to change task priority on the Ubuntu machine.
Actually I had overlooked this document, which mentions the solution: http://psychtoolbox.org/docs/Priority
The problem is that one needs to be root on Ubuntu to change priority. There is a script that generates a new privileged group named psychtoolbox and places the user into that group.
The above mentioned document reads,
“To enable use of Priority(), you must run the script PsychLinuxConfiguration at least once and follow its instructions”.
To run that script, after adding the neurodebian ppa to my Ubuntu setup I installed octave and psychtoolbox like that:
sudo apt install octave
sudo apt install psychtoolbox-3-common
sudo apt install octave-psychtoolbox
then I started octave from a terminal (was told to do after first trying the gui version):
octave --no-gui
and executed the (interactive) script
PsychLinuxConfiguration.m
which resides in
/usr/share/psychtoolbox-3/
After a reboot I was good to go in psychopy
I really wonder why others do not have to go throught that procedure.
Detlef
Let me know if you want me to clarify anything. I also added Appveyor+Windows wheels over the weekend.
@Detlef Sorry I was unclear, having an up-to-date pip is necessary for installing this sort of wheel in the first place, unrelated to the HID stuff.
Re: allowing changes in priority, you could also use setcap (from the libcap2-bin package if you don’t have it yet, mentioned in the docs for psychopy.core.rush) like:
sudo setcap cap_sys_nice=eip <path to python executable>
This will allow that particular python executable to modify the scheduler machinery when regular users invoke it, but note the warning about potential issues when using with the system python. Also note that psychtoolbox does a little bit more (see 99-psychtoolboxlimits.conf).
Actually there’s another avenue for this. Eric Larson suggesting (below) a combination of azure with cibuildwheel to generate many platforms of wheel in one go
I tried out cibuildwheel for the heck of it (it’s a really nice tool!), and now I’ve built 64-bit wheels for Python 3.6-3.8 on Windows, MacOS, and Linux (wheels here).
The Windows and Linux wheels work well, but YMMV for MacOS (on a borrowed High Sierra machine, the audio examples worked fine; the HID examples failed with a EXC_BAD_INSTRUCTION due to an issue with dispatch_sync, and I didn’t get the chance to diagnose whether it was a OS/PTB/python issue).