Multiple display setup not working using XOrg.Conf Ubuntu 20.04

I am experiencing an issue when I use two screens with Psychtoolbox. I am using XOrgConfCreator and XOrgConfSelector to show my stimuli as output on 1 screen, and my Octave GUI on another screen. It was working before, but when I ran some updates, it was not working anymore. It does not fully recognize my second screen in Psychtoolbox (see: > >> Screen(‘Screens’) > ans = 0), although it does recognize my two screens using XOrgConfCreator. When I seperate the two screens, for some reason it keeps showing my stimuli on both screens (as a split screen). Hereby some relevant output:


# Auto generated xorg.conf - Created by Psychtoolbox XOrgConfCreator.

Section "ServerLayout"
  Identifier    "PTB-Hydra"
  Screen 0      "Screen0" 0 0
  Screen 1      "Screen1" RightOf "Screen0"
EndSection

Section "Monitor"
  Identifier    "HDMI-A-0"
EndSection

Section "Monitor"
  Identifier    "DisplayPort-2"
EndSection

Section "Device"
  Identifier  "Card0"
  Driver      "ati"
  Option      "ZaphodHeads" "HDMI-A-0"
  Option      "Monitor-HDMI-A-0" "HDMI-A-0"
  Screen 0
EndSection

Section "Device"
  Identifier  "Card1"
  Driver      "ati"
  Option      "ZaphodHeads" "DisplayPort-2"
  Option      "Monitor-DisplayPort-2" "DisplayPort-2"
  Screen 1
EndSection

Section "Screen"
  Identifier    "Screen0"
  Device        "Card0"
  Monitor       "HDMI-A-0"
EndSection

Section "Screen"
  Identifier    "Screen1"
  Device        "Card1"
  Monitor       "DisplayPort-2"
EndSection

xrandr:

Screen 0: minimum 320 x 200, current 2944 x 1080, maximum 16384 x 16384
DisplayPort-0 disconnected (normal left inverted right x axis y axis)
HDMI-A-0 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 527mm x 296mm
   1920x1080     60.00*+  74.97    50.00    59.94  
   1600x1200     60.00  
   1680x1050     59.88  
   1280x1024     75.02    60.02  
   1440x900      59.90  
   1280x960      60.00  
   1280x800      60.00  
   1152x864      75.00  
   1280x720      60.00    50.00    59.94  
   1024x768      75.03    60.00  
   832x624       74.55  
   800x600       75.00    60.32  
   720x576       50.00  
   720x480       60.00    59.94  
   640x480       75.00    60.00    59.94  
   720x400       70.08  
DisplayPort-1 disconnected (normal left inverted right x axis y axis)
DisplayPort-2 connected 1024x768+1920+0 (normal left inverted right x axis y axis) 1214mm x 683mm
   1024x768      60.00*+  60.00  
   1920x1080     60.00  
   1360x768      60.02  
   1280x720      60.00  
   800x600       60.00  
   640x480       60.00

------------------------------------------------------------
05:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Renoir (rev c3)
      Subsystem: Gigabyte Technology Co., Ltd Renoir
      Kernel driver in use: amdgpu
      Kernel modules: amdgpu

I think it might be related to my graphic drivers, but I tried to install another graphic driver (newer version and pro), but this did not fix the issue. I very much hope someone can help me, thank a lot in advance and let me know if I need to provide more details.

Are you sure your xorg.conf is being used as your xrandr output suggests that it is not. In which case you will need to work out why. First make sure the XOrgConfSelector has written a file to /etc/X11/xorg.conf.d/90-ptbxorg.conf — Have a look at the instructions for how to view the xorg log, e.g. https://fedoraproject.org/wiki/How_to_debug_Xorg_problems (but note some commands are different for Ubuntu) to see if there are any indications of what is going wrong.

What is your output of glxinfo -B?

Make sure you don’t install AMD pro drivers, but are using MESA ones. And is there a reason you can’t upgrade to 22.04 (which is what is supported by PTB)?

Dear Ian-Max-Andolina,

