Intel Retina 4K/5K iMacs can only use 4K UHD (3840x2160) resolution with the existing Linux kernel. This ca. 50 line patch properly activates the Retina 4K/5K tiling mode that is used in macOS. This is in the process of being submitted upstream to the mainline kernel.
Simple one-click script iMac5K-DKMSModule-Install.sh to download, build, and install iMac tiling support as a DKMS Module on iMacs. You need to install
the normal OS first e.g. https://ubuntu.com/download/desktop
Works on Ubuntu 26.04 LTS and 26.10. May work on Mint, Zorin, and other Debian distros. Kernel 7.3+ and Mesa 26.3+ recommended.
Works on all Retina iMacs except the 2020 iMac and iMacs with VEGA GPUs.
Needs 1.3GB Disk Space and 5-6 minutes compile time.
Models confirmed working:
| Generation / Release Year | Model Identifier | GPU Option (Family) | 4K / 5K Working |
|---|---|---|---|
| Late 2014 | iMac15,1 | R9 M290X (GCN 1) | ❓ |
| Late 2014 | iMac15,1 | R9 M295X (GCN 3) | ✅ |
| Mid 2015 | iMac15,1 | R9 M290X (GCN 1) | ❓ |
| Mid 2015 | iMac15,1 | R9 M295X (GCN 3) | ✅ |
| Late 2015 | iMac17,1 | R9 M380 / M390 (GCN 2) | ✅ |
| Late 2015 | iMac17,1 | R9 M395 / M395X (GCN 3) | ✅ |
| Mid 2017 | iMac18,2 | Pro 555 / 560 (GCN 4) | ✅ |
| Mid 2017 | iMac18,3 | Pro 570 / 575 / 580 (GCN 4) | ✅ |
| 2019 | iMac19,2 | Pro 555X / 560X (GCN 4) | ✅ |
| 2019 | iMac19,2 | Pro Vega 20 (GCN 5) | ➖ |
| 2019 | iMac19,1 | Pro 570X / 575X / 580X (GCN 4) | ✅ |
| 2019 | iMac19,1 | Pro Vega 48 (GCN 5) | ➖ |
| 2020 | iMac20,1 | Pro 5300 / 5500 XT (RDNA 1) | ➖ |
| 2020 | iMac20,2 | Pro 5700 / 5700 XT (RDNA 1) | ➖ |
| 2017 (iMac Pro) | iMacPro1,1 | Pro Vega 56 / 64 / 64X (GCN 5) | ➖ |
Legend:
- ✅ Working: Tiled 4K/5K display working with patch.
- ➖ Needs Additional Work: Requires extra methods to activate 5K. You could try using this patch as a base.
- ❓ Needs Confirmation: Should work from Kernel 7.3 + Mesa 26.3 onwards thanks to work by Valve.
Screen tearing artifacts down the centre of the screen are fixed on Ubuntu if you run iMac5K-MutterTearFix-Ubuntu.sh.
The Plymouth boot splash now supports tiled displays. On Ubuntu this can be tested using iMac5K-PlymouthTest-Ubuntu.sh.
To fix tiny text in the GRUB menu and root shell run iMac5K-GRUBFontSize-Ubuntu.sh.
To fix GPU power management problem that causes slow boot/shutdown and some apps not opening run iMac5K-GRUBParams.sh. Also run this if you can't connect to password secured WiFi networks, or Bluetooth isn't available.
To fix max brightness to 500/600 nits (5K/4K) instead of 400/500 nits using a custom ACPI table run iMac5K-500nitsFix.sh.
To control GPU power mode GPU-ToggleButton.ini can be loaded in to the Custom Command Toggle Gnome Extension (https://github.com/StorageB/custom-command-toggle). It appears in Quick Settings. It will default to power saving mode, and switch to a higher performance mode when toggled on.
To install Speaker tuning (flat frequency response +/- 4dB) I made by hand using a UMIK-1 measurement microphone run iMacAudioInstall.sh in the Audio folder. Tuned on 2017 4K iMac (red) and late 2015 5K iMac (green) using an enhancement of the Asahi Audio method where I phase align the tweeters with the woofers to bring the stereo image forwards. The crossover between the tweeters and woofers is also set correctly.
These tuning files are compatible with late 2015-2020 iMacs (excluding iMac Pro). They won't work on other models as the speaker designs are physically different.
Note: if you have a 2017-2019 4K/5K iMac you will need to install this first: https://github.com/davidjo/snd_hda_macbookpro
After installation Ubuntu audio settings Output should say "iMac Speakers". If you want to set the master system volume to higher than 79% open the Volume Control app and select the Output Devices tab. If it wasn't set automatically Built-in Audio Profile must be "Analogue Surround 4.0 Output + Analogue Stereo Input" in the Configuration tab.
Crosstalk cancellation algorithms have less effect on iMacs due to the downfiring speaker design, however if you install EasyEffects (https://flathub.org/en/apps/com.github.wwmm.easyeffects) and add the Crosstalk Cancellation Effect it will subtly improve some audio tracks. This is based on the Recursive Ambiophonic Crosstalk Elimination (RACE) technique which may be similar to how macOS cancels crosstalk.
For working microphone and headphone socket on late 2015 5K iMac, run build-cs420x-imac171-dkms.sh in the Audio folder.
Late 2015-2017 iMacs with the Broadcom 43602 Wifi Card only connect to networks at 40 MHz instead of 80 MHz outside the USA. I have submitted a patch upstream to correct this, effectively doubling WiFi speeds on these models. To fix this now run iMac5K-2015to2017-WifiFix.sh. The WiFi firmware is also missing but can be obtained by following the instructions in the WiFi folder.
For 2019 iMacs follow this guide for the firmware: https://wiki.t2linux.org/guides/wifi-bluetooth/
Run the scripts in the iGPU folder to use the intel GPU in 2017-2019 iMacs for VP9 video decoding/encoding. Especially useful for hardware video acceleration in YouTube. Needs Kernel 7.3+ and Mesa 26.3+.
To set Ubuntu to use the wide gamut colourspace (DCI-P3) available with the iMac display run iMac5K-WideGamutColour.sh.
Ubuntu/Gnome still uses outline font hinting on HiDPI displays. Some non-GTK apps still apply subpixel-antialiasing, and font hinting on HiDPI displays. To fix these problems run iMac5K-FontRenderingFix.sh.
These kernel parameters allow access to the USB ports/SD card reader/headphone jack on my Belkin TB3 Dock Pro (might work for other docks)
``
Suspending to S3 deep sleep works on 2014-2015 iMacs. It does not work on 2017-2019 iMacs, use Automatic Screen Blank in Ubuntu settings instead.
Right-click>Properties>Executable as Program should be ticked, then drag the .sh file into a terminal window and press enter
- https://github.com/taranovegor/mbpfan for Fan Control with EMA smoothing (add curve = 45:3,65:7,74:18,82:32,88:50,94:75,100:100 and min_fan1_speed = 850 to etc/mbpfan.conf)
- https://github.com/aunetx/blur-my-shell for Liquid Glass
- https://github.com/kem-a/kiwi-kemma for making Ubuntu/Gnome feel at home for Mac users
Thanks to the AI-assisted (Claude) discovery at https://github.com/mcirsta/linux-imac-5k/tree/pro1-apple5k-logging which I used to generate my 1,500 line kernel 7.0 patch. My new kernel 7.3 patch is reduced to 50 lines with a combination of human-editing and AI suggestions (Google Gemini). Thanks to Timur Kristóf, https://github.com/MarkPronkin/, and https://github.com/ahmadtv for input, code review, feedback.
Asahi Audio from which I adapted my speaker tuning: https://github.com/AsahiLinux/asahi-audio. Andreas Heider for the EFI binary to unlock Apple iGPUs https://github.com/0xbb/apple_set_os.efi.