Install the CUDA version of torch, but get the ROCm version of torchvision

114 Views Asked by At

I used the official CUDA installation method provided by PyTorch when installing PyTorch and the corresponding cudatoolkit version, as follows:

# CUDA 11.1
pip install torch==1.10.0+cu111 torchvision==0.11.0+cu111 torchaudio==0.10.0 -f https://download.pytorch.org/whl/torch_stable.html

However, after installation, I found that torch is the CUDA version, but torchaudio is the ROCm version:

$ pip install torch==1.10.0+cu111 torchvision==0.11.0+cu111 torchaudio==0.10.0 -f https://download.pytorch.org/whl/torch_stable.html
Looking in links: https://download.pytorch.org/whl/torch_stable.html
Collecting torch==1.10.0+cu111
  Downloading https://download.pytorch.org/whl/cu111/torch-1.10.0%2Bcu111-cp39-cp39-linux_x86_64.whl (2137.6 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 GB 819.8 kB/s eta 0:00:00
Collecting torchvision==0.11.0+cu111
  Downloading https://download.pytorch.org/whl/cu111/torchvision-0.11.0%2Bcu111-cp39-cp39-linux_x86_64.whl (21.8 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 21.8/21.8 MB 5.6 MB/s eta 0:00:00
Collecting torchaudio==0.10.0
  Downloading https://download.pytorch.org/whl/rocm4.1/torchaudio-0.10.0%2Brocm4.1-cp39-cp39-linux_x86_64.whl (2.7 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.7/2.7 MB 5.8 MB/s eta 0:00:00
Requirement already satisfied: typing-extensions in .../anaconda3/envs/valor/lib/python3.9/site-packages (from torch==1.10.0+cu111) (4.9.0)
Requirement already satisfied: numpy in .../anaconda3/envs/valor/lib/python3.9/site-packages (from torchvision==0.11.0+cu111) (1.26.3)
Requirement already satisfied: pillow!=8.3.0,>=5.3.0 in .../anaconda3/envs/valor/lib/python3.9/site-packages (from torchvision==0.11.0+cu111) (10.2.0)
Installing collected packages: torch, torchvision, torchaudio
  Attempting uninstall: torch
    Found existing installation: torch 1.9.0+cu111
    Uninstalling torch-1.9.0+cu111:
      Successfully uninstalled torch-1.9.0+cu111
  Attempting uninstall: torchvision
    Found existing installation: torchvision 0.10.0+cu111
    Uninstalling torchvision-0.10.0+cu111:
      Successfully uninstalled torchvision-0.10.0+cu111
  Attempting uninstall: torchaudio
    Found existing installation: torchaudio 0.9.0
    Uninstalling torchaudio-0.9.0:
      Successfully uninstalled torchaudio-0.9.0
Successfully installed torch-1.10.0+cu111 torchaudio-0.10.0+rocm4.1 torchvision-0.11.0+cu111

Is this ROCm version torchaudio on a NVIDIA GPU (and cuda version of pytorch) compatible?
Is there a solution to get a cuda version torchaudio?
Or does torchaudio only have the ROCm version and not a CUDA version? If not, why is the default torchaudio version for PyTorch's wheel installation method ROCm? Thank you!

0

There are 0 best solutions below