Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PYTHON=python3 ./compile.sh error #125

Closed
Curry1201 opened this issue Nov 27, 2018 · 11 comments
Closed

PYTHON=python3 ./compile.sh error #125

Curry1201 opened this issue Nov 27, 2018 · 11 comments

Comments

@Curry1201
Copy link

I looked at the problem in the issues column, but I didn't find the reason for the error.
ubuntu server 18.04
cuda 9.0.176
cudnn 7.0.5
pytorch 0.4.1
gcc 5.5.0 g++ 5.5.0
python 3.6

I have joined the environment variable by :
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-9.0/lib64
export PATH=$PATH:/usr/local/cuda-9.0/bin
export CUDA_HOME=$CUDA_HOME:/usr/local/cuda-9.0

Listed below is the compilation process:(The error is at the bottom)
Building roi align op...
No CUDA runtime is found, using CUDA_HOME='/usr/local/cuda'
running build_ext
building 'roi_align_cuda' extension
creating build
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/src
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/power/.local/lib/python3.6/site-packages/torch/lib/include -I/home/power/.local/lib/python3.6/site-packages/torch/lib/include/TH -I/home/power/.local/lib/python3.6/site-packages/torch/lib/include/THC -I/usr/local/cuda/include -I/usr/include/python3.6m -c src/roi_align_cuda.cpp -o build/temp.linux-x86_64-3.6/src/roi_align_cuda.o -DTORCH_EXTENSION_NAME=roi_align_cuda -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
/usr/local/cuda/bin/nvcc -I/home/power/.local/lib/python3.6/site-packages/torch/lib/include -I/home/power/.local/lib/python3.6/site-packages/torch/lib/include/TH -I/home/power/.local/lib/python3.6/site-packages/torch/lib/include/THC -I/usr/local/cuda/include -I/usr/include/python3.6m -c src/roi_align_kernel.cu -o build/temp.linux-x86_64-3.6/src/roi_align_kernel.o -DTORCH_EXTENSION_NAME=roi_align_cuda -D_GLIBCXX_USE_CXX11_ABI=0 --compiler-options '-fPIC' -std=c++11
creating build/lib.linux-x86_64-3.6
x86_64-linux-gnu-g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/src/roi_align_cuda.o build/temp.linux-x86_64-3.6/src/roi_align_kernel.o -L/usr/local/cuda/lib64 -lcudart -o build/lib.linux-x86_64-3.6/roi_align_cuda.cpython-36m-x86_64-linux-gnu.so
copying build/lib.linux-x86_64-3.6/roi_align_cuda.cpython-36m-x86_64-linux-gnu.so ->
Building roi pool op...
No CUDA runtime is found, using CUDA_HOME='/usr/local/cuda'
running build_ext
building 'roi_pool_cuda' extension
creating build
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/src
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/power/.local/lib/python3.6/site-packages/torch/lib/include -I/home/power/.local/lib/python3.6/site-packages/torch/lib/include/TH -I/home/power/.local/lib/python3.6/site-packages/torch/lib/include/THC -I/usr/local/cuda/include -I/usr/include/python3.6m -c src/roi_pool_cuda.cpp -o build/temp.linux-x86_64-3.6/src/roi_pool_cuda.o -DTORCH_EXTENSION_NAME=roi_pool_cuda -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
/usr/local/cuda/bin/nvcc -I/home/power/.local/lib/python3.6/site-packages/torch/lib/include -I/home/power/.local/lib/python3.6/site-packages/torch/lib/include/TH -I/home/power/.local/lib/python3.6/site-packages/torch/lib/include/THC -I/usr/local/cuda/include -I/usr/include/python3.6m -c src/roi_pool_kernel.cu -o build/temp.linux-x86_64-3.6/src/roi_pool_kernel.o -DTORCH_EXTENSION_NAME=roi_pool_cuda -D_GLIBCXX_USE_CXX11_ABI=0 --compiler-options '-fPIC' -std=c++11
creating build/lib.linux-x86_64-3.6
x86_64-linux-gnu-g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/src/roi_pool_cuda.o build/temp.linux-x86_64-3.6/src/roi_pool_kernel.o -L/usr/local/cuda/lib64 -lcudart -o build/lib.linux-x86_64-3.6/roi_pool_cuda.cpython-36m-x86_64-linux-gnu.so
copying build/lib.linux-x86_64-3.6/roi_pool_cuda.cpython-36m-x86_64-linux-gnu.so ->
Building nms op...
rm -f .so
echo "Compiling nms kernels..."
Compiling nms kernels...
python3 setup.py build_ext --inplace
running build_ext
building 'cpu_nms' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/power/.local/lib/python3.6/site-packages/numpy/core/include -I/usr/include/python3.6m -c cpu_nms.cpp -o build/temp.linux-x86_64-3.6/cpu_nms.o -Wno-unused-function -Wno-write-strings
In file included from /home/power/.local/lib/python3.6/site-packages/numpy/core/include/numpy/ndarraytypes.h:1821:0,
from /home/power/.local/lib/python3.6/site-packages/numpy/core/include/numpy/ndarrayobject.h:18,
from /home/power/.local/lib/python3.6/site-packages/numpy/core/include/numpy/arrayobject.h:4,
from cpu_nms.cpp:658:
/home/power/.local/lib/python3.6/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
#warning "Using deprecated NumPy API, disable it by "
^~~~~~~
x86_64-linux-gnu-g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/cpu_nms.o -o /home/power/mmdetection/mmdet/ops/nms/cpu_nms.cpython-36m-x86_64-linux-gnu.so
building 'cpu_soft_nms' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/power/.local/lib/python3.6/site-packages/numpy/core/include -I/usr/include/python3.6m -c cpu_soft_nms.cpp -o build/temp.linux-x86_64-3.6/cpu_soft_nms.o -Wno-unused-function -Wno-write-strings
In file included from /home/power/.local/lib/python3.6/site-packages/numpy/core/include/numpy/ndarraytypes.h:1821:0,
from /home/power/.local/lib/python3.6/site-packages/numpy/core/include/numpy/ndarrayobject.h:18,
from /home/power/.local/lib/python3.6/site-packages/numpy/core/include/numpy/arrayobject.h:4,
from cpu_soft_nms.cpp:658:
/home/power/.local/lib/python3.6/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
#warning "Using deprecated NumPy API, disable it by "
^~~~~~~
cpu_soft_nms.cpp: In function ‘PyObject
__pyx_pf_12cpu_soft_nms_cpu_soft_nms(PyObject*, PyArrayObject*, float, float, float, unsigned int)’:
cpu_soft_nms.cpp:2491:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
__pyx_t_10 = ((__pyx_v_pos < __pyx_v_N) != 0);
~~~~~~~~~~~~^~~~~~~~~~~
cpu_soft_nms.cpp:3002:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
__pyx_t_10 = ((__pyx_v_pos < __pyx_v_N) != 0);
~~~~~~~~~~~~^~~~~~~~~~~
x86_64-linux-gnu-g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/cpu_soft_nms.o -o /home/power/mmdetection/mmdet/ops/nms/cpu_soft_nms.cpython-36m-x86_64-linux-gnu.so
building 'gpu_nms' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/power/.local/lib/python3.6/site-packages/numpy/core/include -I/usr/include/python3.6m -c gpu_nms.cpp -o build/temp.linux-x86_64-3.6/gpu_nms.o -Wno-unused-function -Wno-write-strings
In file included from /home/power/.local/lib/python3.6/site-packages/numpy/core/include/numpy/ndarraytypes.h:1821:0,
from /home/power/.local/lib/python3.6/site-packages/numpy/core/include/numpy/ndarrayobject.h:18,
from /home/power/.local/lib/python3.6/site-packages/numpy/core/include/numpy/arrayobject.h:4,
from gpu_nms.cpp:660:
/home/power/.local/lib/python3.6/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
#warning "Using deprecated NumPy API, disable it by "
^~~~~~~
nvcc -I/home/power/.local/lib/python3.6/site-packages/numpy/core/include -I/usr/include/python3.6m -c nms_kernel.cu -o build/temp.linux-x86_64-3.6/nms_kernel.o -c --compiler-options -fPIC
/usr/lib/gcc/x86_64-linux-gnu/6/include/stddef.h(436): error: identifier "nullptr" is undefined

