💾 Archived View for okroshka.net › nvidia.gmi captured on 2024-08-18 at 17:07:39. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2022-01-08)

-=-=-=-=-=-=-

The year of the Linux desktop

I got myself a new monitor. A fancy 28-inch 4K display. I was using a 27-inch display at 2560x1440 alongside a 24-inch display at 1920x1080 which worked fine. Adding the 4K display I noticed text was way too small to read. Most operating systems use scaling to make text readable without lowering the resolution (which loses all the crispyness). I figured using a scaling factor of 1.5 would result in the same text size as my 2560x1440 display but with extra clarity.

The solution seems simple. Scale one display at 150 percent while scaling the other at 100 percent. Running Fedora 34 with Gnome this shouldn't be a problem, right?

Fractional scaling in Gnome (Wayland)

Out of the box the Gnome desktop only allows you to scale to 100%, 200%, 300% and 400% percent. 100% being way too small and 200% being way too big. There is an exerpimental feature in Gnome that can be enabled to allow scaling at 100%, 125%, 150%, 175%, etc.

To do this for the current user, do the following.

gsettings set org.gnome.mutter experimental-features "['scale-monitor-framebuffer']"

To enable this feature for all users, make sure these files exist and have the following content.

/etc/dconf/profile/user

user-db:user
system-db:local

/etc/dconf/db/local.d/00-hidpi

[org/gnome/mutter]
experimental-features=['scale-monitor-framebuffer']

/etc/dconf/db/locks/hidpi

/org/gnome/mutter/experimental-features

Logout and log back in to active the settings. Fractional scaling can now be accessed in the Gnome display settings.

Per monitor fractional scaling and Nvidia on Wayland

In my case I was running an Nvidia graphics card with the proprietary drivers. Gnome does not want to activate Wayland using these drivers and per monitor fractional scaling is not available with X. I tried messing with xrandr and arcane X configs but nothing got me what I wanted. It is however possible to get Gnome running with Nvidia on Wayland.

This procedure assumes you are running the proprietary Nvidia driver.

Edit /etc/gdm/custom.conf and make sure the following is set

WaylandEnable=true

Next edit /usr/lib/udev/rules.d/61-gdm.rules and comment the rule disabling Wayland when Nvidia drivers are detected.


# disable Wayland when using the proprietary nvidia driver
#DRIVER=="nvidia", RUN+="/usr/libexec/gdm-disable-wayland"

Activate DRM kernel modesetting by creating /etc/modprobe.d/nvidia.conf and setting the following.

options nvidia-drm modeset=1

Edit the Grub configuration at /etc/default/grub to enable modesetting on boot.

GRUB_CMDLINE_LINUX="nvidia-drm.modeset=1"

Now generate a new Grub config using grub2-mkconfig or boot entering the above Grub setting directly into the bootloader.

Reboot and test

Rebooting should now let us select "Gnome on X" and just "Gnome" when logging in. The latter will use Wayland.

Footnotes

I am running Nvidia driver version 465.31 on Fedora 34 with Gnome 40. Running this setup gave me some weird graphical glitches around windows and rare crashes of Gnome. As of lately all of these problems have disappeared. I attribute this to the new egl-wayland version 1.1.7 being available in Fedora.

Running the latest Fedora, Gnome and Nvidia driver seems to be a pretty good experience. In the future I would probably go for an AMD graphics card and choose screens with the same DPI and physical size.