NVIDIA (Reverse?) PRIME freezes external monitors

Hello NVIDIA forum

I’m having issues with NVIDIA PRIME on my laptop. Whenever I run an OpenGL program with PRIME while an external display is connected and multiple displays are enabled, there’s a high probability at any given time that the output to the external monitors will freeze.

The system:
I have a Lenovo P51 with an Core i7 7700HQ CPU along with an NVIDIA Quadro M1200 GPU.
The built-in display is connected to the iGPU, all external ports appear to be connected to the dGPU.

What I’ve found out about the issue so far:
The issue appears only when multiple outputs are enabled, be that built-in and external, or multiple external displays. With one external display, I cannot reproduce the issue.
The internal display rarely if ever freezes while the external displays freeze very consistently when PRIME is used.
When built-in display is enabled, external displays can freeze independently. When multiple external displays are enabled, all freeze at the same time.
As long as the built-in display is responsive, I can unfreeze the external monitors by switching to another vterm and back.
I cannot reproduce the issue with version 525.60.11 of the drivers, but every version after that that I have tested produces the issue, including the very next driver in line, 525.78.01 which has the release note “Fixed excess CPU usage in hybrid graphics configurations where an external display is connected to an NVIDIA discrete GPU and configured as a PRIME Display Offload sink (also known as “Reverse Prime”)” which I suspect is related.
I’ve reproduced the issue in Arch Linux with any number of driver versions and in Ubuntu 24.04 with their 535 version.
I’ve tried a large number of kernel parameter combinations, as well as enabling/disabling PRIME Synchronization and most other tips and tricks mentioned in the Arch wiki regarding NVIDIA in general and PRIME specifically.
I’ve updated every firmware that I could on the computer.
I’ve tried with a couple of different kernels (Arch’s current, Arch’s LTS and Ubuntu’s current)
Everything works as expected when PRIME is disabled or not in use (NVIDIA-only, iGPU only, or PRIME setup without actually using PRIME)
Stuff that’s too minor to mention, or that I’ve forgotten about right now.

Attached is a bug report log
nvidia-bug-report.log.gz (383.8 KB)