/usr/lib/gcc/x86_64-linux-gnu/6/include/stddef.h(436): error: expected a ";"

/usr/include/x86_64-linux-gnu/c++/6/bits/c++config.h(205): error: expected a ";"

/usr/include/c++/6/exception(63): error: expected a ";"

/usr/include/c++/6/exception(69): error: expected a ";"

/usr/include/c++/6/exception(77): error: expected a ";"

/usr/include/c++/6/exception(85): error: expected a ";"

/usr/include/c++/6/exception(95): error: expected a "{"

/usr/include/c++/6/bits/exception_ptr.h(64): error: function "std::current_exception" returns incomplete type "std::__exception_ptr::exception_ptr"

/usr/include/c++/6/bits/exception_ptr.h(64): error: expected a "{"

/usr/include/c++/6/bits/exception_ptr.h(71): error: namespace "std" has no member "rethrow_exception"

/usr/include/c++/6/bits/exception_ptr.h(81): error: expected a ";"

/usr/include/c++/6/bits/exception_ptr.h(83): error: expected a ";"

/usr/include/c++/6/bits/exception_ptr.h(84): error: expected a ";"

/usr/include/c++/6/bits/exception_ptr.h(86): error: expected a ";"

/usr/include/c++/6/bits/exception_ptr.h(88): error: declaration is incompatible with previous "std::current_exception"
(64): here

