Which version of pytorch and python is compatible with cuda 11.4

I want to use GPU to train my model.
This is my version of NVIDIA driver and CUDA

I installed the newest version of pytorch with python 3.10, pytorch could not use with GPU.
I tried to install pytorch=1.12.1 witt python 3.8.
Pytorch could connect with GPU.
But when i ran my code, i got below error.

RuntimeError: CUDA error: no kernel image is available for execution on the device
CUDA kernel errors might be asynchronously reported at some other API call,so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1.

Which version of pytorch, python are compatible with cuda 11.4