[nvidia] Dual monitor setup with secondary monitor in portrait-right mode cause tiled windows to occupy 1.5 monitors

Bug #1874217 reported by Alan AZZERA
202
This bug affects 30 people
Affects Status Importance Assigned to Milestone
Mutter
New
Unknown
gnome-control-center
Fix Released
Unknown
mutter (Ubuntu)
Fix Released
Medium
Marco Trevisan (Treviño)

Bug Description

I'm on Ubuntu 20.04 AMD64 fully up to date and freshly rebooted.

I use dual screen : the main screen is on the left side (32"), the secondary screen (19") is at right and in portrait mode (rotated right). The window are improperly growed : they extend from full main screen to half the "witdh" of the secondary screen. Additionnally, the « pop-up » menus (eg. from settings) do not appear at the right place (see screen capture in comment). The problem disappears if I revert the orientation of secondary screen from « portrait turned right » to « landscape ». I do have gnome-shell-extension-ubuntu-dock in version 67ubuntu20.04.5, but still got the problem.

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: gnome-shell 3.36.1-5ubuntu1
ProcVersionSignature: Ubuntu 5.4.0-26.30-generic 5.4.30
Uname: Linux 5.4.0-26-generic x86_64
NonfreeKernelModules: nvidia_modeset nvidia
ApportVersion: 2.20.11-0ubuntu27
Architecture: amd64
CasperMD5CheckResult: skip
CurrentDesktop: ubuntu:GNOME
Date: Wed Apr 22 11:11:25 2020
DisplayManager: gdm3
InstallationDate: Installed on 2020-04-19 (2 days ago)
InstallationMedia: Ubuntu 20.04 LTS "Focal Fossa" - Beta amd64 (20200402)
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=fr_FR.UTF-8
 SHELL=/bin/bash
RelatedPackageVersions: mutter-common 3.36.1-3ubuntu3
SourcePackage: gnome-shell
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Alan AZZERA (azzera-alan) wrote :
Revision history for this message
Alan AZZERA (azzera-alan) wrote :

See the screen capture attached for the demonstration of the bug.

Revision history for this message
Alan AZZERA (azzera-alan) wrote :

Additionally, I just realized that if I move the mouse to the right side of my secondary screen (which is at the riht side of my primary screen), the "whole screen moves", like if I had a virtual screen which resolution exceed the native 2560x1440 of my main screen. Difficult to explain, so please watch the attached video.

Revision history for this message
Alan AZZERA (azzera-alan) wrote :

Note that the video does not show exactly what I'm experiencing. The right edge of the Firefox window is at a little bit more at right of the "middle" of the secondary screen (say +500 pixels on the 900 pixels). And then I move right the mouse to the right edge of the secondary screen, the left side of my main screen disappear (dock included).

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Thanks for the bug report. Please also report the issue to the developers here:

  https://gitlab.gnome.org/GNOME/mutter/-/issues

and then tell us the new issue ID.

tags: added: nvidia
tags: added: multimonitor
tags: removed: nvidia
summary: Dual monitor setup with secondary monitor in portrait-right mode cause
- windows to extend on half the secondary screen
+ tiled windows to occupy 1.5 monitors
Changed in gnome-shell (Ubuntu):
importance: Undecided → Low
Changed in mutter (Ubuntu):
importance: Undecided → Low
Revision history for this message
Martin Gerdzhev (mgerdzhev) wrote : Re: Dual monitor setup with secondary monitor in portrait-right mode cause tiled windows to occupy 1.5 monitors

I am running into the same issue. Was not happening on 19.10

Revision history for this message
Peter Klaesson (alphapeter) wrote :

I also experience this issue. Was not there in 19.10 for me either. It's ONLY when setting one of the monitors to portrait mode.

Currently I have to use a workaround, running ARandR or "nvidia x server settings" after login to set the displays. But I can't save the settings to make them persistent.

