Running on azure linux - bails

After running into an issue running locally on a mac book pro

(
Exception AttributeError: “‘Window’ object has no attribute ‘useNativeGamma’” in <bound method Window.del of <psychopy.visual.window.Window object at 0x7faf255a7c10>> ignored
}
)

I spun up and ubuntu azure instance and after installing some missing python dependencies after an apt install of psychopy, I have the same error (as above)

I actually have no idea what graphics support my azure instance has. I just took the default mid power machine. Is there some way I can get psychopy to check if my graphics support is sufficient? It seems a drag not to be able to run in the cloud if this really is a dependency on a local openGL card.

Seems it has opengl…

$ glxinfo
name of display: :10.0
display: :10 screen: 0
direct rendering: No (If you want to find out why, try setting LIBGL_DEBUG=verbose)
server glx vendor string: SGI
server glx version string: 1.2
server glx extensions:
GLX_EXT_import_context, GLX_EXT_visual_info, GLX_EXT_visual_rating
client glx vendor string: Mesa Project and SGI
client glx version string: 1.4
client glx extensions:
GLX_ARB_create_context, GLX_ARB_create_context_profile,
GLX_ARB_create_context_robustness, GLX_ARB_fbconfig_float,
GLX_ARB_framebuffer_sRGB, GLX_ARB_get_proc_address, GLX_ARB_multisample,
GLX_EXT_buffer_age, GLX_EXT_create_context_es2_profile,
GLX_EXT_create_context_es_profile, GLX_EXT_fbconfig_packed_float,
GLX_EXT_framebuffer_sRGB, GLX_EXT_import_context,
GLX_EXT_texture_from_pixmap, GLX_EXT_visual_info, GLX_EXT_visual_rating,
GLX_INTEL_swap_event, GLX_MESA_copy_sub_buffer,
GLX_MESA_multithread_makecurrent, GLX_MESA_query_renderer,
GLX_MESA_swap_control, GLX_OML_swap_method, GLX_OML_sync_control,
GLX_SGIS_multisample, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer,
GLX_SGIX_visual_select_group, GLX_SGI_make_current_read,
GLX_SGI_swap_control, GLX_SGI_video_sync
GLX version: 1.2
GLX extensions:
GLX_ARB_get_proc_address, GLX_EXT_import_context, GLX_EXT_visual_info,
GLX_EXT_visual_rating, GLX_MESA_multithread_makecurrent
OpenGL vendor string: Mesa project: www.mesa3d.org
OpenGL renderer string: Mesa GLX Indirect
OpenGL version string: 1.3 Mesa 4.0.4
OpenGL extensions:
GL_ARB_imaging, GL_ARB_multitexture, GL_ARB_texture_border_clamp,
GL_ARB_texture_cube_map, GL_ARB_texture_env_add,
GL_ARB_texture_env_combine, GL_ARB_texture_env_dot3,
GL_ARB_transpose_matrix, GL_EXT_abgr, GL_EXT_blend_color,
GL_EXT_blend_minmax, GL_EXT_blend_subtract, GL_EXT_draw_range_elements,
GL_EXT_multi_draw_arrays, GL_EXT_texture_env_add,
GL_EXT_texture_env_combine, GL_EXT_texture_env_dot3,
GL_EXT_texture_lod_bias, GL_SGIS_texture_border_clamp,
GL_SUN_multi_draw_arrays

8 GLX Visuals
visual x bf lv rg d st colorbuffer sr ax dp st accumbuffer ms cav
id dep cl sp sz l ci b ro r g b a F gb bf th cl r g b a ns b eat

0x024 24 tc 1 24 0 r y . 8 8 8 0 . . 0 16 0 0 0 0 0 0 0 None
0x025 24 tc 1 24 0 r y . 8 8 8 0 . . 0 16 8 16 16 16 0 0 0 None
0x026 24 tc 1 24 0 r y . 8 8 8 8 . . 0 16 8 16 16 16 16 0 0 None
0x027 24 tc 1 24 0 r . . 8 8 8 8 . . 0 16 8 16 16 16 16 0 0 None
0x028 24 dc 1 24 0 r y . 8 8 8 0 . . 0 16 0 0 0 0 0 0 0 None
0x029 24 dc 1 24 0 r y . 8 8 8 0 . . 0 16 8 16 16 16 0 0 0 None
0x02a 24 dc 1 24 0 r y . 8 8 8 8 . . 0 16 8 16 16 16 16 0 0 None
0x02b 24 dc 1 24 0 r . . 8 8 8 8 . . 0 16 8 16 16 16 16 0 0 None

I think this error can sometimes be misleading, as it can be caused by trying to close the window gracefully after encountering another error. What was the full traceback?