/usr/include/c++/6/bits/exception_ptr.h(88): error: use of a local type to declare a function

/usr/include/c++/6/bits/exception_ptr.h(88): error: expected a ";"

/usr/include/c++/6/bits/exception_ptr.h(89): error: use of a local type to declare a function

/usr/include/c++/6/bits/exception_ptr.h(92): error: expected a ";"

/usr/include/c++/6/bits/exception_ptr.h(94): error: expected a ";"

/usr/include/c++/6/bits/exception_ptr.h(97): error: incomplete type is not allowed

/usr/include/c++/6/bits/exception_ptr.h(97): error: expected a ";"

/usr/include/c++/6/bits/exception_ptr.h(118): error: expected a ";"

/usr/include/c++/6/bits/exception_ptr.h(128): error: expected a ";"

/usr/include/c++/6/bits/exception_ptr.h(145): error: use of a local type to declare a function

/usr/include/c++/6/bits/exception_ptr.h(146): error: expected a ";"

/usr/include/c++/6/bits/exception_ptr.h(149): error: expected a ";"

/usr/include/c++/6/bits/exception_ptr.h(154): error: use of a local type to declare a function

/usr/include/c++/6/bits/exception_ptr.h(155): error: expected a ";"

/usr/include/c++/6/bits/exception_ptr.h(158): error: use of a local type to declare a function

/usr/include/c++/6/bits/exception_ptr.h(159): error: expected a ";"

/usr/include/c++/6/bits/exception_ptr.h(162): error: use of a local type to declare a function

/usr/include/c++/6/bits/exception_ptr.h(163): error: expected a ";"

/usr/include/c++/6/bits/exception_ptr.h(171): error: expected a ";"

/usr/include/c++/6/bits/exception_ptr.h(197): error: expected a ";"

/usr/include/c++/6/bits/move.h(47): error: expected a ";"

/usr/include/c++/6/type_traits(71): error: identifier "constexpr" is undefined

/usr/include/c++/6/type_traits(71): error: template parameter "_Tp" may not be redeclared in this scope

/usr/include/c++/6/type_traits(71): error: expected a ";"

/usr/include/c++/6/type_traits(72): error: member "std::integral_constant<_Tp, __v>::_Tp" is not a type name

/usr/include/c++/6/type_traits(73): error: member "std::integral_constant<_Tp, __v>::_Tp" is not a type name

/usr/include/c++/6/type_traits(74): error: identifier "constexpr" is undefined

/usr/include/c++/6/type_traits(79): error: identifier "constexpr" is undefined

/usr/include/c++/6/type_traits(79): error: "value_type" has already been declared in the current scope

/usr/include/c++/6/type_traits(79): error: expected a ";"

/usr/include/c++/6/type_traits(84): error: identifier "constexpr" is undefined

