2. Hack pip for Ubuntu 18.0
Edit file ‘/usr/bin/pip’
diff --git a/pip b/pip
index 56bbb2b..62f26b9 100755
--- a/pip
+++ b/pip
@@ -6,6 +6,6 @@ import sys
# Run the main entry point, similarly to how setuptools does it, but because
# we didn't install the actual entry point from setup.py, don't use the
# pkg_resources API.
-from pip import main
+from pip import __main__
if __name__ == '__main__':
- sys.exit(main())
+ sys.exit(__main__._main())
3. Prepare PyTorch Source
$ git clone http://github.com/pytorch/pytorch
$ cd pytorch
Apply CUDA 10.0 patch
diff --git a/caffe2/utils/GpuDefs.cuh b/caffe2/utils/GpuDefs.cuh
index cf54f9e85..c69fcd38c 100644
--- a/caffe2/utils/GpuDefs.cuh
+++ b/caffe2/utils/GpuDefs.cuh
@@ -8,7 +8,7 @@ namespace caffe2 {
// Static definition of GPU warp size for unrolling and code generation
#ifdef __CUDA_ARCH__
-#if __CUDA_ARCH__ <= 700
+#if __CUDA_ARCH__ <= 730
constexpr int kWarpSize = 32;
#else
#error Unknown __CUDA_ARCH__; please define parameters for compute capability
I tried to use this source, it showed error:
nvidia@tegra-ubuntu:~/Downloads/pytorch-master$ python setup.py build_deps
fatal: Not a git repository (or any of the parent directories): .git
Building wheel torch-1.0.0a0
running build_deps
setup.py::build_deps::run()
SYNC_COMMAND=cp
++ command -v rsync
‘[’ -x /usr/bin/rsync ‘]’
SYNC_COMMAND=‘rsync -lptgoD’
USE_CUDA=1
USE_ROCM=0
USE_NNPACK=0
USE_MKLDNN=0
USE_GLOO_IBVERBS=0
CAFFE2_STATIC_LINK_CUDA=0
RERUN_CMAKE=0
[[ 8 -gt 0 ]]
case “$1” in
USE_CUDA=1
shift
[[ 7 -gt 0 ]]
case “$1” in
USE_NNPACK=1
shift
[[ 6 -gt 0 ]]
case “$1” in
break
CMAKE_INSTALL=‘make install’
BUILD_SHARED_LIBS=ON
USER_CFLAGS=
USER_LDFLAGS=
[[ -n ‘’ ]]
[[ -n ‘’ ]]
[[ -n ‘’ ]]
++ uname
‘[’ Linux == Darwin ‘]’
+++ dirname …/tools/build_pytorch_libs.sh
++ cd …/tools/…
+++ pwd
++ printf ‘%q\n’ /home/nvidia/Downloads/pytorch-master
make install -j6
make: *** No rule to make target ‘install’. Stop.
Failed to run ‘bash …/tools/build_pytorch_libs.sh --use-cuda --use-nnpack nccl caffe2 libshm gloo c10d THD’
Hi @AastaLL I am using CUDA version 10 but on Start Locally | PyTorch website there is no version available for CUDA 10. What should I do ? please guide me. Thanks
I tried to use the .whl to install PyTorch but I’m still running into issues. I just flashed my Jetson Xavier with JetPack-L4T-4.1.1-linux-x64_b57.run. I installed python3.6 with
sudo apt-get python3-pip
. I then downloaded the Python3.6 whl from comment #18 and ran
which ran without any issues. Now when I start an instance of python and import torch, I get the following error:
python3
Python 3.6.7 (default, Oct 22 2018, 11:32:17)
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/nvidia/.local/lib/python3.6/site-packages/torch/__init__.py", line 84, in <module>
from torch._C import *
ImportError: libtorch.so.1: cannot open shared object file: No such file or directory