Skip to content

Latest commit

 

History

History
54 lines (36 loc) · 1.28 KB

building-from-source.md

File metadata and controls

54 lines (36 loc) · 1.28 KB

Prerequisites

  • Linux running on x86 compatitable CPUs
  • GCC >= 4.9 or LLVM/Clang >= 6.0
  • CMake >= 3.11
  • Git >= 2.7.0
  • CUDA Toolkit >= 10.2 (for CUDA version)
  • Python >= 3 (for CUDA version)

Download the Source Code

git clone https://github.com/openppl-public/ppl.nn.git

Build X86-64 Engine

./build.sh

Headers and libraries are installed in pplnn-build/install.

If you want to enable openmp, please specify HPCC_USE_OPENMP as following:

./build.sh -DHPCC_USE_OPENMP=ON

Enable CUDA Engine

X86-64 engine is enabled by default.

./build.sh -DHPCC_USE_CUDA=ON

Headers and libraries are installed in pplnn-build/install.

If you want to use specified CUDA toolkit version, please specify CUDA_TOOLKIT_ROOT_DIR as following:

./build.sh -DHPCC_USE_CUDA=ON -DCUDA_TOOLKIT_ROOT_DIR=/path/to/cuda-toolkit-root-dir

Test

There is a test tool named pplnn in tools/pplnn.cc. You can run pplnn using the following command:

./pplnn-build/tools/pplnn --onnx-model tests/testdata/conv.onnx

NOTE: if CUDA engine is enabled, pplnn uses CUDA only.