It would be nice to be able to use the monitor.xml to make the settings persistent.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gnome-shell (Ubuntu):
status: New → Confirmed
Changed in mutter (Ubuntu):
status: New → Confirmed
Revision history for this message
Tomek (tom-ek) wrote :

I also have the same issue with two monitors connected, one of which in portrait mode. When selecting the second monitor to switch to portrait mode, it extends the rotated monitor about halfway into the second screen and they are shown as overlapping in the display settings. It is not possible to rotate the monitor.

A temporary workaround is to set the rotation with xrandr or with the NVIDIA X Server. However, once the machine is rebooted or the screen lock turned on, the settings are "forgotten" as if one made no changes to the screen orientation at all, back to zero.

Here is also a thread on reddit with more people experiencing the exact same issue: https://www.reddit.com/r/Ubuntu/comments/g82u58/cant_rotate_monitor_orientation_in_ubuntu_2004/

About my system:

OS: Ubuntu 20.04 LTS x86_64 (all up to date)
Kernel: 5.4.0-26-generic
Uptime: 16 mins
Packages: 1575 (dpkg), 9 (snap)
Shell: bash 5.0.16
Resolution: 2160x3840, 3840x2160
DE: GNOME
WM: Mutter
WM Theme: Adwaita
Theme: Yaru-dark [GTK2/3]
Icons: Yaru [GTK2/3]
Terminal: gnome-terminal
CPU: Intel i7-6900K (16) @ 3.200GHz
GPU: NVIDIA GeForce GTX 1080 Ti
Memory: 2385MiB / 128743MiB

If needed, I can provide more information.

Revision history for this message
Tomek (tom-ek) wrote :
no longer affects: gnome-control-center (Ubuntu)
Changed in gnome-control-center (Ubuntu):
status: New → Confirmed
importance: Undecided → Low
Revision history for this message
ADFH (adfh) wrote :

Seems they've closed that bug, blaming it on the nvidia driver?

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

mutter#1209 was closed because it moved to gnome-control-center#974. And then gnome-control-center#974 was closed by the maintainer because he's in the mood for blaming Nvidia for everything, which is partly my fault...

Regardless of whether that's the right upstream bug we can track it for Ubuntu here. Next I would like to ascertain whether the presence of the randr scaling patch in our mutter build is a factor. If the bug only happens in builds with that patch then there should be no upstream bug report for this.

no longer affects: gnome-shell (Ubuntu)
tags: added: nvidia
summary: - Dual monitor setup with secondary monitor in portrait-right mode cause
- tiled windows to occupy 1.5 monitors
+ [nvidia] Dual monitor setup with secondary monitor in portrait-right
+ mode cause tiled windows to occupy 1.5 monitors
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

We also need to check to see if a multi-monitor system with only an Intel GPU has the same bug.

description: updated
Revision history for this message
Uwe Dulz (uwe.dulz) wrote :

Same issue for me with Nvidia GTX 1050 Ti.
Settings in monitor.xml are not being applied.
xrandr and nvidia-settings are able to change the monitor rotation, just gnome-settings messes it up.
Just blaming the Nvidia driver for this without giving a reason seems unprofessional to me, especially because other programs like xrandr do not have any issue setting the proper monitor setup.
To nail down the issue: screen/monitor positions can be set without problem in monitor.xml, but rotation settings are not applied or ignored.
When trying to make the settings in gnome-settings it is like described above: As long as not monitor is rotated everything can be set up nicely, but as soon as the monitor is being rotated the screen is messed up in the way described above.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Confirmed this seems to happen on Nvidia but not on Intel, both using Xorg.

It also seems closely related to bug 1875285, if not the same issue.

Changed in gnome-control-center (Ubuntu):
importance: Low → Medium
Changed in mutter (Ubuntu):
importance: Low → Medium
Revision history for this message
Uwe Dulz (uwe.dulz) wrote :

I am not sure if it's related to bug 1875285 because I am not using fractional scaling.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

