@@ -21,14 +21,14 @@ $ docker run --rm -it -v ${PWD}:/work pytorch4raspberrypi /bin/bash
2121# cp /wheels/* work
2222# exit
2323
24- $ sudo chmod -R 777 *.whl
24+ $ sudo chmod -R 777 *.whl
2525```
2626## 2-2. [ Method 2] Manual build
2727```
2828$ docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
2929$ docker run --rm -it \
3030 -v ${PWD}:/workdir \
31- pinto0309/raspios_lite_armhf:2021-03-04_buster \
31+ pinto0309/raspios_lite_armhf:2022-02-10_bullseye \
3232 /bin/bash
3333```
3434All 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
3838# apt-get update && apt-get install -y \
3939 openjdk-11-jdk automake autoconf libpng-dev nano \
4040 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 \
4242 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
4445
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
4848
49- # pip3 install -U six wheel mock cmake && ldconfig
49+ # pip3 install -U six wheel mock && ldconfig
5050
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
5954
6055# git clone -b ${TORCH} https://github.com/pytorch/pytorch.git
6156
6257# cd pytorch \
6358 && git submodule update --init --recursive \
6459 && 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 \
6964 && cd ../../..
7065# python3 setup.py bdist_wheel
7166
7267-- ******** Summary ********
7368-- General:
7469-- 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
7671-- System : Linux
7772-- C++ compiler : /usr/bin/c++
7873-- C++ compiler id : GNU
79- -- C++ compiler version : 8.3.0
74+ -- C++ compiler version : 10.2.1
8075-- Using ccache if found : ON
8176-- 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
8378-- Build type : Release
8479-- 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
8681-- CMAKE_INSTALL_PREFIX : /pytorch/torch
8782-- 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
9186-- BUILD_CAFFE2 : ON
9287-- BUILD_CAFFE2_OPS : ON
9388-- BUILD_CAFFE2_MOBILE : OFF
9893-- Link local protobuf : ON
9994-- BUILD_DOCS : OFF
10095-- BUILD_PYTHON : True
101- -- Python version : 3.7.3
96+ -- Python version : 3.9.2
10297-- 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
107102-- BUILD_SHARED_LIBS : ON
108103-- CAFFE2_USE_MSVC_STATIC_RUNTIME : OFF
109- -- BUILD_TEST : True
104+ -- BUILD_TEST : False
110105-- BUILD_JNI : OFF
111106-- BUILD_MOBILE_AUTOGRAD : OFF
112107-- BUILD_LITE_INTERPRETER: OFF
113- -- INTERN_BUILD_MOBILE :
108+ -- INTERN_BUILD_MOBILE :
114109-- USE_BLAS : 1
115110-- BLAS : open
116111-- USE_LAPACK : 1
131126-- USE_LMDB : OFF
132127-- USE_METAL : OFF
133128-- USE_PYTORCH_METAL : OFF
129+ -- USE_PYTORCH_METAL_EXPORT : OFF
134130-- USE_FFTW : OFF
135131-- USE_MKL : OFF
136132-- USE_MKLDNN : OFF
137133-- USE_NCCL : OFF
138134-- USE_NNPACK : ON
139- -- USE_NUMPY : OFF
135+ -- USE_NUMPY : ON
140136-- USE_OBSERVERS : ON
141137-- USE_OPENCL : OFF
142138-- USE_OPENCV : OFF
143139-- USE_OPENMP : ON
144- -- USE_TBB : OFF
140+ -- USE_TBB : ON
141+ -- USE_SYSTEM_TBB : OFF
145142-- USE_VULKAN : OFF
146143-- USE_PROF : OFF
147144-- USE_QNNPACK : ON
150147-- USE_ROCKSDB : OFF
151148-- USE_ZMQ : OFF
152149-- 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
156154-- USE_DEPLOY : OFF
155+ -- USE_BREAKPAD : ON
157156-- 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
159159-- Configuring done
160+ -- Generating done
161+ -- Build files have been written to: /pytorch/build
160162
161163# cp dist/* /workdir
162164# cd ..
163165
164166# 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+
165177# cd vision \
166178 && git submodule update --init --recursive \
167179 && pip3 install /pytorch/dist/*.whl \
174186# git clone -b ${TORCHAUDIO} https://github.com/pytorch/audio.git
175187# cd audio \
176188 && git submodule update --init --recursive \
177- && apt-get install -y sox libsox-dev \
178- && pip3 install ninja \
179189 && python3 setup.py build \
180190 && python3 setup.py bdist_wheel
181191
@@ -189,11 +199,10 @@ Running on RaspberryPi.
189199```
190200$ sudo apt install -y libatlas-base-dev libpng-dev nano \
191201 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
193204
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
197206
198207$ sudo pip3 install torch-*_armv7l_.whl torchvision-*_armv7l.whl torchaudio-*_armv7l.whl
199208```
0 commit comments