Pytorch安装1.9.1+cuda11.1
pip install torch==1.9.1+cu111 torchvision==0.10.1+cu111 torchaudio==0.9.1 -f https://download.pytorch.org/whl/torch_stable.html --trusted-host pypi.org --trusted-host download.pytorch.org --trusted-host files.pythonhosted.org
import torch
print(torch.cuda.is_available()) # cuda是否可用
print(torch.cuda.current_device()) # 返回当前设备索引
print(torch.cuda.device_count()) # 返回GPU的数量
print(torch.cuda.get_device_name(0))