You're right that it's important to note this is NOT a fractional scaling bug.

I was only talking about root causes. That other bug is also caused by mutter setting an invalid framebuffer size that's larger than the physical monitor.

Revision history for this message
Jannick Lawson (ellaweh) wrote :

I have the very same problem on RTX 2060. No Fractional Scaling activated.

Revision history for this message
Andrew Wise (andrewbts) wrote :

Exact same here with a GTX 760. Arranging in a "L" shape as mentioned here works: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/974#note_783569

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I would like to figure out if this is caused by the dormant fractional scaling patch, even while it's unused. Unfortunately I can't right now because I hit bug 1874567 instead.

Revision history for this message
Chris Seager (chriss217) wrote :

Another "me-too" I'm afraid. Screens were fine under 19.10, upgraded to 20.04 yesterday and also have 2 screens (left 32" landscape, right 22" portrait). The left screen extends over 90% of the right screen. As above it appears as a large virtual screen with a viewport scrolling inside it.
Fractional Scaling off, GPU GT730 Nvidia driver.

Revision history for this message
Chris Seager (chriss217) wrote :

An annoying "feature" of this bug is with application drop down menu's. If selecting (say) File from an app in the LHS the options of this menu drop down in a box on the left side in the RHS. Action expected: Selecting "File" should produce a menu directly under the option.
Related to this is a converse effect. With Thunderbird in the RHS, replying to an email causes a reply email dialog to pop up (possibly off-screen) in the scrolled LHS.

Revision history for this message
Chris Seager (chriss217) wrote :

An amendment to my previous post re selecting "say" File. Some applications ie. Arduino IDE behave correctly (e.g. selecting File produces a dropdown immediately under the File option in the same screen) whereas other apps ie. OpenOffice causes the dropdown under File to open in the other screen.

Revision history for this message
nugai (nugai) wrote :

FYI, I had the problems of nVidia settings not surviving since 18.04 (and every release in between) up to 20.04.

I believe the underlying cause is that gdm3 greeter opens a new X Screen for the user session after login, and a discrepancy between the X screen configurations cannot be resolved because there is no way -- or, more precisely, none that I'm aware of -- that would allow storing anywhere, a configuration for the new X Screen that gets spawned.

Proof of the existence of a new X Screen can be found by starting a remote terminal session against the target system and then running "sudo lsof /tmp/.X11-unix/X* ". Before the login, only one pid exists from node "/tmp/.X11-unix/X0". After the login, a second pid exists from node "/tmp/.X11-unix/X1". I believe this "X0" and "X1" refer to "X Screen 0" and "X Screen 1", but the /etc/X11/xorg.conf file know only about Screen 0 -- therefore initializing a new screen after every login and/or return after the screen saver has been used.

Further proof can be found by switching from gdm3 to lightdm by issuing "sudo dpkg-reconfigure lightdm". This causes other problems (with background screens and alignment of screens, etc), but it proves the fact that monitor layout configurations survive on the same hardware/software components (specifically, same version of nVidia drivers, xorg.conf files, ec), when all that changes is the display manager and how it handles X Screens.

Revision history for this message
Alan AZZERA (azzera-alan) wrote :

Nethertheless, I tried to report the bug to Gnome here : https://gitlab.gnome.org/GNOME/mutter/-/issues/1263

Revision history for this message
Liang (leoliangzhang) wrote :

Thanks to nugai's comment#25, this works for me:

1. Create a screen layout in `~/.config/monitors.xml`.
2. Copy the file to `/var/lib/gdm3/.config/` and change ownership:

  sudo cp ~/.config/monitors.xml /var/lib/gdm3/.config/
  sudo chown gdm:gdm /var/lib/gdm3/.config/monitors.xml

The monitor layout will persist across restarts and screen locks.

Revision history for this message
Travis (tadieckmann) wrote :

I have confirmed Liang's comment#27

This solution does work and persists restart and screen locks.

