NVIDIA GeForce RTX 5090 with CUDA capability sm_120 is not compatible with the current PyTorch installation

Check which kernel fails to run via:

cuda-gdb --args python script.pt
set cuda api_failures stop
...
r
...
bt

which would show the failing kernel. Assuming you are able to run PyTorch native kernels in this environment, the failing kernel could come from a 3rd party library which does not support your Blackwell GPU yet.
As a quick smoke test you can run: python -c "import torch; x = torch.randn(64, 64, device='cuda'); print(torch.matmul(x, x))"