/usr/include/c++/6/type_traits(84): error: "_Tp" is not a function or static data member

/usr/include/c++/6/type_traits(93): error: expected a declaration

/usr/include/c++/6/type_traits(93): error: expected a ";"

/usr/include/c++/6/type_traits(126): error: space required between adjacent ">" delimiters of nested template argument lists (">>" is the right shift operator)

/usr/include/c++/6/type_traits(242): error: identifier "char16_t" is undefined

/usr/include/c++/6/type_traits(246): error: identifier "char32_t" is undefined

/usr/include/c++/6/type_traits(246): error: class "std::__is_integral_helper<>" has already been defined

/usr/include/c++/6/type_traits(344): error: identifier "__float128" is undefined

/usr/include/c++/6/type_traits(460): error: expected a ">"

/usr/include/c++/6/type_traits(464): error: expected a ">"

/usr/include/c++/6/type_traits(472): error: expected a ">"

/usr/include/c++/6/type_traits(476): error: expected a ">"

/usr/include/c++/6/type_traits(484): error: expected a ">"

/usr/include/c++/6/type_traits(488): error: expected a ">"

/usr/include/c++/6/type_traits(496): error: expected a ">"

/usr/include/c++/6/type_traits(500): error: expected a ">"

/usr/include/c++/6/type_traits(508): error: expected a ">"

/usr/include/c++/6/type_traits(512): error: expected a ">"

/usr/include/c++/6/type_traits(520): error: expected a ">"

/usr/include/c++/6/type_traits(524): error: expected a ">"

/usr/include/c++/6/type_traits(532): error: expected a ">"

/usr/include/c++/6/type_traits(536): error: expected a ">"

/usr/include/c++/6/type_traits(544): error: expected a ">"

/usr/include/c++/6/type_traits(548): error: expected a ">"

/usr/include/c++/6/type_traits(558): error: namespace "std" has no member "nullptr_t"

/usr/include/c++/6/type_traits(579): error: space required between adjacent ">" delimiters of nested template argument lists (">>" is the right shift operator)

/usr/include/c++/6/type_traits(585): error: space required between adjacent ">" delimiters of nested template argument lists (">>" is the right shift operator)

/usr/include/c++/6/type_traits(592): error: space required between adjacent ">" delimiters of nested template argument lists (">>" is the right shift operator)

/usr/include/c++/6/type_traits(599): error: space required between adjacent ">" delimiters of nested template argument lists (">>" is the right shift operator)

/usr/include/c++/6/type_traits(609): error: space required between adjacent ">" delimiters of nested template argument lists (">>" is the right shift operator)

/usr/include/c++/6/type_traits(635): error: space required between adjacent ">" delimiters of nested template argument lists (">>" is the right shift operator)

/usr/include/c++/6/type_traits(745): error: space required between adjacent ">" delimiters of nested template argument lists (">>" is the right shift operator)

/usr/include/c++/6/type_traits(759): error: expected a ";"

/usr/include/c++/6/type_traits(774): error: space required between adjacent ">" delimiters of nested template argument lists (">>" is the right shift operator)

/usr/include/c++/6/type_traits(784): error: expected a ")"

/usr/include/c++/6/type_traits(795): error: an explicit template argument list is not allowed on this declaration

/usr/include/c++/6/type_traits(795): error: expected a type specifier

/usr/include/c++/6/type_traits(795): error: function returning function is not allowed

/usr/include/c++/6/type_traits(795): error: expected a ";"

/usr/include/c++/6/type_traits(801): error: space required between adjacent ">" delimiters of nested template argument lists (">>" is the right shift operator)

/usr/include/c++/6/type_traits(802): error: space required between adjacent ">" delimiters of nested template argument lists (">>" is the right shift operator)

/usr/include/c++/6/type_traits(832): error: function call is not allowed in a constant expression

/usr/include/c++/6/type_traits(832): error: function call is not allowed in a constant expression

/usr/include/c++/6/type_traits(832): error: this operator is not allowed in a template argument expression

/usr/include/c++/6/type_traits(843): error: an explicit template argument list is not allowed on this declaration

