[nvidia] Screen turns off when trying to set some fractional scaling values

Bug #1873403 reported by Daniel van Vugt
284
This bug affects 47 people
Affects Status Importance Assigned to Milestone
mutter (Ubuntu)
Fix Released
High
Marco Trevisan (Treviño)
Focal
Fix Released
High
Marco Trevisan (Treviño)

Bug Description

[ Impact ]

When the nvidia driver is installed, the screen turns off when trying to set some fractional scaling values like 150%. And it stays off even after rebooting and logging in again.

And from ssh I can see there's no current mode set anymore (just like in bug 1869750):

$ xrandr
Screen 0: minimum 8 x 8, current 960 x 600, maximum 16384 x 16384
DVI-I-0 disconnected (normal left inverted right x axis y axis)
DVI-I-1 disconnected (normal left inverted right x axis y axis)
DP-0 disconnected (normal left inverted right x axis y axis)
DP-1 connected primary (normal left inverted right x axis y axis)
   1920x1200 59.95 + 59.88

[ Test case ]

In a Nvidia system:
- From g-c-c enable fractional scaling
- Set all the available fractional scaling values and ensure they work
  + In any case the screen should be turned off

[ Regression potential ]

Wrong screen size is set and panning might be enabled.

---

ProblemType: BugDistroRelease: Ubuntu 20.04
Package: mutter 3.36.1-3ubuntu2
ProcVersionSignature: Ubuntu 5.4.0-24.28-generic 5.4.30
Uname: Linux 5.4.0-24-generic x86_64
NonfreeKernelModules: nvidia_modeset nvidia
ApportVersion: 2.20.11-0ubuntu27
Architecture: amd64
CasperMD5CheckResult: skip
Date: Fri Apr 17 15:51:15 2020
InstallationDate: Installed on 2020-02-03 (73 days ago)
InstallationMedia: Ubuntu 20.04 LTS "Focal Fossa" - Alpha amd64 (20200124)SourcePackage: mutter
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Daniel van Vugt (vanvugt) wrote :
tags: added: black-screen
summary: - [nvidia] Screen turns off when trying to switch to fractional scaling
- values
+ [nvidia] Screen turns off when trying to set fractional scaling values
Revision history for this message
Daniel van Vugt (vanvugt) wrote : Re: [nvidia] Screen turns off when trying to set fractional scaling values

Weirdly, I can set 125% OK, but the screen turns off if I set 150%.

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

WORKAROUND:

1. Ctrl+Alt+F4 and log into a text console.

2. rm ~/.config/monitors.xml

3. sudo reboot

summary: - [nvidia] Screen turns off when trying to set fractional scaling values
+ [nvidia] Screen turns off when trying to set some fractional scaling
+ values
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Oh, no 125% doesn't really work either. That just triggers bug 1870736.

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

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

Changed in gnome-control-center (Ubuntu):
status: New → Confirmed
Changed in gnome-shell (Ubuntu):
status: New → Confirmed
Changed in mutter (Ubuntu):
status: New → Confirmed
Changed in nvidia-graphics-drivers (Ubuntu):
status: New → Confirmed
Revision history for this message
Sebastien Bacher (seb128) wrote :

The situation isn't clear but from the current report we decided it's not a rls target atm

tags: added: rls-ff-notfixing
removed: champagne
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I have the hardware and the interest so I will do some debugging of this soon.

Changed in mutter (Ubuntu):
assignee: nobody → Daniel van Vugt (vanvugt)
Changed in gnome-shell (Ubuntu):
assignee: nobody → Daniel van Vugt (vanvugt)
Changed in gnome-control-center (Ubuntu):
assignee: nobody → Daniel van Vugt (vanvugt)
no longer affects: gnome-control-center (Ubuntu)
no longer affects: gnome-shell (Ubuntu)
Changed in mutter (Ubuntu):
status: Confirmed → In Progress
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Findings so far:

