Question Pc crashes when installing gpu drivers

Nov 14, 2020
Recently my power supply started acting up (randomly stop giving power to hard drives or gpu), I changed it and everything back to normal. But 2 days ago the gpu started flickering or freezing the image on one screen and weird lines in the other, last time this happened I reboot the computer and right after the windows loading logo it went to a black screen, mouse lights turned off and keyboard lights won't turn on or off.
What I've tried:
-Uninstalling drivers using ddu while on the o board gpu. Switched back to external gpu without the drivers and all works fine, but when I want to install drivers it crashes the same way (black screen, m and kb unresponsive) right after the screen flickers for the second time.

-installing older driver version. Same as above.

-installing driver while onboard gpu. Same as above. The installation completes too quickly.

-refreshing, upgrading or downgrading the gpu bios. While in the same or older bios version the issue persists. With a newer bios version the driver installation completes and the system boots normally. The driver appears as installed but the performance in games is the same as if it wasn't installed. The display adapter appears with a yellow exclamation mark in device manager.

The gpu in question is an Msi r7870 2gb.