In a Ubuntu 22.04 with Ryzen 5600X, Nvidia RTX 3080 with nividia-550 driver (with Cuda 12.4 installed), the following command, inside a conda (in my case a mamba) environment solved this problem
pip3 install torch torchvision torchaudio