Bug 443355 - Incorrect DPI settings on KDE Plasma when switched GPU
Summary: Incorrect DPI settings on KDE Plasma when switched GPU
Status: REPORTED
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: 5.24.4
Platform: Kubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-05 15:50 UTC by Andreas
Modified: 2023-02-20 02:26 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Intel GPU, 225% scaling (793.83 KB, image/jpeg)
2021-10-05 15:50 UTC, Andreas
Details
wrong image (793.83 KB, image/jpeg)
2021-10-05 15:52 UTC, Andreas
Details
After switching to NVIDIA, Plasma shows 225% scaling, but this is 100% (707.53 KB, image/jpeg)
2021-10-05 15:56 UTC, Andreas
Details
Intel GPU, 225% scaling (793.83 KB, image/jpeg)
2021-10-05 15:58 UTC, Andreas
Details
After switching to NVIDIA, Plasma shows 225% scaling, but this is 100% (707.53 KB, image/jpeg)
2021-10-05 15:59 UTC, Andreas
Details
After switching one GPU to another (671.49 KB, image/jpeg)
2021-10-06 21:49 UTC, Andreas
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas 2021-10-05 15:50:12 UTC
Created attachment 142169 [details]
Intel GPU, 225% scaling

SUMMARY
When I change graphics from Intel to NVIDIA or NVIDIA to Intel the scaling is reset to 100%, but the plasma displays the correct scaling of 225%.

Same problem
https://github.com/Askannz/optimus-manager/issues/208

Similar problem, but "solved" because display is not hidpi
https://github.com/Askannz/optimus-manager/issues/67
I also have correct dpi 96 in xorg-nvidia.conf

STEPS TO REPRODUCE
1. Set scale 225% on hidpi display
2. Switch GPU from Intel to NVIDIA
3. Switch scale to 200% and save
4. Switch scale back to 225%, save, logout and login. You will get the right scaling
5. Switch GPU from NVIDIA to Intel and you will get the wrong scaling again

OBSERVED RESULT
Scaling settings are not applied when changing GPU

EXPECTED RESULT
Scaling should be the same when changing GPUs

SOFTWARE/OS VERSIONS
Linux/KDE Plasma:  Kubuntu 20.04, KDE Neon, OpenSUSE LEap 15.3 with from Plasma 5.18.6 to 5.22.90
(available in About System)
KDE Plasma Version: 5.18.5 to 5.22.90

ADDITIONAL INFORMATION
Dell Precision 7530 with UHD Display, Intel UHD P630 + NVIDIA Quadro P3200
Comment 1 Andreas 2021-10-05 15:52:27 UTC
Created attachment 142170 [details]
wrong image
Comment 2 Andreas 2021-10-05 15:56:43 UTC
Created attachment 142171 [details]
After switching to NVIDIA, Plasma shows 225% scaling, but this is 100%
Comment 3 Andreas 2021-10-05 15:58:58 UTC
Created attachment 142172 [details]
Intel GPU, 225% scaling
Comment 4 Andreas 2021-10-05 15:59:30 UTC
Created attachment 142173 [details]
After switching to NVIDIA, Plasma shows 225% scaling, but this is 100%
Comment 5 David Edmundson 2021-10-06 20:16:08 UTC
Which scaling are you referring to?

Is this X11 or wayland?
Please include output of env and `xrdb -q` in the broken setup
Comment 6 Andreas 2021-10-06 21:47:47 UTC
(In reply to David Edmundson from comment #5)
> Which scaling are you referring to?
Scaling in Plasma settings.
I have a UHD display and 225% scaling. When I switch the system from one GPU to another, Plasma shows 225% scaling, but in fact it is 100%.
Look at the attached screenshot.

> Is this X11 or wayland?
X11

> Please include output of env and xrdb -q in the broken setup
env
https://paste.opensuse.org/37174141

xrdb -q
https://paste.opensuse.org/16857491


Temporary solution

I created a script
~/.config/plasma-workspace/env/nvdpi.sh

and wrote in it
export QT_SCREEN_SCALE_FACTORS=$QT_SCREEN_SCALE_FACTORS"eDP-1-1=2.25"

eDP-1-1 <- xandr output on NVIDIA
2.25 <- 225% scaling
Comment 7 Andreas 2021-10-06 21:49:10 UTC
Created attachment 142227 [details]
After switching one GPU to another
Comment 8 Bug Janitor Service 2021-10-21 04:35:28 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 9 Andreas 2021-11-22 15:13:01 UTC
(In reply to Andreas from comment #6)
> Temporary solution
> 
> I created a script
> ~/.config/plasma-workspace/env/nvdpi.sh
> 
> and wrote in it
> export QT_SCREEN_SCALE_FACTORS=$QT_SCREEN_SCALE_FACTORS"eDP-1-1=2.25"
> 
> eDP-1-1 <- xandr output on NVIDIA
> 2.25 <- 225% scaling

This solution does not work with dual monitors.
So I changed the script
~ / .config / plasma-workspace / env / nvdpi.sh

QT_SCREEN_SCALE_FACTORS = "2.25; 2.25"

This works on two monitors.
Scaling problem when switching GPU only with QT applications, maybe there is a way to fix it?
Comment 10 Богдан 2022-04-16 17:07:16 UTC
After installing the proprietary driver, the font in the Viber application is displayed in small font. In Xorg everything is smooth, but everything slows down. Thanks.

После установки проприетарного драйвера, шрифт в приложении Вайбер, отображается мелким шрифтом. В Xorg всё ровно, но всё подтормаживает.  Спасибо
Comment 11 Andreas 2023-02-20 01:57:08 UTC
In Plasma 5.27 GTK applications don't scale when you switch to a second GPU.
Comment 12 Andreas 2023-02-20 02:26:15 UTC
(In reply to Andreas from comment #11)
> In Plasma 5.27 GTK applications don't scale when you switch to a second GPU.
If I add GDK_SCALE=2 then applications are scaled 4x