[SOLVED] What is causing my new pc to crash?

Jan 27, 2020
2
0
10
So I built a new pc and it has been crashing when playing certain games almost always when launching them. for example when loading a match in BF5 or COD MW. It also crashes sometimes mid game, but some games are ok and run fine. I have re-installed drivers, updated BIOS, ran only 1 monitor. Bench marking is fine. Oh and it crashes and shuts off the computer completely, not rebooting by itself I have to manually. But not all the time, when it crashes mid game, for example when playing MHW it only crashes the game, and says "graphics device has failed"
Specs:
gigabyte 5700 xt
Ryzen 7 3800x
gigabyte x570 gaming x
g.skill Trident z 16 gb rgb
EVGA supernova NEX750B
I honestly have no idea what the problem is, although I suspect the gpu is simply defective and I should send in for replacement. What do you guys think?