line 59 -->
win = visual.Window(
size=(1920, 1080), fullscr=True, screen=0,
allowGUI=False, allowStencil=False,
monitor=‘testMonitor’, color=[0,0,0], colorSpace=‘rgb’,
blendMode=‘avg’, useFBO=True)

Running: /home/lucy/Downloads/Experiment/workinprogress_lastrun.py

Traceback (most recent call last):
File “/home/lucy/Downloads/Experiment/workinprogress_lastrun.py”, line 59, in
blendMode=‘avg’, useFBO=True)
File “/home/lucy/source/psychopy/psychopy/visual/window.py”, line 379, in init
self._setupGL()
File “/home/lucy/source/psychopy/psychopy/visual/window.py”, line 1636, in _setupGL
self._setupPyglet()
File “/home/lucy/source/psychopy/psychopy/visual/window.py”, line 1488, in _setupPyglet
style=style)
File “/usr/lib/python2.7/dist-packages/pyglet/window/xlib/init.py”, line 474, in init
super(XlibWindow, self).init(*args, **kwargs)
File “/usr/lib/python2.7/dist-packages/pyglet/window/init.py”, line 644, in init
config = screen.get_best_config(config)
File “/usr/lib/python2.7/dist-packages/pyglet/window/init.py”, line 290, in get_best_config
raise NoSuchConfigException()
pyglet.window.NoSuchConfigException
Exception AttributeError: “‘Window’ object has no attribute ‘useNativeGamma’” in <bound method Window.del of <psychopy.visual.window.Window object at 0x7f6135a7ecd0>> ignored

This is result of running sysInfo.py

Welcome to PsychoPy2!
v1.85.4

Running: /home/lucy/source/psychopy/psychopy/demos/coder/sysInfo.py

Paths to files on the system:
userPrefsFile: /home/lucy/.psychopy2/userPrefs.cfg
appDataFile: /home/lucy/.psychopy2/appData.cfg
demos: /home/lucy/source/psychopy/psychopy/demos
appFile: /home/lucy/source/psychopy/psychopy/app/PsychoPy.py

System info:
Linux-4.11.0-1014-azure-x86_64-with-Ubuntu-16.04-xenial

Python info
/usr/bin/python2.7
2.7.12 (default, Nov 19 2016, 06:48:10)
[GCC 5.4.0 20160609]
numpy 1.11.0
scipy 0.17.0
matplotlib 1.5.1
pyglet 1.1.4
pyo version 0.7.8 (uses single precision)
pyo 0.7.8

PsychoPy 1.85.4
Traceback (most recent call last):
File “/home/lucy/source/psychopy/psychopy/demos/coder/sysInfo.py”, line 41, in
win = visual.Window([100, 100]) # some drivers want a window open first
File “/home/lucy/source/psychopy/psychopy/visual/window.py”, line 379, in init
self._setupGL()
File “/home/lucy/source/psychopy/psychopy/visual/window.py”, line 1636, in _setupGL
self._setupPyglet()
File “/home/lucy/source/psychopy/psychopy/visual/window.py”, line 1488, in _setupPyglet
style=style)
File “/usr/lib/python2.7/dist-packages/pyglet/window/xlib/init.py”, line 474, in init
super(XlibWindow, self).init(*args, **kwargs)
File “/usr/lib/python2.7/dist-packages/pyglet/window/init.py”, line 644, in init
config = screen.get_best_config(config)
File “/usr/lib/python2.7/dist-packages/pyglet/window/init.py”, line 290, in get_best_config
raise NoSuchConfigException()
pyglet.window.NoSuchConfigException
Exception AttributeError: “‘Window’ object has no attribute ‘useNativeGamma’” in <bound method Window.del of <psychopy.visual.window.Window object at 0x7fb98fa9e650>> ignored

Looks like it is with the pyglet library - might be related to this issue. If appropriate, you could try installing pygame and setting winType="pygame" when opening the window; that works for me over a remote connection.

Basically, pyglet (which is a lib we use but didn’t create) can’t create a window and you’d have to work out why that is from the pyglet developers. It looks liks your azure system doesn’t provide an appropriate configuration. In particular, looking at your glxinfo output, the fact that it says “direct rendering: No” suggests to me that something isn’t complete about the opengl options on your system. So that might well be the source of the problem.

I don’t know much about azure but in general virtual machines are a bad way to run PsychoPy. Even if they work (they often don’t because they don’t have the appropriate hardware access) they will always have a performance hit compared with a native machine.

It seems a drag not to be able to run in the cloud if this really is a dependency on a local openGL card.

We’ve always relied on native calls to OpenGL drivers. Sorry but that’s how we get the performance we need. The reason that we can now move to an online system without dramatic loss in performance is precisely because WebGL now allows us to to write similar calls in a web page. But that’s a totally different concept to what you’re trying here. Not sure if I understood your comment correctly.

cheers, Jon