HiDPI on dual 4K monitors with Linux

Vincent Bernat

I have been us­ing a Lenovo ThinkPad X1 Car­bon lap­top (210 DPI) for four years and a Nokia 8 phone (550 DPI) for a year. I en­joy their HiDPI screens: the text is crisp and easy to read. To get a sim­i­lar ex­pe­ri­ence for my work­sta­tion, I bought a pair of Dell P2415Q monitors:

Two Dell P2415Q
Dual screen setup with two Dell P2415Q monitors

Monitors#

The Dell P2415Q is a 24″ dis­play fea­tur­ing an IPS panel with a 3840×2160 res­o­lu­tion (185 DPI) and com­plete cov­er­age of the sRGB color space. It was re­leased in 2015 and its price is now be­low US$400. It re­ceived pos­i­tive reviews.

One of my units ar­rived with a dead pixel. I thought it was a prob­lem from the past but Dell pol­icy on dead pix­els says:

Dur­ing LCD man­u­fac­tur­ing process, it is not un­com­mon for one or more sub-pix­els to be­come fixed in an un­chang­ing state. A dis­play with a 1 to 5 fixed sub-pixel is con­sid­ered nor­mal and within in­dus­try standards.

Up­date (2018-12)

Three new dead pix­els have ap­peared. There­fore, I do not rec­om­mend these screens.

An­other is­sue is the pres­ence of faint hor­i­zon­tal gray lines, (barely) vis­i­ble on white back­ground. The is­sue seems to not be un­com­mon but Dell is dis­mis­sive about it. If I sit cor­rectly, the lines be­come in­visible.

Up­date (2020-06)

This hap­pens when the screen is con­nected through HDMI. In this case, the pixel for­mat may be YCbCr or RGB. I have fixed the prob­lem by hack­ing the EDID of the dis­play so the driver chooses RGB.

I am a bit dis­ap­pointed by these is­sues, but I think they are bear­able and it is an op­por­tu­nity to help fix my ob­ses­sion over such details.

Graphics card#

To drive a 4K dis­play at 60 Hz, you need at least ei­ther HDMI 2.0 or DisplayPort 1.2. The Dell P2415Q has been up­graded to HDMI 2.0 in 2016 and also pro­vides a DP 1.2 in­put. There is a port for daisy-chain­ing a sec­ond mon­i­tor but, with­out sup­port for DP 1.3, the re­fresh rate would drop to 30 Hz.

There is cur­rently no avail­able Radeon card around US$100 able to drive two 4K dis­plays. On the NVIDIA side, the GeForce GT 1030 fits the bill with a power con­sump­tion of 20 W for the DDR4 ver­sion. I opted for a pas­sively cooled model from MSI. On Linux, the re­sult is quite dis­ap­pointing:

  • The nou­veau driver still has rudi­men­tary sup­port for this gen­er­a­tion of NVIDIA chips. The re­sult was un­bear­ably slow and the HDMI 2.0 port was not han­dled correctly.

  • The pro­pri­etary NVIDIA driver ex­hibits poor per­for­mance. It is dif­fi­cult to know if this is due to the graph­ics card it­self,1 or to the driv­ers. I have tested 390, 396, 410, 415, and 418. More­over, sus­pend-to-RAM is broken.

Up­date (2019-05)

I have switched to an ASUS Phoenix Radeon RX 550. With such a card, ev­ery­thing runs smoothly, us­ing the open-source driver amdgpu. The card comes with a fan but it is PWM-con­trolled. See ArchWiki for more de­tails. In au­to­matic mode, when /sys/class/drm/card0/device/hwmon/hwmon1/pwm1_enable is set to 2, it spins at 1050 RPM:

$ sensors amdgpu-pci-0100
amdgpu-pci-0100
Adapter: PCI adapter
vddgfx:       +0.88 V
fan1:        1047 RPM
temp1:        +51.0°C  (crit = +94.0°C, hyst = -273.1°C)
power1:       17.20 W  (cap =  35.00 W)

