-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpytorch_source_build_error
70 lines (48 loc) · 3.17 KB
/
pytorch_source_build_error
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
(1)Error one:
when run python setup.py install, the following error occurs:
error: #error ( "You found a build system error: __AVX2__ is defined (via e.g. -mavx2) " "but CAFFE2_PERF_WITH_AVX2 is not defined.")
Solution:
I got the same error, and solved it by replacing #include "caffe2/core/macros.h" with #include "build/caffe2/core/macros.h" in caffe2/core/common.h and caffe2/utils/cblas.h.
caffe2/core/macros.h has no content, it's just a placeholder, the real content , that is, build/caffe2/core/macros.h, will be generated by the cmake script.
I noticed that there is -I. and -I../ in the compile command, so the compiler should find both build/caffe2/core/macros.h and caffe2/core/macros.h for #include "caffe2/core/macros.h". I don't know what will happen if the compiler find two header file with the same name.
(2)Error two
../caffe2/contrib/aten/aten_op.h:1:52: fatal error: caffe2/caffe2/contrib/aten/gen_aten_op.h: No such file or directory
#include "caffe2/caffe2/contrib/aten/gen_aten_op.h"
USE_NINJA=OFF python setup.py install (or USE_NINJA=OFF python setup.py build develop)
(3)
/home/anthony/pytorch/build/lib/libcaffe2.so: undefined reference to `cblas_gemm_s8u8s32_pack'
/home/anthony/pytorch/build/lib/libcaffe2_gpu.so: undefined reference to `__cudaPushCallConfiguration'
/home/anthony/pytorch/build/lib/libcaffe2_gpu.so: undefined reference to `__cudaPopCallConfiguration'
/home/anthony/pytorch/build/lib/libcaffe2.so: undefined reference to `cblas_sgemm_pack_get_size'
/home/anthony/pytorch/build/lib/libcaffe2.so: undefined reference to `cblas_gemm_s8u8s32_compute'
/home/anthony/pytorch/build/lib/libcaffe2.so: undefined reference to `cblas_gemm_s8u8s32_pack_get_size'
collect2: error: ld returned 1 exit status
We had the same issue. Problem was the version of MKL which was not good. Just running:
conda remove mkl mkl-include
conda install numpy pyyaml mkl=2019.3 mkl-include setuptools cmake cffi typing
(4)ptxas warning : Too big maxrregcount value specified 96, will be ignored
CUDA8_GENCODE = -gencode=arch=compute_30,code=sm_30 \
-gencode=arch=compute_35,code=sm_35 \
-gencode=arch=compute_50,code=sm_50 \
-gencode=arch=compute_60,code=sm_60 \
-gencode=arch=compute_61,code=sm_61
->
#CUDA8_GENCODE = -gencode=arch=compute_30,code=sm_30
CUDA8_GENCODE = -gencode=arch=compute_35,code=sm_35 \
-gencode=arch=compute_50,code=sm_50 \
-gencode=arch=compute_60,code=sm_60 \
-gencode=arch=compute_61,code=sm_61
(5)
In file included from /home/hs/code/pytorch/third_party/ideep/mkl-dnn/include/mkldnn.hpp:28:0,
from /home/hs/code/pytorch/aten/src/ATen/mkldnn/Runtime.h:3,
from /home/hs/code/pytorch/aten/src/ATen/native/mkldnn/Conv.cpp:37:
/home/hs/code/pytorch/third_party/ideep/mkl-dnn/include/mkldnn.h:55:28: fatal error: mkldnn_version.h: No such file or directory
#include "mkldnn_version.h"
^
compilation terminated.
maybe forgot to execute:
git submodule update --init --recursive
(6)
pytorch v1.0.0 对应的mkl为2019.1 mkl-include也为2019.1
(7)
ModuleNotFoundError: No module named 'torch._C'