Can you solve Nvidia problem?

Hello, I have dual boot Lenovo Anniversary Edition 25 laptop.
I have dual boot, Windows 10 and Ubuntu 20.10 (I had the same problem on 20.04).

When I restart from Windows with external monitor connected the laptop freezes during Ubuntu boot. And I must use hard switch off and hold it long. When I disconnect external monitor before, it is working. I use nvidia-driver-450 (not free).

Is there any way to solve the problem? Thank you.

jiricvrk@jc-TP25:~/Stažené$ nvidia-smi 
Thu Dec  3 11:02:10 2020       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 450.80.02    Driver Version: 450.80.02    CUDA Version: 11.0     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  GeForce 940MX       Off  | 00000000:02:00.0 Off |                  N/A |
| N/A   49C    P0    N/A /  N/A |    161MiB /  2004MiB |      4%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      4458      G   /usr/lib/xorg/Xorg                 88MiB |
|    0   N/A  N/A      4650      G   /usr/bin/gnome-shell               66MiB |
|    0   N/A  N/A      4952      G   ...gAAAAAAAAA --shared-files        3MiB |
+-----------------------------------------------------------------------------+