| Reference | Downloads | Github -- visual.Rift(headLocked=False, samples =1) KeyError: 'size'

Hey folks,

I ran into the following error when trying to run the demo (rigth after unpacking the demos).

System information:

  • PsychoPy 3.2.4
  • (Python: 3.6.6, v3.6.6:4cf1f54eb7, Jun 27 2018, 03.37.03; [MSC v.1900 64 bit ])
  • Windows 10 Home 1709
  • XMG 15 Ultra (i7 7700K, 32GB Ram, GTX1080)
  • NVidia Driver: 441.41
##### Running: C:\Program Files\PsychoPy3\lib\site-packages\psychopy\demos\coder\hardware\ #####
pygame 1.9.4
Hello from the pygame community.
7.3578     WARNING     Monitor specification not found. Creating a temporary one...
Traceback (most recent call last):
  File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\demos\coder\hardware\", line 16, in <module>
    hmd = visual.Rift(headLocked=False, samples=1)
  File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\contrib\", line 120, in __call__
    return obj(*args, **kwargs)
  File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\visual\", line 341, in __init__
    super(Rift, self).__init__(*args, **kwargs)
  File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\visual\", line 421, in __init__
  File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\visual\", line 2223, in _setupGL
    success = self._setupFrameBuffer()
  File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\visual\", line 726, in _setupFrameBuffer
    self._mirrorRes = self.size
  File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\visual\", line 351, in size
    return self.__dict__['size']
KeyError: 'size'

In case one of you encountered the same error upon using the rift class I’d be happy to know of any solution or that this is a known error.

Kind regards

~Are you able to update PsychoPy? I don’t seem to get that error on my end. ~ Looks like you are using it already.

1 Like

I guess one way to correct this is to explicitly specify the mirror size using the ‘mirrorRes’ attribute when creating the window.

mirrorRes=(800, 600) for instance.

1 Like

I tried to run the Demo with specified mirrorRes=(800,600), but the error still occurs. The error also occurs on another system:

GPU: RTX 2070 (no max-q)
Nvidia GPU-Driver: 441.41
CPU: I7-9750H
RAM: 16 GB

OS: Windows 10 Pro, x64, Version 1903
PsychoPy Version: 3.2.4
PsychXR Version: 0.2+

Sorry for the late reply. It appears there is a bug in the current version of PsychoPy related to the Rift class. The issue has been fixed in the development branch but those changes were not pulled in on time for that release. The HMD is currently a blind-spot in testing since it’s hard to integrate and all testing is done whenever I have time in my lab.

You might be able to run the demos using an older release of PsychoPy which uses PsychXR 0.1.5. Or, try using vanilla PsychXR 0.2+ and try out the demos.