| Reference | Downloads | Github

No Window on 2nd monitor with screen=1 (dual-head Linux)


i have a dual-head 1920x1200 each (HDMI, DVI) setup running linux with “zaphodheads” in radeon as independent monitors.

If in Coder I define a visual.Window with option “screen=0” it works.
If I try “screen=1” I get a Warning: “Requested an unavailable screen number - using first available”.
Ok, Coder sees only a single monitor, the first.

But if I start the Coder on the second Monitor with


then also here the window, no matter of screen number (same Warning as above if!=0), opens on first Monitor. While I would expect it to open on the same, that is the second monitor.

Also screen=10 or 11 does not work (the offset of xorg)

Please: How can I open the window on my second monitor?
Thanks a lot!

1 Like

Hi, I don’t know if my reply will help you, but your message helped me figure out an issue of mine so I thought I’d chime in. I would also be interested in finding out if you ever made progress on this problem on your own, sometime in the past 30 days.

In my case, I was able to get our task running on the second monitor (with a similar display configuration to yours) with a line like:

DISPLAY=:1.1 python

In other words, I run the task directly without opening it in PsychoPy Coder first. And also, at least in our setup, the main display number was 1, not 0, although this is likely going to be different for different people. (We are on Ubuntu 16.04 and using an NVidia graphics card, but with a similar zaphodheads-style setup.)

It is worth noting that PsychoPy still only seems to be aware of a single monitor (i.e. whichever one matches what you have set the DISPLAY environment variable to) – our task doesn’t work with any screen number higher than 0. But as long as we set DISPLAY equal to the correct X display for our monitor, that is OK for our purposes.

Hope I was clear – let me know if any questions.


Hi Matt,

thanks a lot for your answer! Sorry for the delay, i had no access to the computer, but now.

Unfortunately your solution does not solve my issue, even starting from command line with
DISPLAY=:0.1 python
directly, the stimulus window does not appear on the 2nd screen (stimulus monitor), but always on the first (control monitor), no matter of screen=0 or 1 in win(). But, funny enough, the resulting graphics window, e.g. timing accuracy does show up on the second. Weird.

Any more ideas?


Same same on different machine with different graphics nouveau, Zaphodheads, DVI&HDMI.

I am also currently experiencing this issue - doesn’t matter what screen number was set (tested from 0 to 12), the window keeps appearing on the main screen. Anyone managed to resolve this yet?

I also have exactly the same issue. I cannot show stimuli on 2nd monitor in ubuntu. The ‘screen=1’ option gives the warning: “Requested an unavailable screen number - using first available”.

Further, the option “DISPLAY=:0.1 python” still shows stimuli only on 1st screen, though this only happens with psychopy code; e.g. if I use “DISPLAY=:0.1 xload”, this shows normally on 2nd monitor). I appreciate if anybody can offer a suggestion!

Thank you,

I believe I have found a solution. I enabled Xinerama in my xorg.conf file:

Section “ServerLayout”
Identifier “Layout0”
Screen 0 “Screen0” 0 0
Screen 1 “Screen1” RightOf “Screen0”
InputDevice “Keyboard0” “CoreKeyboard”
InputDevice “Mouse0” “CorePointer”
Option “Xinerama” “1”

Hi Dimitrios,

thanks for trying!

But xinerama is not recommended at all in order to get proper
independent and accurate timing for the two monitors. Sorry.


Hi again,

I realized that downgrading from pyglet 1.3.x to 1.1.4 solves the problem! (without xinerama).


I realise that this question is nearly 4 years old, but did you find a solution to this? I am having the same problem with psychopy 2021.1.3 (and downgrading pyglet didn’t work for me).


I am sorry, unfortunately not. I even cannot install psychopy anymore, I tried severval times meanwhile, but without any success. Psychopy insists in using the outdated libwebkitgtk in version 1 instead of the recent (and only available) Version libwebkit2gtk-4.0. Did you happen to succeed?

A little hope would be, that opening a second screen in pure glfw now works correctly in one recent setup for me. Which didn’t before, eventually being the show-stopper for psychopy?

I found that since pyglet v1.2 it is possible to specify which X11 display to use, see here

In psychopy/visual/backends/ it is hardcoded as get_default_display(), it should be an easy fix to allow get_display(name) according to some keyword argument. I will try it when I am back in the office next week and let you know.

I install psychopy through anaconda since it ensures that all the dependencies are met (at least on my linux box).