Changed in gnome-control-center (Ubuntu):
assignee: nobody → Daniel van Vugt (vanvugt)
importance: Medium → High
status: Confirmed → Triaged
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

When I last tested Nvidia multi-monitors I was unable to reproduce this bug. So I'm not sure I can help any time soon.

Worse still, I am now unable to test any Nvidia multi-monitor issues since my new monitors don't support (no DVI) my only Nvidia card that runs the current Nvidia drivers :S

Revision history for this message
Peter Klaesson (alphapeter) wrote :

@Daniel: Sounds like something you should be able to have access too if you are assigned to test this.

Do you have any thought about how it could be solved? I mean, you need a new card or an adapter(?) for your current card?

I have no idea how this works for you financially. Can you get what you need and get the expenses covered by Canonical?

Revision history for this message
Travis (tadieckmann) wrote : Re: [Bug 1874217] Re: [nvidia] Dual monitor setup with secondary monitor in portrait-right mode cause tiled windows to occupy 1.5 monitors

@daniel: I have 2 extra DVI to HDMI adapters that I would be happy to ship
to you if it would help in solving this issue. My DMs are open on Twitter
(@travisdieckmann) if you’d like to let me know where I can ship them.

On Wed, Jun 17, 2020 at 1:05 PM Peter Klaesson <email address hidden>
wrote:

