KDE fonts/icons too large with nvidia modesetting = true

Had some issues over the last few weeks… the power glitched briefly at home and one of my monitors would not refresh, a problem that I had initially when starting with NixOS.

So, I figured I’d do an update (was on the unstable channel).

The kernel 5.19 deprecation wouldn’t let me do it without rolling back my kernel to 5.15, which broke DisplayLink, which did not work on kernel 6.0. Eventually now I’m on 22.11 with the 6.0 kernel and a fix found here on discourse for the evdi driver used by DisplayLink.

Having worked through all of that, I had screen tearing manifesting as a black square under the mouse; basically that part of the screen (any screen) was not updating properly, making my IDE unusable.

Back to revisiting the NVIDIA config, first I updated to the latest “beta” NVIDIA driver, which did not help.

Then I saw in the wiki that setting modesetting = true was a fix for screen tearing problems.

Now the screen tearing is gone, but the fonts and icons in KDE are now humongous on the task bar, window decorations, and context menus.

I’m pretty new to Linux and don’t even know where to look to attempt to resolve this. I tried changing the desktop theme, font sizes, etc. in KDE but that had no effect.

I’m hoping that someone can point me in the right direction. I have prime.sync.enable = true because I had all kinds of problems with offload.

 hardware.nvidia = {
    package = config.boot.kernelPackages.nvidiaPackages.beta;
    modesetting.enable = true;
    powerManagement.enable = false;
    nvidiaSettings = true;
    prime = {
      sync.enable = true;
      sync.allowExternalGpu = true;
      intelBusId = "PCI:0:2:0";
      nvidiaBusId = "PCI:1:0:0";

Maybe there’s some cache that needs to be cleared or something?

Good that you worked out your driver settings!

Regarding KDE, a couple of things come to my mind:

  • have you tried to create a new user (without any .config) to see if they also get this weird font? Maybe some configuration files are not properly configured or got corrupted (KDE regurarly break its config on my computer when I unplug my screen when the laptop is in sleep mode…)
  • I’m thinking that you might see issues with HighDPI. Are you using sddm (it should enable Hidpi in X11). Also, in KDE you might need to enable services.xserver.desktopManager.plasma5.useQtScaling = true; to also enable HighDPI on KDE’s side (at least, it enables PLASMA_USE_QT_SCALING that is required for making sure the tray icons are scaled with the rest of the desktop). There is also hardware.video.hidpi.enable = true; that optimize the fonts for HiDPI devices. KDE also proposes various ways to tune the font size for HiDPI screens, see e.g. the list of options here like System Settings > Display and Monitor > Display Configuration > Global Scale that you may need to push to something like 200%, note that apparently you need to restart KDE to see changes. Also, people reported that “Force Font DPI: 96” (or even 120) under the Fonts settings was helping. See also https://www.reddit.com/r/kde/comments/bhq9y8/taskbar_and_menu_very_small_how_do_i_change_this/ to change the font of the menu.

Thanks so much for the numerous suggestions and the wealth of info.

I think that problem was with some KDE cache. As a note, I don’t have high DPI screens, just five old 1080P monitors (in addition to the laptop screen) and a graphics tablet with a screen for annotating screen recordings, so a total of 7 1080P monitors including the laptop.

I tried your suggestions, except for creating a new user, but to no avail. I was going to create a new user next when I poked around in the .config directory and changed a couple of files:

  • in ~/.config/xsettingsd/xsettings.conf, changed Gtk/CursorThemeSize from 24 to 16.
  • in ~/.config/kwinrc, changed Compositing to being enabled.

Then rebooted. Things were good after that, though after reboot both of those files were back to what they were originally.

So, I’m not sure if this had anything to do with fixing the problem, but again it seems like some bad cache or something in KDE and changing some file caused the cache to reload or something. Probably I could have deleted some directory under ~/.cache, but not too well versed in that.

1 Like