I've been searching for weeks and can't find any solution. Either right when I launch a game or shortly after, both monitors go black and for a few seconds. The only error info I can find is windows saying display drivers "stopped and recovered." I've also discovered that it happens only when the GPU is at max clock speed (1405 for the XFX RX 580) and when I overclock or under clock, the crash still happens at whatever I set the clock speed to.
Motherboard: Asus B450m-a
CPU: Ryzen 5 2600
RAM: Corsair Vengeance 16gb 3000mhz
SSD: Samsung 860 EVO 500gb
PSU: EVGA 700b
Occasionally crashes while not gaming as well, even happened while typing this post. I have reinstalled drivers multiple times, messed with wattman settings, reinstalled windows, updated the bios, and RMA'd the card. Nothing makes a difference. I am out of ideas and a little pissed off.
Edit: Still afraid to get my hopes up at this point, but it seems like the issue was with the RAM the whole time. After more troubleshooting, I ended up trying each ram stick by itself. One of them still crashed but then the second one worked fine. I played off and on all night and have yet to experience a crash. I will try an RMA on the second stick, but everything works fine with 8gb of ram for now!