17

It has been a couple of years since Ubuntu added Fractional Scaling to the Displays settings.

At the beginning there was the following warning which attended the user:

May increase power usage, lower speed, or reduce display sharpness

Displays settings

Now, in 2022, I am using Ubuntu 22.04 and the warning is still there. I was hoping that fractional scaling had become mature enough in all these years, but it seems not.

So:

  1. What is wrong with fractional scaling in Ubuntu?
  2. What is the technical difference between 200% and 125% which causes the first one to not need warning?
  3. Why is there no such warning for fractional scaling in Windows?

5 Answers 5

14

The way 125% fractional scaling is implemented in Ubuntu is that it first renders everything at 200% and then scales the result down to 125%. This explains why 200% does not have sharpness and performance warning as output is presented as it is rendered. But fractional scaling requires one extra computationally expensive step there.

The reason Windows does not have a warning like this is that Windows does not scale down from 200%. Instead it asks the program to render itself directly at 125%. The upside of this is that the the result is sharp and there will be no performance penalty from scaling down from 200%. The downside is that many legacy applications struggle with fractional scaling: you will often see broken layouts like font being large but icons small or text not fitting into buttons.

The reason 200% scaling is much easier to support for programs is that this means just doubling every pixel vertically and horizontally. This can be done automatically by the UI framework for layout and graphics while text will be rendered with higher resolution to take advantage of the high DPI. If high resolution icons and images are provided, they will also appear sharp.

Another benefit for rendering everything at 200% and scaling down as needed is that on multi-monitor setups this allows to transparently move applications between monitors with different scale factors without the app needing to reload its UI. On Windows many legacy applications struggle with detecting monitor change and then re-rendering the content.

12

There's nothing wrong or immature. Just because Windows doesn't tell you about the performance impact and drawbacks of fractional scaling doesn't mean that it doesn't exist.

To understand this tooltip you must understand how pixels are arranged in a display.

If you have a 1920x1080 (1080p) display, that means there is a grid of 2,073,600 pixels arranged in 1920 columns and 1080 rows.

When you use fractional scaling, you are changing how items on the screen are rendered in this grid.

With 200% scaling, the computation to render these pixels is very easy. All you need to do to render 200% scaling is to render every single pixel as a square of 4 identical pixels.

A grid of 4 pixels at 100% scaling (normal):

x y
Y X

Is rendered as 16 pixels in 200% scaling:

x x y y
x x y y
Y Y X X
Y Y X X

The pixels can be scaled in a way where pixels can be duplicated perfectly without division. The image will retain its sharpness because the pixels can be perfectly duplicated.

If you use 125% scaling, this simple multiplication is not possible. In order to render the image, pixels would need to be divided into parts that are smaller than a single pixel. But pixels can't be divided this way, so there is additional computation required to artificially create a pixel mapping at 125%.

This not only requires additional computation, but since those pixels cannot be multiplied without remainders, it can cause the image to appear blurry when compared to 200% scaling or no scaling.

4
  • 1
    It's not that the math is more complicated, it's that the GPU is actually drawing more than those pixels (rendering at 2× the resolution, then scaling that result down). @Karmo's answer below is also a bit more precise about how Windows' toolkit actually differs from GNOME and GTK here. Jan 27, 2023 at 20:41
  • 1
    In fact, @Karmo's answer demonstrates that this warning could be misleading or even false in Windows, there isn't necessarily any overhead at all if scaling is done directly in userland
    – Ryan
    Jun 14, 2023 at 23:35
  • Please edit the part related to performance impact of fractional scaling on Windows as it is incorrect and misleading
    – Wizard79
    Nov 13, 2023 at 7:40
  • I also want to add some question-comment: what does it mean to "scale"? What does "100% scale" mean? If the UI decided to draw some icon of the size (h x w), why should we draw it at 100% and then scale to some other X%? Why doesn't the UI just draw it as (h * 1.25 x w * 1.25)? Jan 5 at 19:00
1

Fractional scaling is an experimental feature in 2022. gsettings describe org.gnome.mutter experimental-features tell us

To enable experimental features, add the feature keyword to the list. Whether the feature requires restarting the compositor depends on the given feature. Any experimental feature is not required to still be available, or configurable. Don’t expect adding anything in this setting to be future proof.

Currently possible keywords:

• “scale-monitor-framebuffer” — makes mutter default to layout logical monitors in a logical pixel coordinate space, while scaling monitor framebuffers instead of window content, to manage HiDPI monitors. Does not require a restart.

• “kms-modifiers” — makes mutter always allocate scanout buffers with explicit modifiers, if supported by the driver. Requires a restart.

• “rt-scheduler” — makes mutter request a low priority real-time scheduling. Requires a restart.

• “autoclose-xwayland” — automatically terminates Xwayland if all relevant X11 clients are gone. Requires a restart.

• “x11-randr-fractional-scaling” — enable fractional scaling under X11 using xrandr scaling. It might reduce performances. Does not require a restart.

As we see the performance warning comes from the support for x11 programs.

In my case setting it via GUI blanked out my VGA monitor (or the internal VGA graphics card). However a gsettings reset org.gnome.mutter experimental-features call was able to fix it and the screen came right back up.

1

Fractional scaling is just not very good all the time. It will never be perfect with fixed pixel screens when fractional scaling tries to do something other than 100% or 200% scale. I find it frustrating even on Windows although credit to Microsoft they do handle scaling better. Apple tries to avoid fractional scaling with retina and that helps. With screens today you will always find fractional scaling imperfect.

1
0

Setting:

WaylandEnable=false

in

sudo vim /etc/gdm3/custom.conf

and then running:

sudo systemctl restart gdm3

seemed to fix the issue for me.

https://linuxconfig.org/how-to-enable-disable-wayland-on-ubuntu-22-04-desktop

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .