Ubuntu 22.04 4K resolution low FPS / stuttering

I have set up Ubuntu 22.04 in Dual boot with Windows 11. I also have RTX3060 Laptop GPU. I’m using X11.

I recently bought a 4K monitor that works perfectly on Windows. When I use it on Ubuntu, I see annoying stuttering, especially when scrolling.

The issue doesn’t happen at 2K or FHD. The issue doesn’t happen on the internal monitor.

I tried different nvidia drivers and it’s the same issue. My current nvidia driver is 550. Here is the output of nvidia-smi:

+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 550.120                Driver Version: 550.120        CUDA Version: 12.4     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GeForce RTX 3060 ...    Off |   00000000:01:00.0  On |                  N/A |
| N/A   51C    P8             15W /   80W |    1222MiB /   6144MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+
                                                                                         
+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI        PID   Type   Process name                              GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|    0   N/A  N/A      2409      G   /usr/lib/xorg/Xorg                            690MiB |
|    0   N/A  N/A      2650      G   /usr/bin/gnome-shell                          136MiB |
|    0   N/A  N/A      4456      G   ...seed-version=20241121-182614.093000        378MiB |
|    0   N/A  N/A      7155      G   nvidia-settings                                 0MiB |
|    0   N/A  N/A      7304      G   /snap/okular/159/usr/bin/okular                 2MiB |
+-----------------------------------------------------------------------------------------+

I tried Nvidia Performance mode from PRIME Profiles but it’s the same issue.

Gnome 3 is a pure disaster at scaling. In 2024 it’s still doesn’t support fractional scaling. Instead using high resolution and raster downscale hacks. Hence why it’s so slow. If you want fractional scaling you better go with KDE. Although qt6 has downgraded to use pixel ratio scaling, it’s still better than everything GTK 3+ offering. qt5 was ideal for fractional scaling.

For KDE6 you don’t need anything special. You just set up 150% and Apply scaling themselves for X11 apps. But that would be Wayland and I understand why you wouldn’t want to use it.

If you want X11 and GTK, you can set up Xfce to work at 150% scaling for qt, GTK2 and wine apps, but at 200% for GTK3+.

To set it up, go into Control Panel and Appearance, then Settings, set 2x Window Scaling, then Fonts and set Custom DPI setting to 144, which represent 150%.
Then go back All Settings, into Settings Editor, open xsettings, click Add and add following:
Property: /Gdk/UnscaledDPI
Type: Int
Value: 98304
Now click Save. I don’t remember, if you need to reboot, but as far as I remember scaling over 2x for GTK3+ will be disabled instantly.
Now for Firefox open about:config, lookup for layout.css.devPixelsPerPx and set it to 1.5.
For Visual Studio Code look up for window.zoomLevel in Settings and set to -1. Unfortunately, title bar won’t zoom out and would stay at 200%.

ps. 2K is FHD.