← Back to Scratch Pad

Installing PyTorch with Cuda 11.7

conda install pytorch torchvision torchaudio pytorch-cuda=11.7 -c pytorch -c nvidia

 

 

pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu117

Download Cuda 11.7 from CUDA Toolkit 11.7 Downloads | NVIDIA Developer

Check if the GPU is available to PyTorch

>>> import torch
>>> torch.cuda.is_available()
True
>>> torch.cuda.device_count()
1
>>> torch.cuda.current_device()
0
>>> torch.cuda.get_device_name(0)
'NVIDIA GeForce RTX 2080 Ti'