gpt4 book ai didi

pygame - 使用 psychopy 时如何在不更改窗口类型的情况下克服 "RuntimeError: Gamma ramp size is reported as 0."?

转载 作者:行者123 更新时间:2023-12-01 15:43:24 26 4
gpt4 key购买 nike

我开发了一个程序,使用装有 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/psychopy/visual/backends/gamma.py)。

另请注意,我已经尝试使用 anaconda 的 python2.7 和 python3.5 psychopy 安装说明,如下所述: http://psychopy.org/installation.html

最佳答案

Another solution given involves ensuring that xf86-video-intel is installed to give a sensible LUT size, I have tried this and it seems that this driver is installed as default on Ubuntu 18, so this does not work for me.

您可能需要 set the driver in a configuration file .为此,编辑您的 /etc/X11/xorg.conf.d/20-intel.conf 文件(如果不存在则创建它)以包含以下行:

Section "Device"
Identifier "Intel Graphics"
Driver "intel"
EndSection

关于pygame - 使用 psychopy 时如何在不更改窗口类型的情况下克服 "RuntimeError: Gamma ramp size is reported as 0."?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53340798/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com