/usr/include/c++/6/type_traits(843): error: expected a type specifier

/usr/include/c++/6/type_traits(843): error: function returning function is not allowed

/usr/include/c++/6/type_traits(843): error: expected a ";"

/usr/include/c++/6/type_traits(849): error: space required between adjacent ">" delimiters of nested template argument lists (">>" is the right shift operator)

/usr/include/c++/6/type_traits(850): error: space required between adjacent ">" delimiters of nested template argument lists (">>" is the right shift operator)

/usr/include/c++/6/type_traits(875): error: function returning function is not allowed

/usr/include/c++/6/type_traits(886): error: an explicit template argument list is not allowed on this declaration

/usr/include/c++/6/type_traits(886): error: expected a type specifier

Error limit reached.
100 errors detected in the compilation of "/tmp/tmpxft_00007900_00000000-6_nms_kernel.cpp1.ii".
Compilation terminated.
error: command 'nvcc' failed with exit status 1
Makefile:4: recipe for target 'all' failed
make: *** [all] Error 1

Looking forward to your reply!

@hellock
Copy link
Member

hellock commented Nov 28, 2018

The compiling error seems to be related to you gcc version. You may installed multiple gcc versions but the higher version is found during compiling.
Have you tried the solution in your referred issue?

@Curry1201
Copy link
Author

The compiling error seems to be related to you gcc version. You may installed multiple gcc versions but the higher version is found during compiling.
Have you tried the solution in your referred issue?

In fact, I don't know where to add the command "-DCUDA_HOST_COMPILER=/usr/bin/gcc-5" about my referred issue to your setup.py file. I don't know how to add it.

@hellock
Copy link
Member

hellock commented Nov 28, 2018

@Curry1201
Copy link
Author

https://github.com/open-mmlab/mmdetection/blob/master/mmdet/ops/nms/setup.py#L14 seems what you can have a try.

By constantly trying to uninstall and install gcc, it seems that I solved the problem of gcc, but there is a problem with nvcc.

Unable to execute ':/usr/local/cuda-9.0:/usr/local/cuda-9.0/bin/nvcc': No such file or directory
Error: command ':/usr/local/cuda-9.0:/usr/local/cuda-9.0/bin/nvcc' failed with exit status 1

I don't know why, if I install CUDA9.0 or CUDA9.2 successfully, the nvcc --version command is always displayed as "Cuda compilation tools, release 9.1, V9.1.85". If CUDA10.0 is installed, it will display correctly. I don't know if the issue of nvcc is related to these. In addition, I checked the nvcc executable file in the path /usr/local/cuda-9.0/bin.
The following is the compilation process:

power@ubuntu:~/mmdetection$ PYTHON=python3 ./compile.sh
Building roi align op...
running build_ext
building 'roi_align_cuda' extension
creating build
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/src
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/power/.local/lib/python3.6/site-packages/torch/lib/include -I/home/power/.local/lib/python3.6/site-packages/torch/lib/include/TH -I/home/power/.local/lib/python3.6/site-packages/torch/lib/include/THC -I:/usr/local/cuda-9.0:/usr/local/cuda-9.0/include -I/usr/include/python3.6m -c src/roi_align_cuda.cpp -o build/temp.linux-x86_64-3.6/src/roi_align_cuda.o -DTORCH_EXTENSION_NAME=roi_align_cuda -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
:/usr/local/cuda-9.0:/usr/local/cuda-9.0/bin/nvcc -I/home/power/.local/lib/python3.6/site-packages/torch/lib/include -I/home/power/.local/lib/python3.6/site-packages/torch/lib/include/TH -I/home/power/.local/lib/python3.6/site-packages/torch/lib/include/THC -I:/usr/local/cuda-9.0:/usr/local/cuda-9.0/include -I/usr/include/python3.6m -c src/roi_align_kernel.cu -o build/temp.linux-x86_64-3.6/src/roi_align_kernel.o -DTORCH_EXTENSION_NAME=roi_align_cuda -D_GLIBCXX_USE_CXX11_ABI=0 --compiler-options '-fPIC' -std=c++11
unable to execute ':/usr/local/cuda-9.0:/usr/local/cuda-9.0/bin/nvcc': No such file or directory
error: command ':/usr/local/cuda-9.0:/usr/local/cuda-9.0/bin/nvcc' failed with exit status 1
Building roi pool op...
running build_ext
building 'roi_pool_cuda' extension
creating build
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/src
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/power/.local/lib/python3.6/site-packages/torch/lib/include -I/home/power/.local/lib/python3.6/site-packages/torch/lib/include/TH -I/home/power/.local/lib/python3.6/site-packages/torch/lib/include/THC -I:/usr/local/cuda-9.0:/usr/local/cuda-9.0/include -I/usr/include/python3.6m -c src/roi_pool_cuda.cpp -o build/temp.linux-x86_64-3.6/src/roi_pool_cuda.o -DTORCH_EXTENSION_NAME=roi_pool_cuda -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
:/usr/local/cuda-9.0:/usr/local/cuda-9.0/bin/nvcc -I/home/power/.local/lib/python3.6/site-packages/torch/lib/include -I/home/power/.local/lib/python3.6/site-packages/torch/lib/include/TH -I/home/power/.local/lib/python3.6/site-packages/torch/lib/include/THC -I:/usr/local/cuda-9.0:/usr/local/cuda-9.0/include -I/usr/include/python3.6m -c src/roi_pool_kernel.cu -o build/temp.linux-x86_64-3.6/src/roi_pool_kernel.o -DTORCH_EXTENSION_NAME=roi_pool_cuda -D_GLIBCXX_USE_CXX11_ABI=0 --compiler-options '-fPIC' -std=c++11
unable to execute ':/usr/local/cuda-9.0:/usr/local/cuda-9.0/bin/nvcc': No such file or directory
error: command ':/usr/local/cuda-9.0:/usr/local/cuda-9.0/bin/nvcc' failed with exit status 1
Building nms op...
rm -f .so
echo "Compiling nms kernels..."
Compiling nms kernels...
python3 setup.py build_ext --inplace
running build_ext
building 'cpu_nms' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/power/.local/lib/python3.6/site-packages/numpy/core/include -I/usr/include/python3.6m -c cpu_nms.cpp -o build/temp.linux-x86_64-3.6/cpu_nms.o -Wno-unused-function -Wno-write-strings
In file included from /home/power/.local/lib/python3.6/site-packages/numpy/core/include/numpy/ndarraytypes.h:1821:0,
from /home/power/.local/lib/python3.6/site-packages/numpy/core/include/numpy/ndarrayobject.h:18,
from /home/power/.local/lib/python3.6/site-packages/numpy/core/include/numpy/arrayobject.h:4,
from cpu_nms.cpp:658:
/home/power/.local/lib/python3.6/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
#warning "Using deprecated NumPy API, disable it by "
^~~~~~~
x86_64-linux-gnu-g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/cpu_nms.o -o /home/power/mmdetection/mmdet/ops/nms/cpu_nms.cpython-36m-x86_64-linux-gnu.so
building 'cpu_soft_nms' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/power/.local/lib/python3.6/site-packages/numpy/core/include -I/usr/include/python3.6m -c cpu_soft_nms.cpp -o build/temp.linux-x86_64-3.6/cpu_soft_nms.o -Wno-unused-function -Wno-write-strings
In file included from /home/power/.local/lib/python3.6/site-packages/numpy/core/include/numpy/ndarraytypes.h:1821:0,
from /home/power/.local/lib/python3.6/site-packages/numpy/core/include/numpy/ndarrayobject.h:18,
from /home/power/.local/lib/python3.6/site-packages/numpy/core/include/numpy/arrayobject.h:4,
from cpu_soft_nms.cpp:658:
/home/power/.local/lib/python3.6/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
#warning "Using deprecated NumPy API, disable it by "
^~~~~~~
cpu_soft_nms.cpp: In function ‘PyObject
__pyx_pf_12cpu_soft_nms_cpu_soft_nms(PyObject*, PyArrayObject*, float, float, float, unsigned int)’:
cpu_soft_nms.cpp:2491:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
__pyx_t_10 = ((__pyx_v_pos < __pyx_v_N) != 0);
~~~~~~~~~~~~^~~~~~~~~~~
cpu_soft_nms.cpp:3002:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
__pyx_t_10 = ((__pyx_v_pos < __pyx_v_N) != 0);
~~~~~~~~~~~~^~~~~~~~~~~
x86_64-linux-gnu-g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/cpu_soft_nms.o -o /home/power/mmdetection/mmdet/ops/nms/cpu_soft_nms.cpython-36m-x86_64-linux-gnu.so
building 'gpu_nms' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/power/.local/lib/python3.6/site-packages/numpy/core/include -I/usr/include/python3.6m -c gpu_nms.cpp -o build/temp.linux-x86_64-3.6/gpu_nms.o -Wno-unused-function -Wno-write-strings
In file included from /home/power/.local/lib/python3.6/site-packages/numpy/core/include/numpy/ndarraytypes.h:1821:0,
from /home/power/.local/lib/python3.6/site-packages/numpy/core/include/numpy/ndarrayobject.h:18,
from /home/power/.local/lib/python3.6/site-packages/numpy/core/include/numpy/arrayobject.h:4,
from gpu_nms.cpp:660:
/home/power/.local/lib/python3.6/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
#warning "Using deprecated NumPy API, disable it by "
^~~~~~~
nvcc -I/home/power/.local/lib/python3.6/site-packages/numpy/core/include -I/usr/include/python3.6m -c nms_kernel.cu -o build/temp.linux-x86_64-3.6/nms_kernel.o -c --compiler-options -fPIC
x86_64-linux-gnu-g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/gpu_nms.o build/temp.linux-x86_64-3.6/nms_kernel.o -o /home/power/mmdetection/mmdet/ops/nms/gpu_nms.cpython-36m-x86_64-linux-gnu.so

