Looking for correct version of pytorch for RTX 4090, CUDA 12.2

This is my pytorch version and my GPU is “NVIDIA GeForce RTX 4090”

When I try to train my model, Kernel dies with the below output
C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\native\cuda\IndexKernel.cu:93: block: [62,0,0], thread: [115,0,0] Assertion index >= -sizes[i] && index < sizes[i] && "index out of bounds" failed.
Need help !!

The error message points towards an indexing error and is unrelated to the used PyTorch binary.
Narrow down the failing indexing operation and fix it.

Yes, indeed it was.
Fixed it. Thanks.

How to build pytorch-cuda=12.2 ? my GPU is NVIDIA GeForce RTX 4090 and I have nvidia toolkit 12.2 installed on my windows 11.

You would need to build from source using your locally installed CUDA toolkit. Alternatively, you can download the nightly binaries using CUDA 12.1 Update1.

Thank you. I couldn’t find the nightly build for 12.2.