Old PyTorch version for new GPU

Hi,
I’m currently trying to install a library which requires torch==1.5. I’m using a Nvidia RTX 4090 GPU and when I run nvidia-smi: cuda is 12.2
nvcc --version: release 11.5

However, when I try to run Torch with the library I get:
RuntimeError: CUDA error: no kernel image is available for execution on the device

Is there anything I can do?

Cou could try to cherry-pick all needed commits for CUDA updates into your local PyTorch 1.5 version and build it from source afterwards. However, it sounds cumbersome and could easily fail if you are missing some important changes so I would recommend updating your script instead to be compatible with the latest PyTorch release.

Thank you, will try that.

I am also having some troubles using it with Torch==1.13.1. Is my GPU not supported in this version, or would it help if I try to downgrade Cuda?

Thank you for your help.

It depends which PyTorch binary you are installing as you would need CUDA 11.x and the binaries must be built with sm_86+.