Crash on first start

Hello, since I bought my P50 5 years ago it has one problem with NVIDIA driver.

After the first boot, then I am launching any opengl application which is using internal nvidia card my laptop’s screen is freezing. If I turn it off and on (reboot has same effect) again it works without absolutely any issue as long as I want. If I reboot again it is ok again.

This happened with all driver versions and many different kernels. I am using debian unstable and periodically updating it.

In windows everything works without this problem.

I have two cards, mainly using intel, but sometimes launching heavier opengl applications.

This happened with both bumblebee and PRIME render offload (which I am doing now).

My config is a bit unusual as I have P50 with M1000M video card:
01:00.0 VGA compatible controller: NVIDIA Corporation GM107GLM [Quadro M1000M] (rev a2)

By freezing I mean that I can still turn it off almost properly, it reacts to power button which configured to shut down the system (not suspend), it is just X server completely frozen.

dmesg contains things like this:
Oct 30 01:33:29 p50-debian kernel: NVRM: GPU at PCI:0000:01:00: GPU-27efac4b-3646-2d51-e10b-33027f7cd2c6
Oct 30 01:33:29 p50-debian kernel: NVRM: Xid (PCI:0000:01:00): 31, pid=40434, Ch 00000010, intr 10000000. MMU Fault: ENGINE GRAPHICS GPCCLIENT_PROP_0 faulted @ 0x1_19780000. Fault is of type FAULT_PTE ACCESS_T>
Oct 30 01:33:29 p50-debian kernel: DMAR: DRHD: handling fault status reg 3
Oct 30 01:33:29 p50-debian kernel: DMAR: [DMA Read] Request device [01:00.0] PASID ffffffff fault addr 3333333000 [fault reason 06] PTE Read access is not set
Oct 30 01:33:29 p50-debian kernel: DMAR: DRHD: handling fault status reg 3
Oct 30 01:33:29 p50-debian kernel: DMAR: [DMA Read] Request device [01:00.0] PASID ffffffff fault addr 0 [fault reason 06] PTE Read access is not set
Oct 30 01:33:29 p50-debian kernel: DMAR: DRHD: handling fault status reg 3
Oct 30 01:33:29 p50-debian kernel: DMAR: [DMA Read] Request device [01:00.0] PASID ffffffff fault addr fdf07000 [fault reason 06] PTE Read access is not set
Oct 30 01:33:29 p50-debian kernel: NVRM: Xid (PCI:0000:01:00): 44, pid=40434, Ch 00000010, intr 10000000
Oct 30 01:33:51 p50-debian kernel: DMAR: DRHD: handling fault status reg 3
Oct 30 01:33:51 p50-debian kernel: DMAR: [DMA Read] Request device [01:00.0] PASID ffffffff fault addr b1f1000 [fault reason 06] PTE Read access is not set
Oct 30 01:33:51 p50-debian kernel: NVRM: Xid (PCI:0000:01:00): 31, pid=1857, Ch 00000009, intr 10000000. MMU Fault: ENGINE HOST0 HUBCLIENT_HOST faulted @ 0x1_001ef000. Fault is of type FAULT_INFO_TYPE_UNSUPPOR>
Oct 30 01:34:08 p50-debian kernel: NVRM: Xid (PCI:0000:01:00): 32, pid=1857, Channel ID 00000000 intr 00004000
Oct 30 01:34:08 p50-debian kernel: NVRM: Xid (PCI:0000:01:00): 32, pid=1857, Channel ID 00000000 intr 00004000
Oct 30 01:34:08 p50-debian kernel: NVRM: Xid (PCI:0000:01:00): 32, pid=1857, Channel ID 00000000 intr 00004000
Oct 30 01:34:08 p50-debian kernel: DMAR: DRHD: handling fault status reg 3
Oct 30 01:34:08 p50-debian kernel: DMAR: [DMA Read] Request device [01:00.0] PASID ffffffff fault addr b1f1000 [fault reason 06] PTE Read access is not set
Oct 30 01:34:08 p50-debian kernel: NVRM: Xid (PCI:0000:01:00): 31, pid=1857, Ch 00000009, intr 10000000. MMU Fault: ENGINE HOST0 HUBCLIENT_HOST faulted @ 0x1_001ef000. Fault is of type FAULT_INFO_TYPE_UNSUPPOR>
Oct 30 01:34:08 p50-debian kernel: DMAR: DRHD: handling fault status reg 3
Oct 30 01:34:08 p50-debian kernel: DMAR: [DMA Read] Request device [01:00.0] PASID ffffffff fault addr b1f1000 [fault reason 06] PTE Read access is not set
Oct 30 01:34:08 p50-debian kernel: NVRM: Xid (PCI:0000:01:00): 31, pid=1857, Ch 00000009, intr 10000000. MMU Fault: ENGINE HOST0 HUBCLIENT_HOST faulted @ 0x1_001ef000. Fault is of type FAULT_INFO_TYPE_UNSUPPOR>
Oct 30 01:34:08 p50-debian kernel: DMAR: DRHD: handling fault status reg 3
Oct 30 01:34:08 p50-debian kernel: DMAR: [DMA Read] Request device [01:00.0] PASID ffffffff fault addr b1f1000 [fault reason 06] PTE Read access is not set
Oct 30 01:34:08 p50-debian kernel: NVRM: Xid (PCI:0000:01:00): 31, pid=1857, Ch 00000009, intr 10000000. MMU Fault: ENGINE HOST0 HUBCLIENT_HOST faulted @ 0x1_001ef000. Fault is of type FAULT_INFO_TYPE_UNSUPPOR>
Oct 30 01:34:15 p50-debian kernel: NVRM: Xid (PCI:0000:01:00): 62, pid=1857, 0a7b(174c) 00000000 00000000
Oct 30 01:34:20 p50-debian kernel: DMAR: DRHD: handling fault status reg 3
Oct 30 01:34:20 p50-debian kernel: DMAR: [DMA Read] Request device [01:00.0] PASID ffffffff fault addr b1f1000 [fault reason 06] PTE Read access is not set
Oct 30 01:34:20 p50-debian kernel: NVRM: Xid (PCI:0000:01:00): 31, pid=1857, Ch 00000008, intr 10000000. MMU Fault: ENGINE HOST0 HUBCLIENT_HOST faulted @ 0x1_00011000. Fault is of type FAULT_INFO_TYPE_UNSUPPOR>
Oct 30 01:34:20 p50-debian kernel: DMAR: DRHD: handling fault status reg 3
Oct 30 01:34:20 p50-debian kernel: DMAR: [DMA Read] Request device [01:00.0] PASID ffffffff fault addr b1f1000 [fault reason 06] PTE Read access is not set
Oct 30 01:34:20 p50-debian kernel: NVRM: Xid (PCI:0000:01:00): 31, pid=1857, Ch 00000008, intr 10000000. MMU Fault: ENGINE HOST0 HUBCLIENT_HOST faulted @ 0x1_00011000. Fault is of type FAULT_INFO_TYPE_UNSUPPOR>
Oct 30 01:34:29 p50-debian kernel: nvidia-modeset: ERROR: GPU:0: Idling display engine timed out: 0x0000947d:0:0:466
Oct 30 01:34:33 p50-debian kernel: NVRM: Xid (PCI:0000:01:00): 56, pid=0, CMDre 00000000 00000088 0001000a 00000004 0000000e
Oct 30 01:34:33 p50-debian kernel: NVRM: Xid (PCI:0000:01:00): 56, pid=1857, CMDre 00000000 00000080 00000000 00000005 00001005
Oct 30 01:34:36 p50-debian kernel: nvidia-modeset: WARNING: GPU:0: Lost display notification (0:0x00000000); continuing.

or this:
Oct 28 01:01:38 p50-debian kernel: nvidia-modeset: WARNING: GPU:0: Lost display notification (0:0x00000000); continuing.
Oct 28 01:01:40 p50-debian kernel: nvidia-modeset: ERROR: GPU:0: Idling display engine timed out: 0x0000947d:0:0:966
Oct 28 01:01:42 p50-debian kernel: nvidia-modeset: ERROR: GPU:0: Idling display engine timed out: 0x0000927c:0:0:982
Oct 28 01:01:44 p50-debian kernel: nvidia-modeset: ERROR: GPU:0: Idling display engine timed out: 0x0000927c:1:0:982
Oct 28 01:01:46 p50-debian kernel: nvidia-modeset: ERROR: GPU:0: Idling display engine timed out: 0x0000927c:2:0:982

Or this:
Oct 31 23:19:25 p50-debian kernel: NVRM: Xid (PCI:0000:01:00): 13, pid=1868, Graphics MME Exception Type: MAX_INSTR_LIMIT
Oct 31 23:19:25 p50-debian kernel: NVRM: Xid (PCI:0000:01:00): 13, pid=1868, Graphics Exception: ESR 0x404490=0x80000010

Is there any chance to understand what is going on and fix this?