I followed: https://etiennemueller.github.io/razer-blade-data-science/
Basically to fix the suspend loop with:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash button.lid_init_state=open"
It needs kernel 5.11.0 (I tried higher and lower versions and nothing worked as of 26/07/2021).
You can install it with:
# Install the mainline tool that allows to install kernels easily
sudo add-apt-repository ppa:cappelikan/ppa
sudo apt install mainline
mainline --install 5.11.0
Reboot and choose Advanced > Boot on the 5.11.0 kernel.
You may want to use grub-customizer
to force your system to always boot with this kernel.
I made it work by installing nvidia-driver-470
from the graphics driver ppa:
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get install nvidia-driver-470
Optionally, allow to use the intel card for non-gpu intensive tasks:
sudo prime-select on-demand
Reboot.