当前位置:网站首页>Kunpeng arm server compilation and installation paddlepaddle

Kunpeng arm server compilation and installation paddlepaddle

2022-06-24 14:08:00 Tomato expert

Don't talk nonsense , Open up !

The official tutorial

Many of the official tutorials do not cover , Various problems occurred during installation , The following is a supplement to the official tutorial , What's the problem? , Welcome to correct !

One 、cmake

        Paddle rely on cmake Build it , need cmake edition >=3.15, If the source provided by the operating system includes the appropriate version of cmake, Direct installation , Otherwise, you need to install the source code

#  Remove previous versions of cmake
yum remove cmake

wget https://github.com/Kitware/CMake/releases/download/v3.16.8/cmake-3.16.8.tar.gz
tar -xzf cmake-3.16.8.tar.gz && cd cmake-3.16.8
./bootstrap && make && sudo make install

I encountered the following errors during installation :

Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_LIBRARIES OPENSSL_INCLUDE_DIR) 

terms of settlement , Use the following command to install :

yum install openssl-devel

Then do it again cmake Installation command .

Two 、patchelf

         The meaning of the official installation documentation , This is still needed at present , The process is as follows

Be sure to download aarch64 The branch

git clone -b aarch64 https://github.com/NixOS/patchelf.git
./bootstrap.sh
./configure
make
make check
sudo make install

The following error may be reported during installation :failed to run aclocal: No such file or directory

terms of settlement , Use the following command to install :

yum install autoconf
yum install automake

Then do it again make Installation command .

3、 ... and 、paddle

         The process is consistent with the official , But officially develop The branch , I use the official version of the branch here

git clone -b release/2.3 https://github.com/PaddlePaddle/Paddle.git
cd Paddle
mkdir build && cd build

There are a large number of open files during the linking process , The system default limit may be exceeded, resulting in compilation errors , Set the maximum number of files allowed to be opened by the process :

ulimit -n 4096

perform cmake:

        Python2 Commands in the environment :

cmake .. -DPY_VERSION=2 -DPYTHON_EXECUTABLE=`which python2` -DWITH_ARM=ON -DWITH_TESTING=OFF -DCMAKE_BUILD_TYPE=Release -DON_INFER=ON -DWITH_XBYAK=OFF

        Python3 Environmental order :

cmake .. -DPY_VERSION=3 -DPYTHON_EXECUTABLE=`which python3` -DWITH_ARM=ON -DWITH_TESTING=OFF -DCMAKE_BUILD_TYPE=Release -DON_INFER=ON -DWITH_XBYAK=OFF

A wrong : Errors that may be encountered during compilation :Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS)

  terms of settlement

https://felaim.blog.csdn.net/article/details/105832560

Error 2 : No, numpy package

  install numpy It may also appear that you cannot find ‘Python.h’ file , terms of settlement , download python3 Development package for :

yum install python3-devel

Error of three

terms of settlement :

pip3 install wheel -i https://mirror.baidu.com/pypi/simple 
pip3 install protobuf -i https://mirror.baidu.com/pypi/simple 

Four 、make

         Use the following command to compile , Be careful , Because the processor is ARM framework , If not TARGET=ARMV8 An error will be reported during compilation .

make TARGET=ARMV8 -j$(nproc)

Enter after compilation Paddle/build/python/dist Found generated in directory .whl package .

        make In the process from git Download various packages from , slowly , You can speed up the package download in this way : Speed up github Access and download - GitClone

原网站

版权声明
本文为[Tomato expert]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/175/202206241146273308.html