HiDPI support on Linux with X11#

GNOME and KDE now sup­port HiDPI dis­plays out of the box when run­ning with X11. For other en­vi­ron­ments, it is quite easy to set up, thanks to xset­tingsd. The fol­low­ing snip­pet should be in­voked from ~/.xsession or when the DPI value changes:

# Target DPI
dpi=192

# For applications supporting XSettings, `Xft/DPI' sets font scaling
# (and sometimes interface scaling), `Gdk/WindowScalingFactor' sets
# interface scaling with GTK 3, and `Gdk/UnscaledDPI' undo font scaling
# for GTK 3 applications.
> ~/.xsettingsd cat <<EOF
Xft/DPI $(( $dpi*1024 ))
Gdk/WindowScalingFactor $(( $dpi/96 ))
Gdk/UnscaledDPI $(( $dpi*1024/($dpi/96) ))
EOF
pkill -HUP xsettingsd || xsettingsd &

# For Qt applications.
export QT_AUTO_SCREEN_SCALE_FACTOR=1
export QT_SCALE_FACTOR_ROUNDING_POLICY=PassThrough

# For miscellaneous applications.
echo Xft.dpi: $dpi | xrdb -merge

Then, it is up to each ap­pli­ca­tion to know how to ren­der on a HiDPI dis­play. The ta­ble be­low gives an over­view of HiDPI sup­port for var­i­ous ones, us­ing the above set­tings. “Text scal­ing” in­di­cates if an ap­pli­ca­tion can adapt the font size. This is usu­ally the most es­sen­tial fea­ture. “In­ter­face scal­ing” tells if it can scale the whole in­ter­face, in­clud­ing the icons. Ide­ally, ap­pli­ca­tions are also ex­pected to be able to dy­nam­i­cally up­date scal­ing when no­ti­fied through XSettings, which is use­ful when switch­ing to an ex­ter­nal display.

Application Text scaling Interface scaling No restart needed?
Most Qt 5 apps ✔ ✔ ✔
Chromium2 ✔ ✔ ✔
Firefox (GTK 3) ✔ ✔ ✔
Most Electron apps3 ✔ ✔ ✔
Emacs 26.1 (GTK 3) ✔ 😐 ✔
Emacs 27.1 (GTK 3 with Cairo) ✔ 😐 ❌
VTE terminals (GTK 3) ✔ 😐 ✔
Blender4 ✔ ✔ ❌
Gimp (GTK 2) ✔ ❌ ✔
Inkscape (GTK 2) ✔ ❌ ✔
Most GTK 2 apps ✔ ❌ ✔
Most GTK 3 apps ✔ 😐 ✔
Most Java apps5 🙄 🙄 ❌
xterm and rxvt (with Xft) ✔ n/a ❌
Most other applications ❌ ❌ ❌

Qt 5 ap­pli­ca­tions of­fer very good sup­port. GTK 3 ap­pli­ca­tions can cur­rently only scale their in­ter­faces us­ing an in­te­ger fac­tor, which is an­noy­ing when you need a 1.5× fac­tor. GTK 2 ap­pli­ca­tions will only scale the text and there are still many of them—no­tably Gimp. For more de­tails, have a look at the ded­i­cated page on ArchWiki. Be­yond X11, Way­land can pro­vide per-mon­i­tor scal­ing6 and to scale ap­pli­ca­tions with­out HiDPI support.

In con­clu­sion, the sit­u­a­tion still de­pends heav­ily on the ap­pli­ca­tions you run. As I spend most of my time in a VTE ter­mi­nal, Emacs and, Fire­fox, I am mostly happy with the result.

Up­date (2025-09)

I have re­cently re­placed these two screens with a pair of Alien­ware 27 4K QD-OLED mon­i­tors and the GPU with a Gi­ga­byte Radeon RX 9060 XT to be able to cope with the in­creased re­fresh rate.

Up­date (2026-10)

This post was widely dis­cussed on Lobsters.