> @Daniel: Sounds like something you should be able to have access too if
> you are assigned to test this.
>
> Do you have any thought about how it could be solved? I mean, you need a
> new card or an adapter(?) for your current card?
>
> I have no idea how this works for you financially. Can you get what you
> need and get the expenses covered by Canonical?
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1874217
>
> Title:
> [nvidia] Dual monitor setup with secondary monitor in portrait-right
> mode cause tiled windows to occupy 1.5 monitors
>
> Status in gnome-control-center:
> Unknown
> Status in Mutter:
> Unknown
> Status in gnome-control-center package in Ubuntu:
> Triaged
> Status in mutter package in Ubuntu:
> Confirmed
>
> Bug description:
> I'm on Ubuntu 20.04 AMD64 fully up to date and freshly rebooted.
>
> I use dual screen : the main screen is on the left side (32"), the
> secondary screen (19") is at right and in portrait mode (rotated
> right). The window are improperly growed : they extend from full main
> screen to half the "witdh" of the secondary screen. Additionnally, the
> « pop-up » menus (eg. from settings) do not appear at the right place
> (see screen capture in comment). The problem disappears if I revert
> the orientation of secondary screen from « portrait turned right » to
> « landscape ». I do have gnome-shell-extension-ubuntu-dock in version
> 67ubuntu20.04.5, but still got the problem.
>
> ProblemType: Bug
> DistroRelease: Ubuntu 20.04
> Package: gnome-shell 3.36.1-5ubuntu1
> ProcVersionSignature: Ubuntu 5.4.0-26.30-generic 5.4.30
> Uname: Linux 5.4.0-26-generic x86_64
> NonfreeKernelModules: nvidia_modeset nvidia
> ApportVersion: 2.20.11-0ubuntu27
> Architecture: amd64
> CasperMD5CheckResult: skip
> CurrentDesktop: ubuntu:GNOME
> Date: Wed Apr 22 11:11:25 2020
> DisplayManager: gdm3
> InstallationDate: Installed on 2020-04-19 (2 days ago)
> InstallationMedia: Ubuntu 20.04 LTS "Focal Fossa" - Beta amd64 (20200402)
> ProcEnviron:
> TERM=xterm-256color
> PATH=(custom, no user)
> XDG_RUNTIME_DIR=<set>
> LANG=fr_FR.UTF-8
> SHELL=/bin/bash
> RelatedPackageVersions: mutter-common 3.36.1-3ubuntu3
> SourcePackage: gnome-shell
> UpgradeStatus: No upgrade log present (probably fresh install)
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/gnome-control-center/+bug/1874217/+subscriptions
>
--
Best regards,
Travis Dieckmann
Ph: 317-341-2727
<email address hidden>

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I will eventually figure out a hardware configuration to work on this. Though last time I did I kept hitting bug 1874567 instead, so that might come first...

Once I am able to reproduce this bug my next priority will be to figure out if it is another one caused by x11-Add-support-for-fractional-scaling-using-Randr.patch

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

I've uploaded some test packages this ppa:
 https://launchpad.net/~ci-train-ppa-service/+archive/ubuntu/4112

Try them with:
 sudo add-apt-repository ci-train-ppa-service/4112

Can you please check if that mutter version solves the issue?

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Marking this as duplicate of #1874567 for now, if it's not the case, unmark it.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Unfortunately all the duplicates of this bug have now moved to bug 1874567. I think that might be overly confusing, especially if it turns out to not be fixed.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Since most of the bug reports are about this issue and not the other issue, I will unmark it right now. While I still have a clear list of most of the bug reports that should be moved back to this one.

Revision history for this message
Danny Lawson (dlawson-g) wrote :

Since no one responded yet, I installed the updated packages from #33, and still have the same issue.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Thanks. I expected that so that's why this bug is separate to bug 1874567 again.

Revision history for this message
Sledge Hammer (sl3ge) wrote :

Probably related:

On Ubuntu 20.04 I can only rotate my right display using the "NVidia X Server Settings"-app.
But although I save the configuration using the "Save to X Configuration File"-button,
the rotation setting is reset to landscape after signing out or rebooting.

Searching for this issue reveals dozens of new posts complaining about portrait mode not
working anymore so maybe the bug priority could be increased? Many thanks

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Danny, I've updated the packages in that PPA with further related fixes, so give it another try and let me know if anything changed please.

Revision history for this message
nyonor (cadistortion) wrote :

Hello. Is there any movements toward this bug extinction?

Revision history for this message
nyonor (cadistortion) wrote :

The bug does not occure with proprietary nvidia driver

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

This bug *is* about the proprietary nvidia driver. Are you saying it doesn't happen anymore?

Revision history for this message
Florian Schwarz (f.schwarz) wrote :

The problem isn't fixed (at least for me).

My system:
OS: Ubuntu 20.04 - Linux [...] 5.4.0-40-generic [...] x86_64
Graphics: GeForce GTX 650 Ti BOOST, nvidia-driver-440
Monitors: Primary monitor connected via HDMI, secondary rotated monitor connected via display port, staying left from my primary monitor.

Before upgrading from 19.10 to 20.04 rotation with gnome-control-center settings worked quiet fine (I only had to configure this once). Now I have the same problem as described above.
Each time I power on my secondary monitor I have to manually change orientation by using xrandr commands. Rotating via gnome-control-center results in weird unrotated overlapping display contents. Once configured manually via xrandr, after suspension and wake up the settings are still working. After reboot settings are lost again.

Revision history for this message
John Morar (jfmorar) wrote :

I can verify the symptoms as described here with the nvidia 440.95.01 driver an Nvidia P620 card with three monitors (left and right monitors in portrait center in landscape.

I can use the Nvidia supplied GUI app nvidia-settings to configure three screens (using rotate left in the nvidia-settings configurator to get proper orientation) and press apply then everything works properly, though as previously pointed out those settings are lost during login. When configuring with the Ubuntu Settings Display dialog I must use portriat rotate-right to get the correct orientation (along with the improperly scaled viewport).

For those with two monitors, if you put the portrait monitor on the left of the landscape monitor the ubuntu settings program generates the correct result (at least for me).

I'd be willing to install the nvidia 450 driver directly if I believe the problem would go away but I've not hear anyone say that's true.

Revision history for this message
reddaly (reddaly) wrote :

Either the bug title should be renamed to something more generic or a new bug should be created. As far as I can tell, many users have this problem but don't necessarily have the screen overlap issue. At least, overlap is not mentioned in [the reddit post](https://www.reddit.com/r/Ubuntu/comments/g82u58/cant_rotate_monitor_orientation_in_ubuntu_2004/) that links here.

In any case, how can I help find the bug? NVidia server settings can fix the monitor rotation, but I cannot figure out how to persist those changes.

My situation is even worse than described. Sometimes when applying the settings in "Displays," the setting changes to "Single Display" from "Join Displays" without my input, and the monitor I want in portrait mode goes black while Gnome still thinks it is part of my desktop... even after I click the "revert" button.

As a software engineer I would like to help to track down the bug and fix it. However, I don't see any instructions in mutter's README.md about how to build and test from source. Same for https://github.com/GNOME/gnome-control-center. Any pointers to documentation would be appreciated.

Revision history for this message
reddaly (reddaly) wrote :

Another video capturing user troubles: https://www.youtube.com/watch?v=s_VDmBIG6os

Revision history for this message
roothorick (8-roothorick-gmail-com) wrote :

IMO we shouldn't split the bug unless there's evidence of an unrelated cause in cases where there's no overlap.

I'm not convinced that blaming it on Nvidia isn't justified. The xrandr CLI tool cannot directly fix a broken monitor layout; usually it turns off one monitor and spits out an error. In any case there's definitely an issue that's lower-level than mutter.

A workaround I've found is to switch to a single landscape monitor configuration and then specify the ENTIRE monitor layout in a single xrandr CLI command. You can't do it in stages or you'll get errors.

Revision history for this message
reddaly (reddaly) wrote :

It seems the bug that actually describes the "cannot rotate monitor to portrait mode" issue is 1874567, and a fix is in hand. Apologies for the noise here.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Comment #37 suggested the fix for bug 1874567 does not work for this one. But maybe the final fix will. Rather than asking people here to test a proposed package I suggest just waiting until the fix for bug 1874567 is formally released to updates (soon). Then the status of this bug will be more clear.

Revision history for this message
Uwe Dulz (uwe.dulz) wrote :

The solution for https://bugs.launchpad.net/bugs/1874567 solved this issue for me.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

How many people feel mutter 3.36.4 has fixed this bug for them?

Changed in gnome-control-center (Ubuntu):
status: Triaged → Incomplete
Changed in mutter (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Wallo013 (walloo13) wrote :

The issue is fixed for me, however now fonts in GDM and gnome desktop (toolbar at the top and file font on the desktop, but not normal apps) are at least 200% the normal size. However all config are good (gnome-tweak indicate fonts are at 100% and the screen configurations are all to 100% magnification). If I use gnome-tweak, I set the font to 101% then back to 100% and everything go back to normal until I logout and login.
There is a high probability it is not linked to the change, but that's my new issue right now.
Note that one of my screens is a 43" 4K screen, so I wonder if somewhere the 4K may be interpreted as a high density screen.

Revision history for this message
Florian Schwarz (f.schwarz) wrote :

Issue is fixed for me with mutter 3.36.4.

And yes, I got the scaling bug mentioned by Wallo013, too. Although mine isn't that heavy. I use 100 % and something is setting it below that (75 % - 90 %?). If I change scaling to 125 % and back to 100 %, everything is fine. After Relogin or Reboot, scaling is wrong again.

But this bug is not linked to multiple screens at least for me, so maybe should get reported in another bug ticket.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Thanks.

That new issue you mention is bug 1892521.

Changed in gnome-control-center (Ubuntu):
assignee: Daniel van Vugt (vanvugt) → Marco Trevisan (Treviño) (3v1n0)
status: Incomplete → Fix Released
no longer affects: gnome-control-center (Ubuntu)
Changed in mutter (Ubuntu):
assignee: nobody → Marco Trevisan (Treviño) (3v1n0)
status: Incomplete → Fix Released
Changed in gnome-control-center:
status: Unknown → Fix Released
Changed in mutter:
status: Unknown → New
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.