External Monitor not available after Suspend/Sleep

@anon1399550
Yes I performed experiments in hybrid mode.
Can you please configure X to run on AMD iGPU by removing NVIDIA xorg.conf.d snippets or by unloading nvidia-drm with ‘sudo rmmod nvidia-drm’ and see if you face similar issue after suspend/resume operation.

@amrits
The Thinkpad P1 Gen2 does not have a AMD GPU, but only Intel iGPU + Nvidia dGPU (Quadro T2000).
Using an external monitor (either via Dock or directly) requires the Nvidia dGPU to be active, since external video ports are only connected to Nvidia GPU.

So running an external monitor via Intel iGPU is not possible.

@amrits
Could you please reply

@anon1399550
I tried to duplicate issue on below configuration setup but no luck so far.

LENOVO ThinkPad P1 Gen 3 + Fedora release 34 (Thirty Four) + 5.11.12-300.fc34.x86_64 + Quadro T1000 + Driver 510.68.02 + GBT AORUS FI27Q-P

LENOVO ThinkPad P1 Gen 3 + Ubuntu 20.04 + Quadro T1000 + Driver 510.68.02 + Lenovo ThinkPad Thunderbolt 3 Dock + Display GBT AORUS FI27Q-P connected via DP cable
Performed suspend/resume multiple times and waited for half an hour before resume operation and every time external display comes up.

Can you share display edid information so that I can use the same to try for local repro.
Also do you have spare DP cable/Dock to check if issuer persists with other hardware also.

@amrits

Currently using Fedora 35
Maybe it is a Quadro T2000 specific issue?
The following is required to repro the issue:

  1. UEFI/BIOS set to Hybrid Graphics
  2. Monitor connected via Thinkpad Thunderbolt 3 Dock (the only TB dock type I have)

Cable is not the issue, I’ve tried 2 different DP cables and 2 different HDMI cables. Issue persists with all of those cables.
Even with a different Monitor (Dell S2721QS) the issue persists.

Please find attached the edid.bin extracted via NVIDIA Settings
edid.bin (256 Bytes)

here data read with monitor-edid tool:

EISA ID: AUO42eb
EDID version: 1.4
EDID extension blocks: 1
Screen size: 34.4 cm x 19.3 cm (15.53 inches, aspect ratio 16/9 = 1.78)
Gamma: 2.2
Digital signal

        # Monitor preferred modeline (60.0 Hz vsync, 133.3 kHz hsync, ratio 16/9, 283 dpi)
        ModeLine "3840x2160" 533.3 3840 3888 3920 4000 2160 2163 2168 2222 -hsync -vsync

@amrits
What I forgot to mention, I have the latest firmware on the docking station: 3.1.81
Could you also try to update the firmware of the docking station to the latest:

For the DP-Hub to beeing updated, haveing a monitor connected via DP to the dock is required.

@anon1399550
I tried to upgrade dock firmware version but it is failing on my setup. It is not able to detect dock while upgrade process though external monitors connected to display are working fine before and after suspend operation. However I believe that firmware upgrade does not plays any role here as you are seeing this issue with 2 different firmware versions.

Also I forced edid shared by you on my setup but could not reproduced issue.

Can you please help on below data points which might help us to find where issue is lying with.

  1. Do you remember nvidia driver version where it worked fine in the past.
  2. What is the repro frequency, do you see issue every time you suspend/resume notebook ?
    Is there any specific hours to keep notebook in suspend mode?
  3. Can you try unplug/plug display connection from dock (as WAR) when you are in repro state and see if it detects external monitor.
  4. Can you try unplug/plug display connection from display itself ( as WAR) when you are in repro state and see if it detects external monitor.

@amrits
strange with the firmware update. But I think it could matter.
I remember I have ordered a second Thinkpad thunderbolt 3 Workstation dock which I did not update. There suspend to sleep seemed to sporadically work. But also here it used to fail after the second or third attempt.

Honestly, I was never really able to test ist, because from the beginning I had the dock, there was the issue with static noise over the Dock. Maybe you remember. So it was not really possible to use the dock.

But I could try to test with the same config as of that time, if suspend would have worked with the older drivers (with unsolved static noise at Quadro T2000 bug).

It happens every single time the notebook is suspend/resumed.
Only in case BIOS/UEFI setting “Only Descrete Graphics” is enabled it works.

Yes, when disconnecting the display from the dock when in repro state, the external monitor is detected again.

Yes, when disconnecting the display from the display when in repro state, the external monitor is also detected again.

So far point 3 and 4 and disconnecting/reconnecting the dock itself are the only “workarounds” until next suspend/resume cycle.

I have now also checked this the following way:
complete fresh install of the system:
System: Fedora 31 KDE spin. No Updates, disabled update-repo.
Kernel: 5.3.7-301
Installed earliest driver possible: Nvidia 435.21
Dock is authorised via boltctl

External Display is also NOT recognized after wake from sleep with driver 435.21

Find attached the bugreports:
Before Suspend/Sleep
nvidia-bug-report-f31-435.21-before.log.gz (92.9 KB)

After Suspend/Sleep:
nvidia-bug-report-f31-435.21-after.log.gz (94.9 KB)

Thanks for all the isolations.
I am still trying to repro issue locally but I have a feeling this issue is with dock.
Is it possible for you to log a case with Lenovo as well , meanwhile I will try my best to replicate it ASAP .

Sorry when asking again, but is your Thinkpad P1 Gen3 set to "Hybrid Graphics"?
BIOS Option: Tab Devices → Display → “Hybrid Graphics”

I would exclude an issue with the dock, since Suspend/Wake works flawlessly under Linux using the Nouveau driver
It also works without any issue under Windows 10
It also works when having set BIOS Option Devices → Display → “Discrete Graphics” with the Nvidia driver
It only does not work with the Nvidia driver when the BIOS Option Devices → Display → “Hybrid Graphics”

So the combination of Nvidia driver + Optimus + TB Dock + Suspend/Wake from Suspend is the issue.

Nevertheless, If I get the chance I will try another dock.

Display has been set as Hybrid Graphics on all the experiments done locally.

Thanks for the feedback about the BIOS settings.

May I ask, what do you think about the dock issue only with Nvidia driver in Optimus mode?
Meaning that the dock would be the issue vs a driver issue (like specific timing issue, Multi Stream Transport due to only affecting S3 with the DP hub in the dock, etc…)

I installed Windows 10 20H1 on ThinkPad P1 Gen 3 and upgraded dock firmware with the provided link.
Attached the image after the dock upgradation.

Later I installed Fedora 35 matching your config, graphic settings saved as Hybrid but not observed any issue post multiple suspend/resume cycles.
ThinkPad P1 Gen 3 + Quadro T1000 with Max-Q + Driver 515.43.04 + Fedora release 35 (Thirty Five) + kernel 5.17.11-200.fc35.x86_64 + ThinkPad Thunderbolt 3 Workstation Dock Gen 2 + BenQ EL2870U

I also performed force edid which was shared by you earlier but could not repro issue after multiple suspend/resume cycles.

ThinkPad P1 Gen 3 + Quadro T1000 with Max-Q + Driver 515.43.04 + Fedora release 35 (Thirty Five) + kernel 5.17.11-200.fc35.x86_64 + ThinkPad Thunderbolt 3 Workstation Dock Gen 2 + Lenovo Group Limited LEN P27u-10

dump-dp-aux-log (7.3 KB)
Can you please follow below steps with the help of attached utility and share logs.

  1. Enable the AUX logger in RM:
    echo ‘options nvidia NVreg_RegistryDwords=“RmEnableDpAuxlogger=0x10000001”’ > /etc/modprobe.d/nvidia.conf
  2. Reboot.
  3. Start X and log in as usual.
  4. In a terminal, run the attached dump-dp-aux-log program. Let it run in the background.
  5. Reproduce the problem.
  6. Run sudo nvidia-bug-report.sh
  7. Send the log to us.
  8. Don’t forget to remove /etc/modprobe.d/nvidia.conf when they’re done with it.

Steps 1, 2, and 8 might not be needed but doesn’t hurt.

Thanks for taking the time to update the dock. Loocks good.
Unfortunately I am currently running driver 510.68.02 since no newer version is available via rpmfusion so far.

I followed your instructions according to the list.
Please find the bug report attached.
nvidia-bug-report.log.gz (194.3 KB)

Thanks for sharing the information.
Looks like I am able to duplicate issue now with driver 510.68.02 but as soon as I upgraded driver to 515.43.04, I do not duplicate issue.
Can you please uninstall existing driver and install the latest one using .run installer file from below location.
https://us.download.nvidia.com/XFree86/Linux-x86_64/515.43.04/NVIDIA-Linux-x86_64-515.43.04.run

Finally, thank you for making the effort.
I had already doubts that my Laptop/graphics chip is somehow defect.

Could you already identify what exactly the problem is, and where it gets stuck?

I tried the Beta-Driver 515.43.04 from negativo17 and it seems that it works.
Nevertheless, I would say that it is very important to identify the problem and understand it in order to find a permanent and future-proof solution.

EDIT:

But this driver is too unstable for me. Firefox or Vivaldi often just hangs and does not load, etc.

What I said about the driver being unstable is actually not true. It is the same effect with Nouveau. I see the effect of not loading browser after resume from sleep while the dock is connected. Maybe it has something to do with the dock being connected (maybe the integrated Ethernet port)

In addition, I cannot update to 515.48.07, since Fedora 36 requires simpledrm which Nvidia driver does not support yet. The Rpmfusion driver has a patch for that, what I have read, to enable efifb. So far rpmfusion does not have the 515 in the pipeline yet.

With kernel 5.17.11 there is a patch that identifies a kernel parameter being set - nvidia-drm.modeset=1. if so it switches to old behaviour. I have just tried 515.48.07 with kernel 5.17.12 and the driver seems to work.

That sounds a great news, I was about to request you to try with out latest production release driver 515.48.07.
If I understood correctly, it solved the suspend/resume issue.
Please let me know if you think otherwise.

I experienced some glitches when going to suspend.
The System did go to sleep but woke immediately again. It only happend sporadicly, so not every time. I will check further and let you know.

By the way, do you also experience different QT scaling via the Dock compared to directly USB-C DP?
(Using F36 KDE spin). Symbols, Icons and fonts do not get scaled when having the monitor connected via the Dock. But they get scaled correctly when having the monitor directly connected via USB Type C DisplayPort.

I see this issue with almost if not all QT applications like KDE System Settings, Dolphin, Rstudio, KeePassXC, etc…

@amrits
question is still open:

do you also experience different QT scaling via the Dock compared to directly USB-C DP?
(Using F36 KDE spin). Symbols, Icons and fonts do not get scaled when having the monitor connected via the Dock. But they get scaled correctly when having the monitor directly connected via USB Type C DisplayPort.

I see this issue with almost if not all QT applications like KDE System Settings, Dolphin, Rstudio, KeePassXC, etc…