Newbie question: What are the prerequisites for running PyTorch with GPU?
Hi everyone, I’m new to deep learning libraries, so apologies in advance if this is something I’m already supposed to know. I’ve used Theano before but guides for setting up the GPU there were very straightforward, also I was doing this using a WinPy instance on Windows. I come from a MATLAB background where I’m used to being able to play around with the variables and initialize things quickly, so naturally I felt like PyTorch may have more to offer. But there isn’t that much documentation on how to set things up from scratch with PyTorch. I have Anaconda installed on Ubuntu and have tried the basic functionality of PyTorch that way, but I’m not sure how to get it working with CUDA. Any advice would be appreciated!
yenson-lau
moskomule
if you want to use pytorch with an NVIDIA GPU, all you need to do is install pytorch binaries and start using it. We ship with everything in-built (pytorch binaries include CUDA, CuDNN, NCCL, MKL, etc.). So it’s a one-touch install: Install pytorch from binaries ( http://pytorch.org 1.2k has instructions) Try a simple program with CUDA: <SCODE>import torch
a = torch.randn(10).cuda()
print(a)
print(a + 2)
<ECODE>
smth
moskomule
<SCODE>a = torch.randn(10).cuda()
<ECODE> Just to make sure, I updated Pytorch with my Anaconda installation via the following <SCODE>conda install pytorch torchvision cuda80 -c soumith
<ECODE> Thanks again for the support!
yenson-lau
yenson-lau
Yup. You have to first do the CUDA binaries installation. if the above lines return True then you have Cuda working else not.
Sriharsha_Sammeta
Dhruvrnaik