boot – Stuck on loading screen with Nvidia 455 drivers after trying to enable Prime sync

initially everything worked “fine”. I had screen tearing. In an attempt to fix the screen tearing I searched online and found a solution (the first solution) in which I had to run this in a terminal:

xrandr --output eDP-1-1 --set "PRIME Synchronization" 1

I tried it and it did not fix my screen tearing. I also suspect this command to somehow prevent my computer to boot normally when using any Nvidia drivers. What happens is that after the initial splash screen and the rotating animation (I’m on Ubuntu 20.04), the animation just stops and the screen stays stuck on my computer’s logo with the “Ubuntu” text under it.

I tried booting in recovery mode and running

sudo apt-get purge nvidia*

which did work. The only problem with it is that it only uses my computers integrated graphics and not Mx150 (which is better). Then as soon as I reinstall any nvidia drivers and set the prime profile to something else than “Intel (Power saving mode)” the problems comes back.

As you might have already guessed, I’m not an advanced Ubuntu user, but my guess is that this command affected a config file which I would need to change in order to fix the problem ?

Otherwise, what can I do to fix Nvidia’s drivers anyway ?

So my question is : How do I fix this mess ?

Thanks in advance for your help 🙂

(Please excuse my language mistakes as English is not my primary language)