PyTorch build / compile problem: cannot find -lonnxifi_loader

I just tried to build / compile pytorch from source, and got the following error message:

[ 63%] Building CXX object caffe2/CMakeFiles/caffe2.dir//aten/src/ATen/native/cpu/SoftMaxKernel.cpp.DEFAULT.cpp.o
[ 63%] Building CXX object caffe2/CMakeFiles/caffe2.dir/
[ 64%] Linking CXX shared library …/lib/
/usr/bin/x86_64-linux-gnu-ld: cannot find -lonnxifi_loader
collect2: error: ld returned 1 exit status
caffe2/CMakeFiles/caffe2.dir/build.make:2170: recipe for target ‘lib/’ failed
make[2]: *** [lib/] Error 1
CMakeFiles/Makefile2:952: recipe for target ‘caffe2/CMakeFiles/caffe2.dir/all’ failed
make[1]: *** [caffe2/CMakeFiles/caffe2.dir/all] Error 2
Makefile:140: recipe for target ‘all’ failed
make: *** [all] Error 2
Failed to run ‘bash tools/ --use-cuda --use-nnpack nccl caffe2 nanopb libshm gloo THD c10d’

I can not find any info about -lonnxifi_loader via google. Two weeks ago (Mid June 2018)
I can compile pytorch without problem. My system is AMD x86_64 Ubuntu 18.04,
with gcc 7.3.0, cuda 9.2, cudnn 7.1.4.

Seems that none faces the above problem? Just drag it up to see if there is any hint or help?

OK, I finally solved the above problem.

Usually I update pytorch source via command “git pull”,
which is increment download method (except the first time full download).
Somehow in this process two files onnxifi_loader.c and onnxifi_loader.h
was missing! This time I did full download via command
git clone --recursive
Then the above two files onnxifi_loader.c and onnxifi_loader.h
appear, and compile pytorch completed successfully.

1 Like