@hellock
Copy link
Member

hellock commented Nov 29, 2018

You cannot specify CUDA_HOME with export CUDA_HOME=$CUDA_HOME:/usr/local/cuda-9.0. It should be a single path, use export CUDA_HOME=/usr/local/cuda-9.0 instead.

@Curry1201
Copy link
Author

You cannot specify CUDA_HOME with export CUDA_HOME=$CUDA_HOME:/usr/local/cuda-9.0. It should be a single path, use export CUDA_HOME=/usr/local/cuda-9.0 instead.

It works!!! I don't know how to express my gratitude to you now. I am so excited. I have been troubled for more than 20 days and I can continue to do so. Thank you again.

@stevenDW
Copy link

You cannot specify CUDA_HOME with export CUDA_HOME=$CUDA_HOME:/usr/local/cuda-9.0. It should be a single path, use export CUDA_HOME=/usr/local/cuda-9.0 instead.

It works!!! I don't know how to express my gratitude to you now. I am so excited. I have been troubled for more than 20 days and I can continue to do so. Thank you again.

I also encountered this problem, I want to ask how you solved it, where to make changes. Thanks

@Curry1201
Copy link
Author

Hi @stevenDW, The root cause of my first problem may be that the compilation process incorrectly called a later version of gcc-6. After uninstalling gcc-6 with the command "sudo apt-get remove gcc-6", the problem about nvcc occurs. After the guidance of Dr. Chen Kai, I changed the command "export PATH=$PATH:/usr/local/cuda-9.0/bin" to "export CUDA_HOME=/usr/local/cuda-9.0" when configuring environment variables. Successfully solved the problem and compiled it.

@m1nt07
Copy link

m1nt07 commented Jan 19, 2019

You cannot specify CUDA_HOME with export CUDA_HOME=$CUDA_HOME:/usr/local/cuda-9.0. It should be a single path, use export CUDA_HOME=/usr/local/cuda-9.0 instead.

It finally works!!!! thank you vvvvvvvery much!!!!!!!

@zytx121
Copy link
Collaborator

zytx121 commented Jan 23, 2019

How to solve this problem?? i don't have GCC problem in nms, but i have this problem.
No CUDA runtime is found, using CUDA_HOME='/usr/local/cuda'

@alaa-shubbak
Copy link

export CUDA_HOME=/usr/local/cuda-9.0

where should i put this instruction ? shall i run it directly on the terminal on the env (open-mmlab) or put it in the config file ?
I faced the same error ..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants