In Windows 10, my computer has NVIDIA driver 456.71 and I installed PyTorch using
conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch
Then, I checked whether PyTorch used CUDA by typing the followings:
And it returned
It’s pretty weird to me because I’ve heard that we need to install both NVIDIA drivers and CUDA to use GPUs.
Thus, my question is: Can I use PyTorch and GPU-enabled training and testing without manually installing CUDA for Windows?
@hjung although you are getting
torch.cuda.is_available(), without underlying nvidia drivers you will be unable to use it for tensor operations
There is an older thread discussing the same thing
Can I simply go to pytorch website and use the following link to download a CUDA enabled pytorch library ? Or do i have to set up the CUDA on my device first, before installing the CUDA enabled pytorch ?
pip3 install torch===1.3.0 torchvision===0.4.1 -f https://download.pytorch.org/whl/torch_stable.html
@anantguptadbl From the link, it seems that the PyTorch installation command includes the CUDA , which I think is sufficient to use use GPUs for training and testing. Thus, we do not need to install manually CUDA for Windows. runtime
Could you (or anyone) please correct me if I am wrong?
No CUDA toolkit will be installed using the current binaries, but the CUDA runtime, which explains why you could execute GPU workloads, but not build anything from source.
Yes, you are right and don’t need to install a local CUDA toolkit (just the drivers) unless you want to build PyTorch from source or a custom CUDA extension.