NLinker

Install procedure for Pytorch for CUDA 10

Oct 26th, 2018
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.33 KB | None | 0 0
  1. # do all the stuff in the local environment
  2. virtualenv -p python3 venv
  3. source venv/bin/activate
  4.  
  5. # clone pyTorch repo
  6. git clone http://github.com/pytorch/pytorch
  7. cd pytorch
  8. git submodule update --init
  9.  
  10. # install prereqs
  11. sudo pip install -U setuptools
  12. sudo pip install -r requirements.txt
  13.  
  14. # develop mode:
  15. python setup.py build_deps
  16. python setup.py develop
  17.  
  18. # OR install mode
  19. python setup.py install
  20.  
  21. #### verify it ###
  22. # (venv) ~/t ❯❯❯ python
  23. # Python 3.6.6 (default, Sep 12 2018, 18:26:19)
  24. # [GCC 8.0.1 20180414 (experimental) [trunk revision 259383]] on linux
  25. # Type "help", "copyright", "credits" or "license" for more information.
  26. # >>> import torch
  27. # >>> print(torch.__version__)
  28. # 1.0.0a0+9cb4bce
  29. # >>> print(torch.cuda.is_available())
  30. # True
  31. # >>> a = torch.cuda.FloatTensor(2)
  32. # /home/nick/tf-test/pytorch/torch/cuda/__init__.py:117: UserWarning:
  33. #     Found GPU0 GeForce GTX 660M which is of cuda capability 3.0.
  34. #     PyTorch no longer supports this GPU because it is too old.
  35. #    
  36. #   warnings.warn(old_gpu_warn % (d, name, major, capability[1]))
  37. # >>> print(a)
  38. # tensor([-1.9131e-37,  1.7738e-18], device='cuda:0')
  39. # >>> b = torch.randn(2).cuda()
  40. # >>> print(b)
  41. # tensor([-0.7758, -0.4208], device='cuda:0')
  42. # >>> c = a + b
  43. # >>> print(c)
  44. # tensor([-0.7758, -0.4208], device='cuda:0')
  45. # >>>
Add Comment
Please, Sign In to add comment