psychopy.org | Reference | Downloads | Github

XVFB Headless Node

Hello All! :slight_smile:

I’m a SYSADMIN at Brown Unviersity trying to help a researcher run some code.

As a test we want to run this code https://www.programmingvisualillusionsforeveryone.online/Lilac.py

On Ubuntu 16.04, Anaconda, Python 3.6, PsychoPy 3.2.3

xvfb-run -s “-screen 0 1400x900x24 -ac +extension GLX +render -noreset” python g.py
pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html
Xlib: extension “XFree86-VidModeExtension” missing on display “:99”.
Traceback (most recent call last):
File “g.py”, line 4, in
myWin = visual.Window(color=[0,0,0], units=‘pix’, size=[1000,1000], allowGUI=False, fullscr=False, gammaErrorPolicy=‘ignore’)#creates a window
File “/home/x/.conda/envs/psypy3/lib/python3.6/site-packages/psychopy/visual/window.py”, line 416, in init
self.backend = backends.getBackend(win=self, *args, **kwargs)
File “/home/x/.conda/envs/psypy3/lib/python3.6/site-packages/psychopy/visual/backends/init.py”, line 32, in getBackend
return Backend(win, *args, **kwargs)
File “/home/x/.conda/envs/psypy3/lib/python3.6/site-packages/psychopy/visual/backends/pygletbackend.py”, line 239, in init
self._origGammaRamp = self.getGammaRamp()
File “/home/x/.conda/envs/psypy3/lib/python3.6/site-packages/psychopy/visual/backends/pygletbackend.py”, line 347, in getGammaRamp
self.screenID, self.xDisplay, gammaErrorPolicy=self._gammaErrorPolicy
File “/home/x/.conda/envs/psypy3/lib/python3.6/site-packages/psychopy/visual/backends/gamma.py”, line 149, in getGammaRamp
rampSize = getGammaRampSize(screenID, xDisplay=xDisplay)
File “/home/x/.conda/envs/psypy3/lib/python3.6/site-packages/psychopy/visual/backends/gamma.py”, line 321, in getGammaRampSize
raise OSError(raise_msg.format(func=func))
OSError: The hardware look-up table (XF86VidModeGetGammaRampSize) was unable to be used. If you would like to proceed without look-up table (gamma) changes, you can set the Window parameter gammaErrorPolicy to "warn" or "ignore".
3.2585 WARNING Monitor specification not found. Creating a temporary one…
Exception ignored in: <bound method Window.del of <psychopy.visual.window.Window object at 0x7f4f558e8048>>
Traceback (most recent call last):
File “/home/x/.conda/envs/psypy3/lib/python3.6/site-packages/psychopy/visual/window.py”, line 529, in del
self.close()
File “/home/x/.conda/envs/psypy3/lib/python3.6/site-packages/psychopy/visual/window.py”, line 1517, in close
self.backend.close() # moved here, dereferencing the window prevents
AttributeError: ‘NoneType’ object has no attribute ‘close’

Change your winType to “glfw” and install this modified version of psychopy which will allow you to run it headless: https://github.com/mfiless/headless-psychopy