Bug 458321 - DPI scaling is way off when using nvidia proprietary drivers instead of nouveau
Summary: DPI scaling is way off when using nvidia proprietary drivers instead of nouveau
Status: RESOLVED UPSTREAM
Alias: None
Product: plasmashell
Classification: Plasma
Component: general (show other bugs)
Version: 5.25.4
Platform: unspecified Linux
: NOR minor
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-08-26 02:37 UTC by gamma
Modified: 2022-09-09 18:08 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
notepadqq with nouveau (29.59 KB, image/png)
2022-08-26 02:50 UTC, gamma
Details
notepadqq with nouveau (30.50 KB, image/png)
2022-08-26 02:51 UTC, gamma
Details
manjaro-kde-nvidia-kernels-screen1.png (127.48 KB, image/png)
2022-08-27 15:41 UTC, gamma
Details
manjaro-kde-nvidia-kernels-screen2.png (125.83 KB, image/png)
2022-08-27 15:41 UTC, gamma
Details
3.pngmanjaro-kde-nvidia-kernels-screen (127.63 KB, image/png)
2022-08-27 15:42 UTC, gamma
Details
manjaro-kde-nvidia-kernels-screen4.png (63.84 KB, image/png)
2022-08-27 15:42 UTC, gamma
Details
manjaro-kde-nvidia-kernels-screen5.png (99.91 KB, image/png)
2022-08-27 15:42 UTC, gamma
Details
manjaro-kde-nvidia-kernels-screen6.png (72.03 KB, image/png)
2022-08-27 15:42 UTC, gamma
Details
manjaro-kde-nvidia-kernels-screen7.png (136.16 KB, image/png)
2022-08-27 15:43 UTC, gamma
Details
manjaro-kde-nvidia-kernels-screen8.png (31.12 KB, image/png)
2022-08-27 15:44 UTC, gamma
Details
manjaro-kde-nvidia-kernels-screen9.png (148.26 KB, image/png)
2022-08-27 16:01 UTC, gamma
Details

Note You need to log in before you can comment on or make changes to this bug.
Description gamma 2022-08-26 02:37:40 UTC
SUMMARY
When using the nvidia proprietary drivers instead of nouveau/Intel, looks like text is bigger and some apps don't fit it properly, so is partially or totally "cut".
Setting "Force font DPI:" to some value like 80 fixed the issue.
Several screenshots will be attached below comparing the same window in nouveau vs nvidia. Several distros are affected, at least Ubuntu and Manjaro.
This could be related to https://bugs.kde.org/show_bug.cgi?id=374978

STEPS TO REPRODUCE
1. Run KDE/plasma installed or live distro on any hardware with nvidia graphics cards.
2. Install and enable the proprietary nvidia driver so it's in use after reboot
3. Reboot
4. Install notepadqq v1.4.8
5. Open it and press F1 to open the About dialog

OBSERVED RESULT
The version number and Copyright text is cut partially.

EXPECTED RESULT
Behave with nvidia proprietary driver like with nouveau, so display everything properly.

SOFTWARE/OS VERSIONS
Operating System: Manjaro Linux
KDE Plasma Version: 5.25.4
KDE Frameworks Version: 5.97.0
Qt Version: 5.15.5
Kernel Version: 5.19.3-2-MANJARO (64-bit)
Graphics Platform: X11
Graphics Processor: NVIDIA GeForce GTX 1080/PCIe/SSE2
Comment 1 gamma 2022-08-26 02:40:33 UTC
Issue follow-up: https://github.com/notepadqq/notepadqq/issues/1055
Comment 3 gamma 2022-08-26 02:50:50 UTC
Created attachment 151597 [details]
notepadqq with nouveau
Comment 4 gamma 2022-08-26 02:51:04 UTC
Created attachment 151598 [details]
notepadqq with nouveau
Comment 5 gamma 2022-08-26 15:23:09 UTC
$ xrandr | grep -w connected
DP-0 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 381mm x 214mm
Comment 6 gamma 2022-08-27 15:40:43 UTC
Adding more screenshots with Manjaro using KDE and nvidia proprietary drivers.
Comment 7 gamma 2022-08-27 15:41:14 UTC
Created attachment 151634 [details]
manjaro-kde-nvidia-kernels-screen1.png
Comment 8 gamma 2022-08-27 15:41:42 UTC
Created attachment 151635 [details]
manjaro-kde-nvidia-kernels-screen2.png
Comment 9 gamma 2022-08-27 15:42:01 UTC
Created attachment 151636 [details]
3.pngmanjaro-kde-nvidia-kernels-screen
Comment 10 gamma 2022-08-27 15:42:21 UTC
Created attachment 151637 [details]
manjaro-kde-nvidia-kernels-screen4.png
Comment 11 gamma 2022-08-27 15:42:33 UTC
Created attachment 151638 [details]
manjaro-kde-nvidia-kernels-screen5.png
Comment 12 gamma 2022-08-27 15:42:51 UTC
Created attachment 151639 [details]
manjaro-kde-nvidia-kernels-screen6.png
Comment 13 gamma 2022-08-27 15:43:02 UTC
Created attachment 151640 [details]
manjaro-kde-nvidia-kernels-screen7.png
Comment 14 gamma 2022-08-27 15:44:00 UTC
Created attachment 151641 [details]
manjaro-kde-nvidia-kernels-screen8.png
Comment 15 gamma 2022-08-27 16:01:42 UTC
Created attachment 151642 [details]
manjaro-kde-nvidia-kernels-screen9.png
Comment 16 Nate Graham 2022-08-30 19:55:47 UTC
This is a bug in the NVIDIA driver itself, unfortunately. Please report it to the NVIDIA folks, either by sending an email to linux-bugs@nvidia.com or making a post at https://forums.developer.nvidia.com/c/gpu-unix-graphics/linux/

It would be helpful to the NVIDIA developers if you could run nvidia-bug-report.sh and attach the resulting file in your report. Thanks!
Comment 17 gamma 2022-09-07 19:11:40 UTC
The link you provided
https://forums.developer.nvidia.com/c/gpu-unix-graphics/linux/

Is not available:
Page Not Found
Sorry, this page may have moved, doesn’t exist or is private.
Comment 19 gamma 2022-09-09 05:56:51 UTC
KDE/Plasma are not handling native DPIs properly.
Comment 20 gamma 2022-09-09 05:57:39 UTC
It's KDE's fault not resolved upstream.
Comment 21 Joseph Yasi 2022-09-09 17:07:43 UTC
This isn't KDE's fault either for most of the screenshots you provided. Notepadqq has to handle HiDPI properly. So does the Manjaro Settings Manager.

The fonts are supposed to be scaled up based on the DPI. 72 point = 1 inch. The UI needs to adjust for that.
Comment 22 Nate Graham 2022-09-09 18:08:34 UTC
Unfortunately this is kind of a mismatch between different projects' expectations.

In the Xorg world, the DPI basically has to remain 96 or else all hell breaks loose. Gobs and gobs of software was designed with that assumption, and doing anything else makes it look subtly weird with wrong margins and paddings everywhere.

In the KDE and Qt world, we do scaling by using a Qt-specific scaling system which also sets the DPI to something other than 96, but in a way that works in conjunction with the Qt-specific thing. By setting the DPI alone, without also doing the Qt-specific thing, the NVIDIA driver is basically ensuring that lots of software will look mildly wrong all the time.

So the NVIDIA driver needs top stop doing setting the DPI at all, and trust the host system to do scaling in its own way. By trying to take over this job itself, it's just making everything worse, not better.