Thank you very much for your answer. XOrgConfSelector does not write a file to /etc/X11/xorg.conf.d/, instead I only have the file stored in ~/.Psychtoolbox/XorgConfs. Is that an issue? I have copied my file in XorgConfs to X11/xorg.conf.d (one of the suggestions from https://fedoraproject.org/wiki/How_to_debug_Xorg_problems), however this does not seem to help. My output of glxinfo -B is:

name of display: :0
display: :0  screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
    Vendor: AMD (0x1002)
    Device: AMD RENOIR (DRM 3.42.0, 5.15.0-78-generic, LLVM 12.0.0) (0x1636)
    Version: 21.2.6
    Accelerated: yes
    Video memory: 256MB
    Unified memory: no
    Preferred profile: core (0x1)
    Max core profile version: 4.6
    Max compat profile version: 4.6
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.2
Memory info (GL_ATI_meminfo):
    VBO free memory - total: 201 MB, largest block: 201 MB
    VBO free aux. memory - total: 2424 MB, largest block: 2424 MB
    Texture free memory - total: 201 MB, largest block: 201 MB
    Texture free aux. memory - total: 2424 MB, largest block: 2424 MB
    Renderbuffer free memory - total: 201 MB, largest block: 201 MB
    Renderbuffer free aux. memory - total: 2424 MB, largest block: 2424 MB
Memory info (GL_NVX_gpu_memory_info):
    Dedicated video memory: 256 MB
    Total available memory: 3328 MB
    Currently available dedicated video memory: 201 MB
OpenGL vendor string: AMD
OpenGL renderer string: AMD RENOIR (DRM 3.42.0, 5.15.0-78-generic, LLVM 12.0.0)
OpenGL core profile version string: 4.6 (Core Profile) Mesa 21.2.6
OpenGL core profile shading language version string: 4.60
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

OpenGL version string: 4.6 (Compatibility Profile) Mesa 21.2.6
OpenGL shading language version string: 4.60
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile

OpenGL ES profile version string: OpenGL ES 3.2 Mesa 21.2.6
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20

Does this help you any further? Again, thank you so much.

@Ian-Max-Andolina my apologies, the message was sent too early. I am using Ubuntu 20.04 instead of 22.04, because packages I am using did not work on 22.04 when it was just released. However, since the XOrgConf files are working on my other computers which have Ubuntu 20.04, I do not think this is the root issue (although I’m not sure). Also, I indeed do not have any pro drivers installed.

@Ian-Max-Andolina To add to that, XOrgConfSelector has written the file /etc/X11/xorg.conf.d/90-ptbxorg.conf, namely:

'Section "Monitor"
    Identifier "Monitor0"
    Option "PreferredMode" "1920x1080"
EndSection

Section "Monitor"
    Identifier "Monitor1"
    Option "PreferredMode" "1024x768"
EndSection

Section "Monitor"
    Identifier "Monitor2"
    Option "PreferredMode" "1024x768"
EndSection

Section "Device"
    Identifier "Card0"
    Driver "modesetting"
    Option "DRI" "3"
EndSection

Section "Device"
    Identifier "Card1"
    Driver "modesetting"
    Option "DRI" "3"
EndSection

Section "Device"
    Identifier "Card2"
    Driver "modesetting"
    Option "DRI" "3"
EndSection

Section "Screen"
    Identifier "Screen0"
    Device "Card0"
    Monitor "Monitor0"
    DefaultDepth 24
    SubSection "Display"
        Modes "1920x1080"
    EndSubSection
EndSection

Section "Screen"
    Identifier "Screen1"
    Device "Card1"
    Monitor "Monitor1"
    DefaultDepth 24
    SubSection "Display"
        Modes "1024x768"
    EndSubSection
EndSection

Section "Screen"
    Identifier "Screen2"
    Device "Card2"
    Monitor "Monitor2"
    DefaultDepth 24
    SubSection "Display"
        Modes "1024x768"
    EndSubSection
EndSection

Section "ServerLayout"
    Identifier "Layout0"
    Screen 0 "Screen0" 0 0
    Screen 1 "Screen1" RightOf "Screen0"
    Screen 2 "Screen2" RightOf "Screen1"
EndSection'

Again, thank you very much for the help.

Something looks strange with the last 90-ptbxorg.conf you sent, the order of the sections is jumbled and lack of 1st line “Created by…” comment suggest something else has edited it?

Here is an example of my 90-ptbxorg.conf created by xorgconfcreator, I have a HDMI main monitor and a second displayport monitor used by PTB:

# Auto generated xorg.conf - Created by Psychtoolbox XOrgConfCreator.

Section "ServerLayout"
  Identifier    "PTB-Hydra"
  Screen 0      "Screen0" 0 0
  Screen 1      "Screen1" RightOf "Screen0"
EndSection

Section "Monitor"
  Identifier    "HDMI-A-0"
EndSection

Section "Monitor"
  Identifier    "DisplayPort-1"
EndSection

Section "Device"
  Identifier  "Card0"
  Driver      "amdgpu"
  Option      "VariableRefresh" "off"
  Option      "AsyncFlipSecondaries" "on"
  Option      "ZaphodHeads" "HDMI-A-0"
  Option      "Monitor-HDMI-A-0" "HDMI-A-0"
  Screen 0
EndSection

Section "Device"
  Identifier  "Card1"
  Driver      "amdgpu"
  Option      "VariableRefresh" "off"
  Option      "AsyncFlipSecondaries" "on"
  Option      "ZaphodHeads" "DisplayPort-1"
  Option      "Monitor-DisplayPort-1" "DisplayPort-1"
  Screen 1
EndSection

Section "Screen"
  Identifier    "Screen0"
  Device        "Card0"
  Monitor       "HDMI-A-0"
EndSection

Section "Screen"
  Identifier    "Screen1"
  Device        "Card1"
  Monitor       "DisplayPort-1"
EndSection

Your last conf also shows 3 displays. Delete /etc/X11/xorg.conf.d/90-ptbxorg.conf and /etc/X11/xorg.conf if it exists, then I would try to reboot, make sure only two displays connected first, also try to use two displayport connectors if possible (maybe that is superstition on my part but I once had a problem with mixed outputs), then rerun xorgconfcreator, and xorgconfseletor and make sure a new file unmodified is written back to /etc/X11/xorg.conf.d/

I realise there can be packages that are slow to upgrade, and in general the Debian base of Ubuntu favours slow updates. But OS kernel and drivers do change, it has been more than 1 year, and my usual view is stick as close to what the PTB developer Mario uses as possible to minimise any surprises. Remember you can install 22.04 separately and test that without losing your 20.04.

1 Like

Indeed, that file was not created by Psychtoolbox, but a human, and it is utterly non-sensical. Lucky the X-Server rejected it and just switched back to the standard single X-Screen.

Mixing different connectors works usually, I do that all the time without problems. Mostly makes sense to stick to DP though if one wants to sync multiple displays refresh cycels for binocular stimulation (dual-display stereo etc.).

The OP should also upgrade their PTB, which seems to be very outdated (early 3.0.16 or earlier) → Their PTB is older than the graphics chip they are using - suboptimal.

I’ve got only one 20.04-LTS MS Surface Pro 6 tablet machine left, and only because I heavily customized that install a lot and also it is very low on disc space - to the point were automatic distro upgrade to 22.04 aborted and I can’t be bothered/don’t have the time right now to figure out the upgrade. But display testing is minimal, essentially only single-display testing on Intel graphics at standard color depth. Only very rarely gets a 2nd Displayport display connected or other fancy display stuff done, as this is my main personal use machine for e-mail/web/skype/netflix etc. and fiddling with it for testing is inconvenient. So XOrgConfCreator rarely gets exercised. Also, it is actually LegacyXOrgConfCreator now that runs in the background on pre-Ubuntu 22.04, which gets no improvements or fixes anymore.

But yeah, the issue here is user error(s) and possibly outdated PTB for the hardware.