Hi All,
I am trying to install PyTorch on an ARM CORTEX A9 (32-bit, ARMv7-A Architecture). However, during installation, I face an out of memory issue, stating that the virtual memory is exhausted.
The steps I followed for installation are:

Update packages: sudo apt-get update && sudo apt-get upgrade
Create SWAP partition:
2.1) sudo dd if=/dev/zero of=/swapfile bs=1M count=4000 (I have built-in 512Mb RAM)
2.2) sudo mkswap swapfile
2.3) sudo swapon swapfile
2.4) sudo nano etc/fstab
2.5) Added this line: /swapfile none swap sw 0 0
sudo apt-get install libopenblas-dev cython3 libatlas-dev m4 libblas-base-dev cmake
pip3 install --user pyyaml numpy
git clone --recursive https://github.com/pytorch/pytorch 13

cd pytorch
git checkout tags/v0.4.0 -b build
git submodule update --init --recursive
export NO_CUDA=1
export NO_DISTRIBUTED=1
python3 setup.py build

During the build, process goes further than 100%, performing GCC builds, where I get (Highlights only):
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/home/xilinx/pytorch -I/home/xilinx/pytorch/torch/csrc -I/home/xilinx/pytorch/third_party/pybind11/include -I/home/xilinx/pytorch/torch/lib/tmp_install/include -I/home/xilinx/pytorch/torch/lib/tmp_install/include/TH -I/home/xilinx/pytorch/torch/lib/tmp_install/include/THNN -I/home/xilinx/pytorch/torch/lib/tmp_install/include/ATen -I/root/.local/lib/python3.6/site-packages/numpy/core/include -I/usr/local/include/python3.6m -c torch/csrc/jit/generated/aten_dispatch.cpp -o build/temp.linux-armv7l-3.6/torch/csrc/jit/generated/aten_dispatch.o -D_THP_CORE -std=c++11 -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-write-strings -Wno-zero-length-array -fno-strict-aliasing -Wno-missing-braces -DWITH_NUMPY
torch/csrc/jit/interned_strings.cpp: In constructor ‘torch::jit::InternedStrings::InternedStrings()’:
torch/csrc/jit/interned_strings.cpp:78:3: note: variable tracking size limit exceeded with -fvar-tracking-assignments, retrying without
InternedStrings()
^
cc1plus: out of memory allocating 2274304 bytes after a total of 30859264 bytes
In file included from /home/xilinx/pytorch/torch/csrc/THP.h:34:0,
from torch/csrc/autograd/python_function.cpp:10:
torch/csrc/autograd/python_function.cpp: In function ‘PyObject* THPFunction_do_backward(THPFunction*, PyObject*)’:
torch/csrc/autograd/python_function.cpp:822:55: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
THPUtils_assert(PyTuple_GET_SIZE(raw_grad_output) == self->cdata.num_inputs(),
^
/home/xilinx/pytorch/torch/csrc/utils.h:21:45: note: in definition of macro ‘THP_EXPECT’
#define THP_EXPECT(x, y) (__builtin_expect((x), (y)))
^
/home/xilinx/pytorch/torch/csrc/utils.h:119:36: note: in expansion of macro ‘THPUtils_assertRet’
#define THPUtils_assert(cond, …) THPUtils_assertRet(NULL, cond, VA_ARGS)
^
torch/csrc/autograd/python_function.cpp:822:5: note: in expansion of macro ‘THPUtils_assert’
THPUtils_assert(PyTuple_GET_SIZE(raw_grad_output) == self->cdata.num_inputs(),
^
At global scope:
cc1plus: warning: unrecognized command line option ‘-Wno-zero-length-array’
virtual memory exhausted: Cannot allocate memory
error: command ‘gcc’ failed with exit status 1
Note that I have Python 3.6.5 and GCC 5.3.0