1. You really need the uninitialized variable fixed first, or behaviour can be random (bug 1874207).

2. The current spec can be found at: https://gitlab.freedesktop.org/xorg/proto/xorgproto/-/raw/master/randrproto.txt

3. NVIDIA supports randr protocol version 1.6, so yes it does support arbitrary scaling via the command:

  xrandr --output NAME --scale WxH (note W and H are inverted so W = 1/scale)

4. The remaining issue here appears to be our mutter patch is setting an invalid mode, or can't find the mode it expects. So the NVIDIA driver turns the screen off when it hasn't been given a mode.

Changed in mutter (Ubuntu):
assignee: Daniel van Vugt (vanvugt) → nobody
status: In Progress → Confirmed
Revision history for this message
Fusion (bornolbers) wrote :

------------not live: tests as I remember:
without nvidia
100-->ok
125,150 too slow

with nvidia
100--> too small
200-->too big
enable fractional scaling
125-->200
150-->200
175 -->black
(stop/start freesync from monitor, restored - maybe random behavior)

2nd try
100-->ok
125-->black
(couldn't restore it, ctrl+alt+f1 & login = black again)

unistall nvidia tested drivers, try nouveau
after two changes, I could see ubuntu desktop became small or big inside my screen and around it I cound draw with the window I was holding with the mouse. If I put it inside ubuntu desktop area of my screen it works fine, outside (right column and down line) it just performs like windows xp windows when it stuck (never saw it again on ubuntu since 11.10 that I am using it).

------------live: test and keep these notes:
install nvidia again
reboot - 3rd try
100--> bigger desktop than my screen, needs to scroll (down or right) to see the rest
200--> the same
enable fractional scaling (returns to 100 by itself)
150-->black
(stop/start freesync from monitor, restored - maybe random behavior)

100 --> enable fractional-->200 by itself
I repeat it, doesn't happen the second time
150-->black

remove nvidia* through synaptic
reboot
100-->ok
125,150,175 too slow
200-->ok

install nvidia tested
100-->οκ
200-->οκ
enable fractional scale-->turn to 100 itself
150-->black
125-->200
125(200) change back to 100 first
175-->black
200-->ok
on 200, close fractional scale-->instead of return to 100 itself it doubles the area of the desktop (bigger than my real monitor area, so I have to scroll to see the rest of the desktop)
100-->100 with the same large desktop area issue
deactivate fractional scale-->issue remain
logout,logon--> 100 & ok

Changed in mutter (Ubuntu):
assignee: nobody → Daniel van Vugt (vanvugt)
status: Confirmed → In Progress
Revision history for this message
Stephan Pearce (pearcerules) wrote :

I have 2 monitors and one HDTV being used as a monitor. Everything was fine on Pop OS 19. I upgraded to Pop OS 20 (which I assumed bumped me to the latest Ubuntu) and now I'm having fractional scaling issues.

Left monitor = 1080p monitor in portrait mode
Middle HDTV = 4k HDTV in landscape mode
Right monitor = 1080p monitor in portrait mode

I can see fractional scaling in my options, but if I choose 125, 150, or 175%, it will only do 200%. And, it won't let me change it on one display. It only applies universally.

Until this is fixed, my main monitor (HDTV) is frustrating to use with font so small.

Also, I have to adjust the scaling in my Nvidia settings anytime I make any change because it makes the scaling of the middle monitor way too big. So, then the desktop actually "scrolls" until I manually fix the scaling. I have a GeForce 1080.

Revision history for this message
Trickser (ansgar-f26) wrote :

I want to add something here: I'm using the xrandr scale setting since 19.04 as fractional scaling has never worked on Ubuntu and X11. In the last versions the monitor settings weren't stored.

In my experience when setting the display resolutions / scaling with xrandr, my NVIDIA card would always black out when I tried to change anything after setting the initial xrandr command. Either through xrandr or the display settings. It is also impossible to disconnect a monitor after setting the scaling, as the card would then black out too.

Restarting the Gnome Server always helps in those cases.

Here's my current script at startup, when setting the 200% scaling in the settings:
```
SCALE=1.25
POSITION=4800
xrandr --output DP-4 --primary --pos "0x0" --scale "$SCALE"x"$SCALE" --output DP-0 --scale "$SCALE"x"$SCALE" --auto --pos "$POSITION"x0
```

Changed in mutter (Ubuntu):
importance: Undecided → Medium
Changed in nvidia-graphics-drivers (Ubuntu):
importance: Undecided → Medium
Changed in mutter (Ubuntu):
importance: Medium → High
Changed in nvidia-graphics-drivers (Ubuntu):
importance: Medium → High
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

On hold. I am waiting for Marco to finish work on some more general bugs in the randr scaling patch: bug 1876894 (which probably also affects bug 1875285), bug 1874207, bug 1873052. When those fixes are done and he's no longer working in the same area I will come back to this bug.

Changed in mutter (Ubuntu):
status: In Progress → Confirmed
Revision history for this message
Stephan Pearce (pearcerules) wrote :

Any ETA at all, by chance?

Revision history for this message
Ryan Hadley (hadley8899) wrote :

Ive just tried this again this morning

1. 2560 x 1440
2. 3840 x 2160
3. 1920 x 1200

I set fractional scaling to 1.50 on screen 2 (Others 100%)

For the session it works perfectly fine, But after logging out and logging back in the settings do not get saved (Nvidia gtx 1080 with 440 driver)

This was not working before, So I assume some updates have been made in this area?

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

Nvidia driver support for the Ubuntu fractional scaling patch is somewhat random at the moment. And I don't mean to blame Nvidia, it's probably something we did wrong. Just saying various Nvidia users experience different issues:

  * Screen turns off (bug 1873403)
  * Screen stays on but jumps to 200% (bug 1870736)
  * Fractional scaling works correctly.

As for remembering the settings, that's another separate issue (bug 1825593).

Revision history for this message
Stephan Pearce (pearcerules) wrote :

I tried what Ryan did via Display Settings and it still made all screens 200% instead of 100/150/100 for me.

Revision history for this message
Ryan Hadley (hadley8899) wrote :

Just to add I found that on the unscaled screens the text and general look was a little fuzzy. I assume this is something to do with the scaling going on. Also if fractional scaling is turned off I cannot set the 4k screen to 200% on its own as all screens then get set to 200%.

I know its not related to this but VLC also does not work when scaling is on(Atleast for me), I assume this is more of an issue for VLC not Ubuntu.

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

Ryan,

 * The problem with "all screens" is bug 1857383.
 * The problem with VLC needs a new bug report.

Please don't discuss them here.

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

Possible workaround for some machines: Tap Super+P

Revision history for this message
Dave H (dave-hills-2009) wrote :

I have a possible related problem with Ubuntu-mate 20.04. I adjusted my mouse pointer size (Dell Inspiron 7995 with Nvidia GTX 960M graphics) the screen went black mouse pointer frozen, 10 seconds later the login screen appears. If I log back in again the screen is black and I'm stuck in an endless loop.

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

Please, check if fixes included in PPA mentioned at https://bugs.launchpad.net/ubuntu/+source/gnome-control-center/+bug/1870736/comments/122 helps for this.

There are changes that should be quite linked to this.

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

This bug was fixed in the package mutter - 3.36.3-1ubuntu2

---------------
mutter (3.36.3-1ubuntu2) groovy; urgency=medium

  * debian/control:
    - Revert BD on adwaita-icon-theme 3.36.1-2ubuntu3. It was just temporary fix.
  * d/p/x11-Add-support-for-fractional-scaling-using-Randr.patch:
    - Use pre-computed CRTC layout size for computing screen size (LP: #1874567,
      LP: #1873403)
    - Decouple the output mode from layout mode capabilities (LP: #1876894,
      LP: #1886996)
    - Ensure we notify CRTC changes on integer scaling changes (LP: #1876894)
    - Apply proper layout monitor config when using fractional scaling
      (LP: #1884754)
    - Restore the fractional settings when reverting to fractional layout
      (LP: #1886996)
  * debian/libmutter-6-0.symbols: Add new private symbol

 -- Marco Trevisan (Treviño) <email address hidden> Sat, 11 Jul 2020 00:44:33 +0200

Changed in mutter (Ubuntu):
status: Confirmed → Fix Released
Changed in mutter (Ubuntu Focal):
assignee: nobody → Daniel van Vugt (vanvugt)
importance: Undecided → High
Changed in nvidia-graphics-drivers (Ubuntu Focal):
importance: Undecided → High
status: New → Confirmed
description: updated
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Daniel, or anyone else affected,

Accepted mutter into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/mutter/3.36.4-0ubuntu0.20.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in mutter (Ubuntu Focal):
status: New → Fix Committed
tags: added: verification-needed verification-needed-focal
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I don't have a focal system with nvidia right now. Can anyone else verify comment #27?

Revision history for this message
teimcrr (marco-carrarini) wrote :

update mutter package in fossa-proposed works for me.
Ubuntu 20.04, nVidia 1060 GTX, 4k monitor, 150% scaling
Thanks !

Revision history for this message
Stuart Still (stustill) wrote :

I've tried this from pop!_os 20.04, nVidia 2060 super GTX, 4k monitor.

Starting off in 100% scaling, I select 125% scaling. Before enabling proposed, this resulted in the screen switching off.

Since enabling proposed and installing the updated packages, this now doesn't switch the screen off, but the behaviour is still not correct. I believe I'm now experiencing https://bugs.launchpad.net/ubuntu/+source/mutter/+bug/1875285 and https://bugs.launchpad.net/ubuntu/+source/mutter/+bug/1825593 (the latter of which is marked as fixed).

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

Sounds like a positive step forward at least. Thanks.

tags: added: verification-done verification-done-focal
removed: verification-needed verification-needed-focal
Changed in mutter (Ubuntu):
assignee: Daniel van Vugt (vanvugt) → Marco Trevisan (Treviño) (3v1n0)
Changed in mutter (Ubuntu Focal):
assignee: Daniel van Vugt (vanvugt) → Marco Trevisan (Treviño) (3v1n0)
Changed in nvidia-graphics-drivers (Ubuntu):
status: Confirmed → Won't Fix
Changed in nvidia-graphics-drivers (Ubuntu Focal):
status: Confirmed → Won't Fix
Revision history for this message
Martin Gerdzhev (mgerdzhev) wrote :

Scaling (and second monitor rotation) now works for me as well 20.04 nvidia 2070 super.
One problem however is If I have the scaling set at e.g. 175% full screen apps (games) don't show up full screen, but only take up a portion of the screen.

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

If you have any issues like that then please open a new bug for each by running:

  ubuntu-bug mutter

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

This specific bug can be then considered fixed.

The other issues, like bug #1875285 is still under studies, but looks like it's a correlation of nvidia drivers and some specific cards (as this update fixes that problem for a subset of them as well).

Revision history for this message
Frank Blah (sitnarf) wrote :

For me, it doesn't seem to be fixed.

I have installed mutter 3.36.4 and rebooted. When I set my external 4k AOC display to 200% and the internal monitor to 100%, it works. However, if I increase the scaling of the internal monitor to 125% in display settings, I get the both screens turn black and reverts to the previous settings shortly after.

Please let me know if you need anything more from me.

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

OK so there are still bugs. I suggest we wait until *after* 3.36.4 is released to focal and everyone updated, then please open new bugs by running:

  ubuntu-bug mutter

Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Hello Daniel, or anyone else affected,

Accepted mutter into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/mutter/3.36.4-0ubuntu0.20.04.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

tags: added: verification-needed verification-needed-focal
removed: verification-done verification-done-focal
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Marking this verified again, as it was verified as fixed in version 3.36.4-0ubuntu0.20.04.1 (see [1] and [2]), so given that the changes in .2 [3] do not affect this behavior, we can safely consider it already verified.

[1] https://bugs.launchpad.net/ubuntu/+source/mutter/+bug/1873403/comments/30
[2] https://bugs.launchpad.net/ubuntu/+source/mutter/+bug/1884754/comments/31
[3] https://launchpadlibrarian.net/490341554/mutter_3.36.4-0ubuntu0.20.04.1_3.36.4-0ubuntu0.20.04.2.diff.gz

tags: added: verification-done verification-done-focal
removed: verification-needed verification-needed-focal
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package mutter - 3.36.4-0ubuntu0.20.04.2

---------------
mutter (3.36.4-0ubuntu0.20.04.2) focal; urgency=medium

  * xrandr-scaling: Never try to set invalid screen sizes (LP: #1889090)

mutter (3.36.4-0ubuntu0.20.04.1) focal; urgency=medium

  * New upstream stable release (LP: #1887998)
    - Fix crash on area screenshots with fractional scaling
    - Do not paint textures of fully obscured windows
    - Turn off CRTCs as well when enabling DPMS
    - Improve selection support
    - Use a more appropriate combine function on opaque areas
    - Fix remote desktop being broken without screencast session
    - Fix popovers disappearing on wayland and HiDPI
    - Fixed crashes (LP: #1870867, LP: #1857947)
    - Plugged memory leaks
  * d/p/screen-cast-Let-the-reason-for-recording-determine-what-t.patch,
    d/p/screen-cast-src-Add-flag-to-maybe_record.patch,
    d/p/screen-cast-src-Fix-signedness-of-timestamp-field.patch,
    d/p/screen-cast-src-Make-record-functions-return-an-error-whe.patch,
    d/p/screen-cast-src-Make-the-two-record-vfuncs-more-similarly.patch,
    d/p/screen-cast-src-Record-follow-up-frame-after-timeout.patch,
    d/p/screen-cast-src-Remove-follow-up-timeout-source-on-disabl.patch,
    d/p/screen-cast-src-Use-G_USEC_PER_SEC-instead-of-1000000.patch,
    d/p/screen-cast-window-stream-src-Fix-indentation.patch:
    - Import more fixes for screencasting and remote desktop
  * d/p/x11-Add-support-for-fractional-scaling-using-Randr.patch:
    - Don't export patch-only private symbol
  * debian/libmutter-6-0.symbols:
    - Remove ubuntu-only private symbol

mutter (3.36.3-0ubuntu0.20.04.2) focal; urgency=medium

  * debian/control:
    - Revert BD on adwaita-icon-theme 3.36.1-2ubuntu3. It was just temporary fix
  * d/p/x11-Add-support-for-fractional-scaling-using-Randr.patch:
    - Use pre-computed CRTC layout size for computing screen size (LP: #1874567,
      LP: #1873403)
    - Decouple the output mode from layout mode capabilities (LP: #1876894,
      LP: #1886996)
    - Ensure we notify CRTC changes on integer scaling changes (LP: #1876894)
    - Apply proper layout monitor config when using fractional scaling
      (LP: #1884754)
    - Restore the fractional settings when reverting to fractional layout
      (LP: #1886996)
  * debian/libmutter-6-0.symbols: Add new private symbol

 -- Marco Trevisan (Treviño) <email address hidden> Mon, 27 Jul 2020 17:04:41 +0200

Changed in mutter (Ubuntu Focal):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for mutter has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Mathew Hodson (mhodson)
no longer affects: nvidia-graphics-drivers (Ubuntu Focal)
no longer affects: nvidia-graphics-drivers (Ubuntu)
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.