A guide to "prevent" tearing on Optimus laptop (nothing here is guaretee to work).
These args can be used on Lutris or on Flatseal for flatpaks. it works also in softwares if you add these lines before.
DRI_PRIME=pci-0000_01_00_0
__VK_LAYER_NV_optimus=NVIDIA_only
__GLX_VENDOR_LIBRARY_NAME=nvidia
You can also add this line to gamemode if you want to use the GPU when gamemode is in use.
in /etc/environment
GAMEMODERUNEXEC="env __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia __VK_LAYER_NV_optimus=NVIDIA_only"
This might help the driver to be a bit less laggy.
In /etc/modprobe.d/nvidia-graphics-drivers.conf
add options nvidia-drm modeset=1
Then update initramfs :
On some distro : sudo update-initramfs -u
On fedora : sudo dracut --force
On Silverblue : rpm-ostree initramfs-etc --force-sync
Go in the Nvidia Settings application
Then go to application profile and click on the + icon :
Select Always applie and new profile
Add GLSyncToVblank and set it to true
if you have GSYNC also add GLGSYNCAllowed and set it to true.
Save everything with the plus and I would recomand to reboot.
Just edit in /etc/gdm/custom.conf
and uncomment #WaylandEnabled=false
and set it to true