Hello, I am really new to Ubuntu and Linux in general.
Recently (I don't know if it's connected to some sort of software updates) I experience some strange issues.
Sometimes I leave my laptop locked for a while (between 20 minutes and an hour) and when I come back it has already loaded some sort of kernel (I've read about panic kernels but I don't know if that's the case).
It's really annoying since I cannot go back to my work and I have to reboot manually because I cannot type any commands or perform any actions whatsoever. Because of that I cannot show you the exact output but last time I saw that the last line said:

interrupt took too long(2505 > 2500) lowering kernel.perf_even_max_sample_rate to 79750 (I've read it had something to do with CPU performance).

On the upper lines there was something about packages involved. I also saw "nvidia" in a few lines. With previous versions I've had issues with nvidia drivers but after a fresh install of 20.04.3 LTS I am using the recommended one and I've had no issues so far (or at least I thought so).
First visible lines said something about RAX, RDX, RBP.

I would really love to have some advise because it's really frustrating to have to reboot my system every time this happens.

P.S. I am not completely sure that it doesn't happen only after I unplug my charger (not immediately, like I said it takes from 20 minutes to 1 hour).

Please HELP!

I am using an Asus laptop with this configuration:

Intel® Core™ i7-7500U CPU @ 2.70GHz × 4
NVIDIA Corporation GM108M [GeForce 940MX] / NVIDIA GeForce 940MX/PCIe/SSE2