| Reference | Downloads | Github

[SOLVED] Running Psychopy in Ubuntu shows half the normal refresh rate



Hi everyone,

My lab has recently changed the set up of the EEG and stimuli PCs, and we are now running on Ubuntu but with a Windows 7 partition. The code for my experiment runs fine on the Windows partition, at the full 144Hz that it should (printed refresh rate at the start and checked with the benchmark wizard). However if I run the same experiment from within Ubuntu I get 72Hz, both from the benchmark wizard and printing at the start. The experiment does also take twice as long.

I tried reducing the refresh rate in case it was too fast for the script (I am loading images each trial) to 85Hz, but again on Ubuntu I was then getting 42.5Hz, again half of what it should be. I saw someone else on here found that reducing the resolution helped, but this did not work for me. In fact, I think it made it even worse.

I am not very familiar with Ubuntu so I’m not really sure how to go from here. While I do have the option of running things from Windows, it’s important that I get things running on Ubuntu.

Apologies if I am unable to provide more information for the next few days as I am travelling for work.


Incorrect frame rate on Linux with Multi-monitor setup

Yes, we’ve seen this before. It seems like a clash between psychopy waiting for the refresh to complete but ubuntu desktop also waiting for the refresh. The result is a double wait. Turn off waitBlanking in the PsychoPy Window and you should be fine. We’re talking about how to detect this issue automatically and do it for you but haven’t worked out how yet.


Thanks for the quick reply, this solved the problem entirely! I’ll let everyone in my lab know how to avoid the issue.


Just to add to this: I experienced the same problem (Ubuntu 16.04, psychopy 1.83.04) and solved it by turning off “Sync to VBlank” in my NVIDIA settings app. The advantage is that I can send the code to collaborators without deleting the waitBlanking. Of course, you have to be sure that you really want to disable vsync system-wide, but unless you’re a gamer, it shouldn’t really affect any activities.


I had the same problem on Arch Linux with the proprietary nvidia drivers and I also solved it by turning off “Sync to VBlank”. I think it may have only happened when the monitor was rotated. I have never had this issue with ATI cards (either with the open source or proprietary drivers) or Intel cards. I don’t have a nvidia card anymore to test, but it should be possible to programmatically detect the nvidia driver and the vblank sync setting (and probably change it).


@daniel.e.shub, My monitor is rotated as well! There’s no problem on Windows on the same hardware.


Just to add a wrinkle to this, in Arch on my machine at least (non-rotated monitor) - the ‘Sync to VBlank’ setting doesn’t seem to persist across X restarts without re-opening ‘nvidia-settings’. It will show as unchecked (i.e. no need to disable it again), but without re-opening ‘nvidia-settings’ it will be (functionally) ‘on’ and the refresh will be incorrect.

For example:
Test refresh = 30Hz
Open ‘nvidia-settings’, uncheck 'Sync to VBlank’
Test refresh = 60Hz
Restart X
Test refresh = 30Hz
Open ‘nvidia-settings’, ‘Sync to VBlank’ is still unchecked
Test refresh = 60Hz


This seems to be back again in my setup. Linux 4.9.35, Nvidia Driver 384.47, GTX1060 3G, BenQ 2730 . After tweaking the monitor and fiddling with the driver I can get 7 ms refresh rates as verified with a scope. The problem is that I get 2 frames of everything (rock solid) instead of 1.

in a loop, I do


Reliably produces 2 white frames (screen background colour) then 2 black frames ( dot is black ).

I have tried adding a 2 ms delay between flips. No change. I have also tried the combinations of
waitBlanking =False and toggling the Vblank and Flipping in the Nvidia settings… Most every
combination makes the drawing worse ( tearing, variable # frames on/off, etc. )

Any suggestions?