When my system freezes randomly it starts to slow down heavily and in the end it does not react anymore. I can provoke it pretty consistently, if I start Firefox alone (with many tabs open) and start playing a YouTube video. Switching workspaces may contribute. On the other hand, it also happened while I was only running VSCode. The higher the hardware usage, the higher the chance that it freezes.
Sometimes I can get into a terminal with ctrl+alt+f1 just before that point. I would then run htop and look at the system utilization. Nothing special except for the M_SIZE (VIRT) which is always very high for both programs (higher than my ram capacity) but my ram usage is still not even at 60-70 %. I even increased my swap file, so it is less likely that ram is the cause of the issue.
Using Mint's protocol viewer, I found out that every time it freezes, the following messages are saved:
nouveau 0000:01:00.0: msvld: init failed, -19
nouveau 0000:01:00.0: msvld: unable to load firmware data
nouveau 0000:01:00.0: Direct firmware load for nouveau/nva8_fuc084d failed with error -2
nouveau 0000:01:00.0: Direct firmware load for nouveau/nva8_fuc084 failed with error -2
So, I tried to install the proprietary nvidia-340 driver that was recommended by Mint's driver manager. It failed with a dpkg error, and the same happened after trying it with apt. I found this thread about Nvidia ending their support for this driver. Further down in the post, you can see that the current kernel version is 5.15.0-43, but I also tried installing the driver (using the driver manager from Mint) on version 5.4.0-122.
After that, I tried to fix the nouveau driver. From this answer, I went to nouveau/VideoAcceleration documentation page and tried the commands under the firmware section. It froze again, so I reverted the changes.
What can I do to stop it from freezing? In case you think it is an overheating issue, then I wonder why it would not unfreeze later on because the load reduces, and the CPU cooler gets quieter.
System info and more: https://pastebin.com/HMTLfrD3
Edit: I verified that the freezing is not related to RAM/swap usage.
apt search nvidia
(assuming you already ransudo apt update
)?