@@ -21,14 +21,14 @@ $ docker run --rm -it -v ${PWD}:/work pytorch4raspberrypi /bin/bash
21
21
# cp /wheels/* work
22
22
# exit
23
23
24
- $ sudo chmod -R 777 *.whl
24
+ $ sudo chmod -R 777 *.whl
25
25
```
26
26
## 2-2. [ Method 2] Manual build
27
27
```
28
28
$ docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
29
29
$ docker run --rm -it \
30
30
-v ${PWD}:/workdir \
31
- pinto0309/raspios_lite_armhf:2021-03-04_buster \
31
+ pinto0309/raspios_lite_armhf:2022-02-10_bullseye \
32
32
/bin/bash
33
33
```
34
34
All of the following operations were performed on a RaspberryPi OS armv7l 32-bit Docker container running on Ubuntu 20.04 x86_64.
@@ -38,56 +38,51 @@ All of the following operations were performed on a RaspberryPi OS armv7l 32-bit
38
38
# apt-get update && apt-get install -y \
39
39
openjdk-11-jdk automake autoconf libpng-dev nano \
40
40
curl zip unzip libtool swig zlib1g-dev pkg-config git wget xz-utils \
41
- libopenblas-dev libblas-dev m4 cmake cython python3-dev python3-yaml \
41
+ libopenblas-dev libblas-dev m4 cmake python3-dev python3-yaml \
42
42
python3-setuptools python3-pip python3-mock \
43
- libpython3-dev libpython3-all-dev g++ gcc
43
+ libpython3-dev libpython3-all-dev g++ gcc libatlas-base-dev \
44
+ libtbb-dev sox libsox-dev
44
45
45
- # pip3 install numpy==1.19.5
46
- or
47
- # pip3 install numpy==1.21.2
46
+ # pip3 install pip --upgrade
47
+ # pip3 install cython==0.29.27 numpy==1.22.2 cmake==3.21.2 ninja==1.10.2.3 typing_extensions==4.0.1
48
48
49
- # pip3 install -U six wheel mock cmake && ldconfig
49
+ # pip3 install -U six wheel mock && ldconfig
50
50
51
- # NO_CUDA=1 \
52
- && NO_DISTRIBUTED=1 \
53
- && NO_MKLDNN=1 \
54
- && USE_NCCL=0 \
55
- && BUILD_TEST=0 \
56
- && TORCH=v1.9.0 \
57
- && TORCHVISION=v0.10.0 \
58
- && TORCHAUDIO=v0.9.0
51
+ # TORCH=v1.10.2 \
52
+ && TORCHVISION=v0.11.3 \
53
+ && TORCHAUDIO=v0.10.2
59
54
60
55
# git clone -b ${TORCH} https://github.com/pytorch/pytorch.git
61
56
62
57
# cd pytorch \
63
58
&& git submodule update --init --recursive \
64
59
&& pip3 install -r requirements.txt \
65
- && python3 setup.py build \
66
- && cd build/lib.linux-armv7l-3.7 /torch \
67
- && ln -s _C.cpython-37m -arm-linux-gnueabihf.so _C.so \
68
- && ln -s _dl.cpython-37m -arm-linux-gnueabihf.so _dl.so \
60
+ && NO_CUDA=1 NO_DISTRIBUTED=1 NO_MKLDNN=1 USE_NCCL=OFF USE_XNNPACK=OFF USE_TBB=ON BUILD_TEST=OFF python3 setup.py build \
61
+ && cd build/lib.linux-armv7l-3.9 /torch \
62
+ && ln -s _C.cpython-39 -arm-linux-gnueabihf.so _C.so \
63
+ && ln -s _dl.cpython-39 -arm-linux-gnueabihf.so _dl.so \
69
64
&& cd ../../..
70
65
# python3 setup.py bdist_wheel
71
66
72
67
-- ******** Summary ********
73
68
-- General:
74
69
-- CMake version : 3.21.2
75
- -- CMake command : /usr/local/lib/python3.7 /dist-packages/cmake/data/bin/cmake
70
+ -- CMake command : /usr/local/lib/python3.9 /dist-packages/cmake/data/bin/cmake
76
71
-- System : Linux
77
72
-- C++ compiler : /usr/bin/c++
78
73
-- C++ compiler id : GNU
79
- -- C++ compiler version : 8.3.0
74
+ -- C++ compiler version : 10.2.1
80
75
-- Using ccache if found : ON
81
76
-- Found ccache : CCACHE_PROGRAM-NOTFOUND
82
- -- CXX flags : -Wno-deprecated -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -DUSE_KINETO -DLIBKINETO_NOCUPTI -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -O2 -fPIC -Wno-narrowing -Wall -Wextra -Werror=return-type -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-unused-result -Wno-unused-local-typedefs -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-stringop-overflow -Wno-psabi -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -fdiagnostics-color=always -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Werror=format -Werror=cast-function-type -Wno-stringop-overflow
77
+ -- CXX flags : -Wno-deprecated -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -DUSE_KINETO -DLIBKINETO_NOCUPTI -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -DEDGE_PROFILER_USE_KINETO -O2 -fPIC -Wno-narrowing -Wall -Wextra -Werror=return-type -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-unused-result -Wno-unused-local-typedefs -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-stringop-overflow -Wno-psabi -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -fdiagnostics-color=always -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Werror=format -Werror=cast-function-type -Wno-stringop-overflow
83
78
-- Build type : Release
84
79
-- Compile definitions : ONNX_ML=1;ONNXIFI_ENABLE_EXT=1;ONNX_NAMESPACE=onnx_torch;HAVE_MMAP=1;_FILE_OFFSET_BITS=64;HAVE_SHM_OPEN=1;HAVE_SHM_UNLINK=1;HAVE_MALLOC_USABLE_SIZE=1;USE_EXTERNAL_MZCRC;MINIZ_DISABLE_ZIP_READER_CRC32_CHECKS
85
- -- CMAKE_PREFIX_PATH : /usr/lib/python3.7 /site-packages
80
+ -- CMAKE_PREFIX_PATH : /usr/lib/python3.9 /site-packages
86
81
-- CMAKE_INSTALL_PREFIX : /pytorch/torch
87
82
-- USE_GOLD_LINKER : OFF
88
- --
89
- -- TORCH_VERSION : 1.9 .0
90
- -- CAFFE2_VERSION : 1.9 .0
83
+ --
84
+ -- TORCH_VERSION : 1.10 .0
85
+ -- CAFFE2_VERSION : 1.10 .0
91
86
-- BUILD_CAFFE2 : ON
92
87
-- BUILD_CAFFE2_OPS : ON
93
88
-- BUILD_CAFFE2_MOBILE : OFF
98
93
-- Link local protobuf : ON
99
94
-- BUILD_DOCS : OFF
100
95
-- BUILD_PYTHON : True
101
- -- Python version : 3.7.3
96
+ -- Python version : 3.9.2
102
97
-- Python executable : /usr/bin/python3
103
- -- Pythonlibs version : 3.7.3
104
- -- Python library : /usr/lib/libpython3.7m .so.1.0
105
- -- Python includes : /usr/include/python3.7m
106
- -- Python site-packages: lib/python3.7 /site-packages
98
+ -- Pythonlibs version : 3.9.2
99
+ -- Python library : /usr/lib/libpython3.9 .so.1.0
100
+ -- Python includes : /usr/include/python3.9
101
+ -- Python site-packages: lib/python3.9 /site-packages
107
102
-- BUILD_SHARED_LIBS : ON
108
103
-- CAFFE2_USE_MSVC_STATIC_RUNTIME : OFF
109
- -- BUILD_TEST : True
104
+ -- BUILD_TEST : False
110
105
-- BUILD_JNI : OFF
111
106
-- BUILD_MOBILE_AUTOGRAD : OFF
112
107
-- BUILD_LITE_INTERPRETER: OFF
113
- -- INTERN_BUILD_MOBILE :
108
+ -- INTERN_BUILD_MOBILE :
114
109
-- USE_BLAS : 1
115
110
-- BLAS : open
116
111
-- USE_LAPACK : 1
131
126
-- USE_LMDB : OFF
132
127
-- USE_METAL : OFF
133
128
-- USE_PYTORCH_METAL : OFF
129
+ -- USE_PYTORCH_METAL_EXPORT : OFF
134
130
-- USE_FFTW : OFF
135
131
-- USE_MKL : OFF
136
132
-- USE_MKLDNN : OFF
137
133
-- USE_NCCL : OFF
138
134
-- USE_NNPACK : ON
139
- -- USE_NUMPY : OFF
135
+ -- USE_NUMPY : ON
140
136
-- USE_OBSERVERS : ON
141
137
-- USE_OPENCL : OFF
142
138
-- USE_OPENCV : OFF
143
139
-- USE_OPENMP : ON
144
- -- USE_TBB : OFF
140
+ -- USE_TBB : ON
141
+ -- USE_SYSTEM_TBB : OFF
145
142
-- USE_VULKAN : OFF
146
143
-- USE_PROF : OFF
147
144
-- USE_QNNPACK : ON
150
147
-- USE_ROCKSDB : OFF
151
148
-- USE_ZMQ : OFF
152
149
-- USE_DISTRIBUTED : ON
153
- -- USE_MPI : OFF
154
- -- USE_GLOO : OFF
155
- -- USE_TENSORPIPE : ON
150
+ -- USE_MPI : OFF
151
+ -- USE_GLOO : OFF
152
+ -- USE_GLOO_WITH_OPENSSL : OFF
153
+ -- USE_TENSORPIPE : ON
156
154
-- USE_DEPLOY : OFF
155
+ -- USE_BREAKPAD : ON
157
156
-- Public Dependencies : Threads::Threads
158
- -- Private Dependencies : pthreadpool;cpuinfo;qnnpack;pytorch_qnnpack;nnpack;XNNPACK;fp16;tensorpipe;aten_op_header_gen;foxi_loader;rt;fmt::fmt-header-only;kineto;gcc_s;gcc;dl
157
+ -- Private Dependencies : pthreadpool;cpuinfo;qnnpack;pytorch_qnnpack;nnpack;fp16;tensorpipe;aten_op_header_gen;foxi_loader;rt;fmt::fmt-header-only;kineto;gcc_s;gcc;dl
158
+ -- USE_COREML_DELEGATE : OFF
159
159
-- Configuring done
160
+ -- Generating done
161
+ -- Build files have been written to: /pytorch/build
160
162
161
163
# cp dist/* /workdir
162
164
# cd ..
163
165
164
166
# git clone -b ${TORCHVISION} https://github.com/pytorch/vision.git
167
+
168
+ ##########################################################
169
+ /pytorch/torch/csrc/utils/python_arg_parser.h:415:94
170
+ /pytorch/torch/csrc/utils/python_arg_parser.h:442:94
171
+ /pytorch/torch/csrc/autograd/python_function.cpp:439:11
172
+
173
+ %ld -> %d
174
+ ##########################################################
175
+
176
+
165
177
# cd vision \
166
178
&& git submodule update --init --recursive \
167
179
&& pip3 install /pytorch/dist/*.whl \
174
186
# git clone -b ${TORCHAUDIO} https://github.com/pytorch/audio.git
175
187
# cd audio \
176
188
&& git submodule update --init --recursive \
177
- && apt-get install -y sox libsox-dev \
178
- && pip3 install ninja \
179
189
&& python3 setup.py build \
180
190
&& python3 setup.py bdist_wheel
181
191
@@ -189,11 +199,10 @@ Running on RaspberryPi.
189
199
```
190
200
$ sudo apt install -y libatlas-base-dev libpng-dev nano \
191
201
curl zip unzip libtool swig zlib1g-dev pkg-config git wget xz-utils \
192
- libopenblas-dev libblas-dev m4 cmake cython python3-dev python3-yaml
202
+ libopenblas-dev libblas-dev m4 cmake cython python3-dev python3-yaml \
203
+ libtbb-dev
193
204
194
- $ sudo pip3 install numpy==1.19.5
195
- or
196
- $ sudo pip3 install numpy==1.21.2
205
+ $ sudo pip3 install numpy==1.22.2
197
206
198
207
$ sudo pip3 install torch-*_armv7l_.whl torchvision-*_armv7l.whl torchaudio-*_armv7l.whl
199
208
```
0 commit comments