I have a problem Radeon RX 7900 XTX

Hello, I have a problem. Please, help. I’m using amd 7900 xtx.
When I start training after 1-2 hours the training process stops randomly. Without any error. Afterwards I tried the following:
When I run torch.cuda.is_available() I get the result true.
When I run print(torch.cuda.get_device_name()) I get a Radeon RX 7900 XTX.
When I run torch.randn(1,2) nothing happens. hangs without response.

After rebooting the computer everything works. But the problem keeps recurring.

Then I tried using nvidia rtx 2060 super with the same code. I don’t see any problems.

For amd I use rocm5.7 and PyTorch Stable (2.2.1)

I can send you my code