Faster-rcnn.pytorch: gcc: error: /home/chenzw/tensor/faster-rcnn.pytorch/lib/model/roi_crop/src/roi_crop_cuda_kernel.cu.o: 没有那个文件或目录

Created on 28 Mar 2018  Â·  10Comments  Â·  Source: jwyang/faster-rcnn.pytorch

when I run the code of make.sh, I got an error like this How to deal with this problem???

Traceback (most recent call last):
File "build.py", line 36, in
ffi.build()
File "/home/chenzw/anaconda3/envs/tensor2/lib/python2.7/site-packages/torch/utils/ffi/__init__.py", line 167, in build
_build_extension(ffi, cffi_wrapper_name, target_dir, verbose)
File "/home/chenzw/anaconda3/envs/tensor2/lib/python2.7/site-packages/torch/utils/ffi/__init__.py", line 103, in _build_extension
ffi.compile(tmpdir=tmpdir, verbose=verbose, target=libname)
File "/home/chenzw/anaconda3/envs/tensor2/lib/python2.7/site-packages/cffi/api.py", line 697, in compile
compiler_verbose=verbose, debug=debug, **kwds)
File "/home/chenzw/anaconda3/envs/tensor2/lib/python2.7/site-packages/cffi/recompiler.py", line 1520, in recompile
compiler_verbose, debug)
File "/home/chenzw/anaconda3/envs/tensor2/lib/python2.7/site-packages/cffi/ffiplatform.py", line 22, in compile
outputfilename = _build(tmpdir, ext, compiler_verbose, debug)
File "/home/chenzw/anaconda3/envs/tensor2/lib/python2.7/site-packages/cffi/ffiplatform.py", line 58, in _build
raise VerificationError('%s: %s' % (e.__class__.__name__, e))
cffi.error.VerificationError: LinkError: command 'gcc' failed with exit status 1

Most helpful comment

@jwyang sorry for the late reply, it works with anaconda3 + python3.6, the error is about cuda_arch.

All 10 comments

HI, @Bigwode , I guess it is caused by the improper version of anaconda, did you try to compile with anaconda2 + python 2.7?

It weird. One machine is working and another one is not working with the similar error:

Xiaoke@titan:~/repos/faster-rcnn.pytorch/lib$ sh make.sh 
running build_ext
skipping 'model/utils/bbox.c' Cython extension (up-to-date)
skipping 'pycocotools/_mask.c' Cython extension (up-to-date)
Compiling nms kernels by nvcc...
In file included from /usr/local/cuda-8.0/bin/../targets/x86_64-linux/include/cuda_runtime.h:78:0,
                 from <command-line>:0:
/usr/local/cuda-8.0/bin/../targets/x86_64-linux/include/host_config.h:119:2: error: #error -- unsupported GNU version! gcc versions later than 5 are not supported!
 #error -- unsupported GNU version! gcc versions later than 5 are not supported!
  ^~~~~
Including CUDA code.
/data/titan/a/Xiaoke/repos/faster-rcnn.pytorch/lib/model/nms
['/data/titan/a/Xiaoke/repos/faster-rcnn.pytorch/lib/model/nms/src/nms_cuda_kernel.cu.o']
generating /tmp/tmprFI57A/_nms.c
setting the current directory to '/tmp/tmprFI57A'
running build_ext
building '_nms' extension
creating data
creating data/titan
creating data/titan/a
creating data/titan/a/Xiaoke
creating data/titan/a/Xiaoke/repos
creating data/titan/a/Xiaoke/repos/faster-rcnn.pytorch
creating data/titan/a/Xiaoke/repos/faster-rcnn.pytorch/lib
creating data/titan/a/Xiaoke/repos/faster-rcnn.pytorch/lib/model
creating data/titan/a/Xiaoke/repos/faster-rcnn.pytorch/lib/model/nms
creating data/titan/a/Xiaoke/repos/faster-rcnn.pytorch/lib/model/nms/src
gcc -pthread -B /data/titan/a/Xiaoke/anaconda2/compiler_compat -Wl,--sysroot=/ -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/data/titan/a/Xiaoke/.local/lib/python2.7/site-packages/torch/utils/ffi/../../lib/include -I/data/titan/a/Xiaoke/.local/lib/python2.7/site-packages/torch/utils/ffi/../../lib/include/TH -I/data/titan/a/Xiaoke/.local/lib/python2.7/site-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/data/titan/a/Xiaoke/anaconda2/include/python2.7 -c _nms.c -o ./_nms.o
gcc -pthread -B /data/titan/a/Xiaoke/anaconda2/compiler_compat -Wl,--sysroot=/ -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/data/titan/a/Xiaoke/.local/lib/python2.7/site-packages/torch/utils/ffi/../../lib/include -I/data/titan/a/Xiaoke/.local/lib/python2.7/site-packages/torch/utils/ffi/../../lib/include/TH -I/data/titan/a/Xiaoke/.local/lib/python2.7/site-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/data/titan/a/Xiaoke/anaconda2/include/python2.7 -c /data/titan/a/Xiaoke/repos/faster-rcnn.pytorch/lib/model/nms/src/nms_cuda.c -o ./data/titan/a/Xiaoke/repos/faster-rcnn.pytorch/lib/model/nms/src/nms_cuda.o
gcc -pthread -shared -B /data/titan/a/Xiaoke/anaconda2/compiler_compat -L/data/titan/a/Xiaoke/anaconda2/lib -Wl,-rpath=/data/titan/a/Xiaoke/anaconda2/lib -Wl,--no-as-needed -Wl,--sysroot=/ ./_nms.o ./data/titan/a/Xiaoke/repos/faster-rcnn.pytorch/lib/model/nms/src/nms_cuda.o /data/titan/a/Xiaoke/repos/faster-rcnn.pytorch/lib/model/nms/src/nms_cuda_kernel.cu.o -L/data/titan/a/Xiaoke/anaconda2/lib -lpython2.7 -o ./_nms.so
gcc: error: /data/titan/a/Xiaoke/repos/faster-rcnn.pytorch/lib/model/nms/src/nms_cuda_kernel.cu.o: No such file or directory
Traceback (most recent call last):
  File "build.py", line 37, in <module>
    ffi.build()
  File "/data/titan/a/Xiaoke/.local/lib/python2.7/site-packages/torch/utils/ffi/__init__.py", line 167, in build
    _build_extension(ffi, cffi_wrapper_name, target_dir, verbose)
  File "/data/titan/a/Xiaoke/.local/lib/python2.7/site-packages/torch/utils/ffi/__init__.py", line 103, in _build_extension
    ffi.compile(tmpdir=tmpdir, verbose=verbose, target=libname)
  File "/data/titan/a/Xiaoke/.local/lib/python2.7/site-packages/cffi/api.py", line 697, in compile
    compiler_verbose=verbose, debug=debug, **kwds)
  File "/data/titan/a/Xiaoke/.local/lib/python2.7/site-packages/cffi/recompiler.py", line 1520, in recompile
    compiler_verbose, debug)
  File "/data/titan/a/Xiaoke/.local/lib/python2.7/site-packages/cffi/ffiplatform.py", line 22, in compile
    outputfilename = _build(tmpdir, ext, compiler_verbose, debug)
  File "/data/titan/a/Xiaoke/.local/lib/python2.7/site-packages/cffi/ffiplatform.py", line 58, in _build
    raise VerificationError('%s: %s' % (e.__class__.__name__, e))
cffi.error.VerificationError: LinkError: command 'gcc' failed with exit status 1
Compiling roi pooling kernels by nvcc...
In file included from /usr/local/cuda-8.0/bin/../targets/x86_64-linux/include/cuda_runtime.h:78:0,
                 from <command-line>:0:
/usr/local/cuda-8.0/bin/../targets/x86_64-linux/include/host_config.h:119:2: error: #error -- unsupported GNU version! gcc versions later than 5 are not supported!
 #error -- unsupported GNU version! gcc versions later than 5 are not supported!
  ^~~~~
Including CUDA code.
/data/titan/a/Xiaoke/repos/faster-rcnn.pytorch/lib/model/roi_pooling
generating /tmp/tmpt5lAl8/_roi_pooling.c
setting the current directory to '/tmp/tmpt5lAl8'
running build_ext

system info:

ubuntu 16.04
python2.7
Anaconda2.0
Xiaoke@titan:~/repos/faster-rcnn.pytorch/lib$ python
Python 2.7.14 |Anaconda, Inc.| (default, Dec  7 2017, 17:05:42) 
[GCC 7.2.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
gcc --version
gcc-4.8 (Ubuntu 4.8.5-4ubuntu2) 4.8.5
Copyright (C) 2015 Free Software Foundation, Inc.

Should I upgrade the gcc version? Any suggestions? Thanks.

@liketheflower I think so, you might need to update your gcc.

I use the gcc 4.8 instead of the gcc 5 and still got the problem although there is no GNU complain

Xiaoke@titan:~/repos/faster-rcnn.pytorch/lib$ sh make.sh 
running build_ext
skipping 'model/utils/bbox.c' Cython extension (up-to-date)
skipping 'pycocotools/_mask.c' Cython extension (up-to-date)
Compiling nms kernels by nvcc...
Including CUDA code.
/data/titan/a/Xiaoke/repos/faster-rcnn.pytorch/lib/model/nms
['/data/titan/a/Xiaoke/repos/faster-rcnn.pytorch/lib/model/nms/src/nms_cuda_kernel.cu.o']
generating /tmp/tmpvrjh6P/_nms.c
setting the current directory to '/tmp/tmpvrjh6P'
running build_ext
building '_nms' extension
creating data
creating data/titan
creating data/titan/a
creating data/titan/a/Xiaoke
creating data/titan/a/Xiaoke/repos
creating data/titan/a/Xiaoke/repos/faster-rcnn.pytorch
creating data/titan/a/Xiaoke/repos/faster-rcnn.pytorch/lib
creating data/titan/a/Xiaoke/repos/faster-rcnn.pytorch/lib/model
creating data/titan/a/Xiaoke/repos/faster-rcnn.pytorch/lib/model/nms
creating data/titan/a/Xiaoke/repos/faster-rcnn.pytorch/lib/model/nms/src
gcc -pthread -B /data/titan/a/Xiaoke/anaconda2/compiler_compat -Wl,--sysroot=/ -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/data/titan/a/Xiaoke/.local/lib/python2.7/site-packages/torch/utils/ffi/../../lib/include -I/data/titan/a/Xiaoke/.local/lib/python2.7/site-packages/torch/utils/ffi/../../lib/include/TH -I/data/titan/a/Xiaoke/.local/lib/python2.7/site-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/data/titan/a/Xiaoke/anaconda2/include/python2.7 -c _nms.c -o ./_nms.o
gcc -pthread -B /data/titan/a/Xiaoke/anaconda2/compiler_compat -Wl,--sysroot=/ -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/data/titan/a/Xiaoke/.local/lib/python2.7/site-packages/torch/utils/ffi/../../lib/include -I/data/titan/a/Xiaoke/.local/lib/python2.7/site-packages/torch/utils/ffi/../../lib/include/TH -I/data/titan/a/Xiaoke/.local/lib/python2.7/site-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/data/titan/a/Xiaoke/anaconda2/include/python2.7 -c /data/titan/a/Xiaoke/repos/faster-rcnn.pytorch/lib/model/nms/src/nms_cuda.c -o ./data/titan/a/Xiaoke/repos/faster-rcnn.pytorch/lib/model/nms/src/nms_cuda.o
gcc -pthread -shared -B /data/titan/a/Xiaoke/anaconda2/compiler_compat -L/data/titan/a/Xiaoke/anaconda2/lib -Wl,-rpath=/data/titan/a/Xiaoke/anaconda2/lib -Wl,--no-as-needed -Wl,--sysroot=/ ./_nms.o ./data/titan/a/Xiaoke/repos/faster-rcnn.pytorch/lib/model/nms/src/nms_cuda.o /data/titan/a/Xiaoke/repos/faster-rcnn.pytorch/lib/model/nms/src/nms_cuda_kernel.cu.o -L/data/titan/a/Xiaoke/anaconda2/lib -lpython2.7 -o ./_nms.so
/data/titan/a/Xiaoke/anaconda2/compiler_compat/ld: cannot find -lpthread
/data/titan/a/Xiaoke/anaconda2/compiler_compat/ld: cannot find -lc
collect2: error: ld returned 1 exit status
Traceback (most recent call last):
  File "build.py", line 37, in <module>
    ffi.build()
  File "/data/titan/a/Xiaoke/.local/lib/python2.7/site-packages/torch/utils/ffi/__init__.py", line 167, in build
    _build_extension(ffi, cffi_wrapper_name, target_dir, verbose)
  File "/data/titan/a/Xiaoke/.local/lib/python2.7/site-packages/torch/utils/ffi/__init__.py", line 103, in _build_extension
    ffi.compile(tmpdir=tmpdir, verbose=verbose, target=libname)
  File "/data/titan/a/Xiaoke/.local/lib/python2.7/site-packages/cffi/api.py", line 697, in compile
    compiler_verbose=verbose, debug=debug, **kwds)
  File "/data/titan/a/Xiaoke/.local/lib/python2.7/site-packages/cffi/recompiler.py", line 1520, in recompile
    compiler_verbose, debug)
  File "/data/titan/a/Xiaoke/.local/lib/python2.7/site-packages/cffi/ffiplatform.py", line 22, in compile
    outputfilename = _build(tmpdir, ext, compiler_verbose, debug)
  File "/data/titan/a/Xiaoke/.local/lib/python2.7/site-packages/cffi/ffiplatform.py", line 58, in _build
    raise VerificationError('%s: %s' % (e.__class__.__name__, e))
cffi.error.VerificationError: LinkError: command 'gcc' failed with exit status 1
Compiling roi pooling kernels by nvcc...
Including CUDA code.

Xiaoke

@liketheflower it seems that your gcc does not have libphread and libc. You should be able to compile after you address this issue.

Great!

I tried the Anaconda2 + python2.7 +gcc4.8 . It works.
By the way, I fixed the gcc problem by reinstalling the gcc:

sudo apt-get install --reinstall gcc-4.8

it seems that this project doesn't support anaconda3 + python3.6

@lxtGH it should work, I compiled with anaconda3 and python 3.6 on my side successfully. what kind of issues did you encounter?

@jwyang sorry for the late reply, it works with anaconda3 + python3.6, the error is about cuda_arch.

Since all you guys have solved the problems. I am closing this issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wanghan0501 picture wanghan0501  Â·  4Comments

ZhangJiajun1995 picture ZhangJiajun1995  Â·  5Comments

gullalc picture gullalc  Â·  4Comments

twangnh picture twangnh  Â·  5Comments

GPaolo picture GPaolo  Â·  5Comments