Skip to content
macos

My M4 Pro would only drive one of my two 5K monitors

9 min read

So, I bought two lovely 5K monitors, plugged them into my work M4 Pro MacBook Pro, and it would only drive one of them. It took a while, but I got to the bottom of it in the end, and the short version is that a spare display engine, a race at connect time and a 128-byte NVRAM variable that Apple doesn’t document anywhere were all conspiring against me.

Before we go any further, I want to be honest with you: I wouldn’t have had a chance in hell of figuring this out on my own. I did the whole thing with an AI agent sat alongside me in my terminal, digging through kernel logs, ioreg dumps and NVRAM. I’ll come back to that at the end, because it’s kind of the point.

TL;DR

  • What’s wrong: two ASUS XG27JCG 5K monitors on an M4 Pro, and only one shows up. Doesn’t matter if it’s through a Thunderbolt dock or plugged straight into the Mac. Restarting doesn’t help. Weirdly, the exact same dock, cables and monitors work fine on my M1 MacBook Pro.
  • Why: macOS gives the first monitor both of the Mac’s external display engines (a “dual pipe”, which it needs for the monitor’s 120 Hz and 165 Hz modes), then hangs on to both even at 60 Hz. The second monitor never gets one. Worse, macOS saves that in an NVRAM variable called display-crossbar0 and replays it every time you boot.
  • The fix: rewrite display-crossbar0 so each monitor gets one engine, restart, and keep the dock on the same Thunderbolt port. It’s undocumented, so it’s at your own risk. The command (and how to undo it) is further down.

My setup

For context, here’s what I’m running:

  • MacBook Pro, Apple M4 Pro (Mac16,8), macOS 27.2.1
  • Kensington SD5900T Thunderbolt 4 dock, one cable to the Mac
  • Two ASUS XG27JCG monitors: 27 inches, 5120×2880, up to 165 Hz. I run both at 5K 60 Hz, one of them in portrait.

What happened

I plugged everything in and only one monitor came on, which was annoying, so I restarted and both came on. Great, I thought, and that lasted almost three hours before one dropped out. After that I could only ever get one of them back. Restarting didn’t help, replugging every cable didn’t help, and plugging the second monitor straight into the Mac, skipping the dock completely, didn’t help either.

Wrong turn: blaming the dock

My first thought was bandwidth, because pushing two 5K streams down one Thunderbolt 4 cable sounds a bit tight. One 5K 60 Hz 10-bit stream is about 28 Gb/s uncompressed, and the cable carries 40 Gb/s. And honestly, the Mac’s DisplayPort state looked exactly like a starved link, with the first stream on a full four-lane link and the second getting nothing:

$ ioreg -lw0 -r -c IOPortTransportStateDisplayPort
...
"HPD_StateDescription" = "High"
"SinkCount" = 1
"LinkRateDescription" = "8.1 Gbps (HBR3)"
"TransportDescription" = "Port-USB-C@3/CIO/DisplayPort@0"
...
+-o DisplayPort@1
"HPD_StateDescription" = "High"
"SinkCount" = 0
"LinkRateDescription" = "No Link"

The second stream was making it to the dock, and the dock could see a monitor was there (hot-plug was “High”), but nothing answered (SinkCount was 0) and the link never came up.

That felt like case closed, but two things didn’t add up. The second monitor did exactly the same thing when it was plugged straight into the Mac, and the whole lot worked perfectly on my M1. So it wasn’t the dock.

What the Mac actually saw

Here’s something I didn’t know: Apple silicon Macs route their display engines to their ports through a thing called a display crossbar. In crossbar speak, a UFP is a display engine (dispext0, dispext1) and a DFP is a port. And you can peek at it with ioreg:

$ ioreg -lw0 -r -c AppleDisplayCrossbar -d 1 | grep -E '"(available-ufps|pending-dfps|current-state)"'
"available-ufps" = ()
"current-state" = {"dfp"=("0:ufp0,0-dfp2,1"),"ufp"=("0:ufp1,0-ufp0,0")}
"pending-dfps" = ("atc0,0")

No engines free. The second monitor’s port (atc0,0, the USB-C port I’d plugged it into) was just sat there in pending-dfps, waiting. And the current state was telling me two things:

  • Engine 0 was driving the first monitor (dfp2,1, the dock’s first stream).
  • Engine 1 was hanging off engine 0 (ufp1,0-ufp0,0). It wasn’t driving anything of its own.

So why was engine 1 just… hanging around? The kernel log had the answer:

updateDisplayAllocation: allocate mainUFP 0x00000000 peerUFP 0x00000001
IOMFB check_dsc_modes: Needs dual pipe DSC support
AED: fb 2 native dual pipe, no reconfig; mode set intent with 1 pipes
no available UFP for DFP(0x100000426) on domain0: It remains pending; continue..

Dual pipe

On the M4 Pro, 5K at 120 Hz or 165 Hz needs more than one display engine, so macOS can glue two engines together into a “dual pipe” for one display. The XG27JCG advertises exactly those modes, and its DisplayID block even marks 5K 165 Hz as the preferred mode, so when one monitor connects on its own, macOS goes “ooh, high refresh rate” and hands it engine 0, plus engine 1 as a peer.

You can actually see this in the list of modes. With one monitor holding both engines, macOS offered me 5K at 30, 60, 120 and 165 Hz. With one engine per monitor, it only offers 30 and 60 Hz.

Here’s the bug, though. I run 5K at 60 Hz, which only needs one engine (mode set intent with 1 pipes), but macOS keeps the second engine anyway (no reconfig). When the second monitor turns up, the crossbar looks for a free engine, can’t find one, and leaves the monitor pending forever, because it never thinks to take the spare back.

So why did it work sometimes?

It’s a race. If both monitors turn up in the same allocation pass, they get one engine each, and both requests for a spare fail:

setDisplayHints: failed to allocate peer ufp for mainUFP 0x00000000
setDisplayHints: failed to allocate peer ufp for mainUFP 0x00000001

That’s what happened after two of my restarts, and both monitors worked. Earlier that day I’d also had one XG27JCG running alongside another screen on the Mac’s HDMI port. That screen connected first and grabbed engine 1, so the XG27JCG never got the chance.

The trouble starts when a monitor drops out while the Mac is awake, which is what happened to me at 18:42. The remaining monitor shuffled over to engine 0, took engine 1 as its peer, and that was that: the other monitor was never coming back.

And why didn’t restarting help?

This is the bit that really surprised me. The crossbar saves its assignment in NVRAM, and replays it when you boot:

$ nvram display-crossbar0
display-crossbar0    %01%00!%00%00%00%00%00%03%10%00%00%00...

At boot, the kernel actually waits for the saved ports to show up before it assigns anything:

displayAllocationEventOccurred: dfp 2:1 not registered
displayAllocationEventOccurred: Missing DFP port from nvram configuration

Then it puts the saved state straight back, peer engine and all. So every restart after 18:42 was just faithfully replaying the broken setup, and the two good restarts had replayed good ones:

Boot Saved assignment it replayed Result
15:53 Engine 1 reserved for the HDMI port (left over from the morning) Both monitors
15:58 One engine per dock stream Both monitors
18:46, 20:57, 20:59 Engine 0 plus engine 1 as its peer One monitor

Turns out “have you tried turning it off and on again?” doesn’t help much when the computer remembers the problem. 🙃

Decoding display-crossbar0

The variable is 128 bytes and Apple doesn’t document it, which wasn’t a great start. Luckily, the crossbar keeps an event log in ioreg, where each entry shows a decoded state right next to the raw bytes, and those bytes match what’s in NVRAM:

{"dfp"=("0:ufp0,0-dfp2,1"),"ufp"=("0:ufp1,0-ufp0,0")}
01 00 21 00 00 00 00 00  03 10 00 00 00 00 00 00  (rest zero)

Line them up and it reads as 8-byte records of [type, source, destination], with each endpoint written as (unit << 4) | index:

Bytes Meaning
01 00 21 Type 01: engine 0 (dispext0,0 = 0x00) drives port atc2,1 (0x21), the dock’s first stream
03 10 00 Type 03: engine 1 (dispext1,0 = 0x10) is a peer of engine 0

So what I actually wanted, one engine per dock stream, looks like this:

01 00 21 00 00 00 00 00  01 10 22 00 00 00 00 00  (rest zero)

The fix

Warning: this writes an undocumented NVRAM variable. It worked on my Mac with macOS 27.2.1, and it’s easy to undo, but you do it at your own risk. The port bytes 21 and 22 match my setup (the dock’s two streams on one Thunderbolt port). Check yours first!

  1. Connect both monitors and switch them on.

  2. Back up the current value, just in case:

    nvram display-crossbar0 > ~/display-crossbar0-backup.txt
  3. Write the new value:

    sudo nvram "display-crossbar0=%01%00%21%00%00%00%00%00%01%10%22$(printf '%%00%.0s' $(seq 1 117))"

    That’s the 11 bytes from above, padded out with 117 zero bytes to make 128.

  4. Restart straight away. Don’t unplug, switch off or sleep anything first, because any display change makes macOS rewrite the value.

After the restart, the kernel waited for both ports and gave each one its own engine. Both requests for a spare failed, which is exactly what I wanted (I’ve trimmed the messages a bit):

dfp 2:1 not registered
dfp 2:2 not registered
domain0: connectTo ufp dispext0,0 to dfp atc2,1
domain0: connectTo ufp dispext1,0 to dfp atc2,2
failed to allocate peer ufp for mainUFP 0x00000000
failed to allocate peer ufp for mainUFP 0x00000001

Both monitors came up, and macOS saved the good assignment back to NVRAM. 🎉

Changed your mind? Run sudo nvram -d display-crossbar0 and restart.

Have you got the same problem?

While only one monitor is showing, check the crossbar and the kernel log:

ioreg -lw0 -r -c AppleDisplayCrossbar -d 1 | grep -E '"(available-ufps|pending-dfps|current-state)"'
log show --last 1h --predicate 'process == "kernel" AND eventMessage CONTAINS "DisplayCrossbar"'

If available-ufps is (), pending-dfps lists a port, current-state has a ufp entry like ("0:ufp1,0-ufp0,0"), and the log mentions peerUFP 0x00000001 and no available UFP, then you’ve probably got the same problem I had.

Tweaking the bytes for your setup

Your working monitor’s port is in current-state (dfp2,1 for me). The stuck one is in pending-dfps. Ports count in the order atc0, atc1, atc2, atc3, so atc2,2 means DFP 2, index 2, which is byte 0x22, and atc0,0 is 0x00.

Put the working monitor’s byte in the first record and the stuck monitor’s byte in the second. These bytes name physical ports, so make sure you plug the dock into the same Thunderbolt port every time.

How long does it last?

Here’s what I’ve found so far:

  • Restarts: fine, as long as the dock stays in the same Thunderbolt port. macOS just replays the good assignment.
  • Display sleep: fine. I tested it with pmset displaysleepnow.
  • Moving the dock to a different port: breaks it. The saved assignment names ports, so the crossbar can’t use it, and the first monitor grabs both engines again. I found this out the hard way the next morning when the dock went into a different port, only one monitor came up and a restart didn’t help. Moving it back, writing the value again and restarting got me back in business.
  • A monitor dropping out while the Mac’s awake (switched off, unplugged, cable knocked): breaks it again, and macOS saves the broken state. Just run the command again and restart.
  • macOS updates: who knows! I’ll find out.

I also reckon an EDID override that hides the monitor’s 120 Hz and 165 Hz modes might avoid the whole thing without touching NVRAM, but I haven’t tried it. If you do, let me know!

What I’d like Apple to change

The M4 Pro supports two external displays and both of mine run at 60 Hz, so this should just work. macOS should take the spare engine back when another display needs one, or not bother reserving a spare for a display that’s running a single-pipe mode. I’ve reported it through Feedback Assistant with all the logs (FB number: TBD).

How I found it (spoiler: AI)

I said I’d come back to this, and I want to be really clear about it. I wouldn’t have had a chance in hell of solving this without an AI investigating alongside me.

I’m comfortable in a terminal, but I’d never heard of a display crossbar. I didn’t know ioreg could show me one, that the kernel logs every allocation it makes, or that macOS keeps any of this in NVRAM. The agent did. It chewed through ioreg, the unified log and NVRAM way faster than I ever could, spotted that peerUFP line, and decoded an undocumented 128-byte variable by lining it up against the crossbar’s own event log. Left to my own devices, I’d have sent back a perfectly good monitor or bought a different dock, and been none the wiser.

It wasn’t magic, mind. Its first theory, dock bandwidth, was wrong, and what turned it around was a dead simple test: the second monitor failed even when plugged straight into the Mac, while the same kit worked on my M1. Sometimes the boring test is the one that matters.

So, two lessons I’ll be hanging on to:

  • On Apple silicon, if a monitor is connected but never appears, check the display crossbar, not just the cable.
  • A restart doesn’t reset everything. Some state lives in NVRAM.