我开发了一个程序,使用带有Ubuntu 16.04、NVIDIA GPU和相关驱动程序的机器在psychopy
中播放视频。这个程序在这台机器上运行得很好。该程序相当大,但值得注意的是,它使用visual.Window(fullscr=True)
,默认情况下使用pyglet
后端,也使用visual.MovieStim3
。我现在正试图在另一台带有Ubuntu 18.04.1 LTS和集成英特尔图形(HD graphics 620(Kaby Lake GT2((的机器上运行此程序,但遇到了问题。下面的新机器驱动程序信息:
*-display
description: VGA compatible controller
product: Intel Corporation
vendor: Intel Corporation
physical id: 2
bus info: pci@0000:00:02.0
version: 02
width: 64 bits
clock: 33MHz
capabilities: pciexpress msi pm vga_controller bus_master cap_list rom
configuration: driver=i915 latency=0
resources: irq:128 memory:ee000000-eeffffff memory:d0000000-dfffffff ioport:f000(size=64) memory:c0000-dffff
以下是我运行程序时的回溯:
Traceback (most recent call last):
File "/home/adf/mxj719/experiments/video_sorting/video_sorting.py", line 456, in <module>
start_sorting(av_original_csv, user, usr_csv, bonus, last_video)
File "/home/adf/mxj719/experiments/video_sorting/video_sorting.py", line 357, in start_sorting
win = visual.Window(fullscr=True)
File "/home/adf/mxj719/.conda/envs/conda_psychopy/lib/python2.7/site-packages/psychopy/visual/window.py", line 375, in __init__
self.backend = backends.getBackend(win=self, *args, **kwargs)
File "/home/adf/mxj719/.conda/envs/conda_psychopy/lib/python2.7/site-packages/psychopy/visual/backends/__init__.py", line 32, in getBackend
return Backend(win, *args, **kwargs)
File "/home/adf/mxj719/.conda/envs/conda_psychopy/lib/python2.7/site-packages/psychopy/visual/backends/pygletbackend.py", line 227, in __init__
self._origGammaRamp = self.getGammaRamp()
File "/home/adf/mxj719/.conda/envs/conda_psychopy/lib/python2.7/site-packages/psychopy/visual/backends/pygletbackend.py", line 326, in getGammaRamp
return getGammaRamp(self.screenID, self.xDisplay)
File "/home/adf/mxj719/.conda/envs/conda_psychopy/lib/python2.7/site-packages/psychopy/visual/backends/gamma.py", line 120, in getGammaRamp
rampSize = getGammaRampSize(screenID, xDisplay=xDisplay)
File "/home/adf/mxj719/.conda/envs/conda_psychopy/lib/python2.7/site-packages/psychopy/visual/backends/gamma.py", line 285, in getGammaRampSize
raise RuntimeError("Gamma ramp size is reported as 0.")
RuntimeError: Gamma ramp size is reported as 0.
Segmentation fault
这似乎是一个常见的问题:https://discourse.psychopy.org/t/gamma-problem-in-v1-90-2/4549
但每个解决方案都涉及将visual.Window
类型切换为pygame
(现在对于psychopy
来说已经过时了(或glfw
(这不是一个简单的设置,而且非常新,并且没有很好的文档记录(。我想要一个允许我继续使用pyglet
的解决方案。
给出的另一个解决方案是确保安装xf86-video-intel
以提供合理的LUT大小,我已经尝试过了,而且这个驱动程序似乎是作为默认安装在Ubuntu 18上的,所以这对我来说不起作用
还有人提到,我可以在源代码中注释掉RuntimeError
,但我找不到他们指出的代码行。(/usr/lib/python2.7/dist packages/psycopy/visual/backends/gamma.py(。
还请注意,我已经尝试过使用anaconda的python2.7和python3.5psychopy
安装说明,如下所示:http://psychopy.org/installation.html
给出的另一个解决方案涉及确保xf86视频intel的安装能够提供合理的LUT大小,我已经尝试过了,而且这个驱动程序似乎是作为默认安装在Ubuntu 18上的,所以这对我来说不起作用。
您可能需要在配置文件中设置驱动程序。为此,请编辑/etc/X11/xorg.conf.d/20-intel.conf
文件(如果不存在,则创建它(以包含以下行:
Section "Device"
Identifier "Intel Graphics"
Driver "intel"
EndSection