Gpu keeps shutting off

That would unload all nvidia modules which doesn’t work due to the running xserver.
sudo rmmod nvidia-uvm
sudo modprobe nvidia-uvm
after resume should work as long as no application is running that’s using cuda.