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

Where is the _roi_polling.so #15

Closed
g5996706 opened this issue Jan 15, 2018 · 26 comments
Closed

Where is the _roi_polling.so #15

g5996706 opened this issue Jan 15, 2018 · 26 comments

Comments

@g5996706
Copy link

There is a file _roi_align.so in /lib/model/roi_align/_ext/roi_align
but the file _roi_polling.so not in /lib/model/roi_pooling/_ext/roi_pooling
Thank you for answer my question

@jwyang
Copy link
Owner

jwyang commented Jan 15, 2018

yes, roi_pooling and roi_align are two different pooling methods. they are independently.

@jwyang jwyang closed this as completed Jan 15, 2018
@g5996706
Copy link
Author

Sorry ,I know they are two different pooling methods.
My question is when I run the faster_rcnn_cascade.py
It display the error in ''from model.roi_pooling.modules.roi_pool import _RoIPooling''
no Module _RoIPooling.
I found There is no file _roi_polling.so in ''/lib/model/roi_pooling/_ext/roi_pooling''
Thank you for answer my question again

@jwyang
Copy link
Owner

jwyang commented Jan 16, 2018

got it, as illustrated in readme, you need to compile with make.sh in lib/

@jwyang jwyang reopened this Jan 16, 2018
@g5996706
Copy link
Author

I did that maybe I got error in compile with make.sh I will try again thank you so much
At your code all of roi_align、roi_crop、nms have _roi_align.so、 _roi_crop.so 、_nms.so in /_ext/
but why only roi_polling does not have _roi_polling.so in ''/lib/model/roi_pooling/_ext/roi_pooling''

@jwyang
Copy link
Owner

jwyang commented Jan 16, 2018

you should have roi_pooling.so in /lib/model/roi_pooling/_ext/roi_pooling. I think it might because you failed to compile it or them on your side.

@jwyang
Copy link
Owner

jwyang commented Jan 16, 2018

can you post what you got when run 'sh make.sh' on your side?

@g5996706
Copy link
Author

lin@lin-To-be-filled-by-O-E-M:/pedestrian_detection/lib$ sudo sh make.sh
[sudo] password for lin:
Traceback (most recent call last):
File "setup.py", line 13, in
from Cython.Distutils import build_ext
ImportError: No module named Cython.Distutils
Compiling nms kernels by nvcc...
nvcc fatal : Unsupported gpu architecture 'sm_60'
Including CUDA code.
/home/lin/pedestrian_detection/lib/model/nms
['/home/lin/pedestrian_detection/lib/model/nms/src/nms_cuda_kernel.cu.o']
generating /tmp/tmphUx2WE/_nms.c
setting the current directory to '/tmp/tmphUx2WE'
running build_ext
building '_nms' extension
creating home
creating home/lin
creating home/lin/pedestrian_detection
creating home/lin/pedestrian_detection/lib
creating home/lin/pedestrian_detection/lib/model
creating home/lin/pedestrian_detection/lib/model/nms
creating home/lin/pedestrian_detection/lib/model/nms/src
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DWITH_CUDA -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include/TH -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/usr/include/python2.7 -c _nms.c -o ./_nms.o
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DWITH_CUDA -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include/TH -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/usr/include/python2.7 -c /home/lin/pedestrian_detection/lib/model/nms/src/nms_cuda.c -o ./home/lin/pedestrian_detection/lib/model/nms/src/nms_cuda.o
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security ./_nms.o ./home/lin/pedestrian_detection/lib/model/nms/src/nms_cuda.o /home/lin/pedestrian_detection/lib/model/nms/src/nms_cuda_kernel.cu.o -o ./_nms.so
Compiling roi pooling kernels by nvcc...
nvcc fatal : Unsupported gpu architecture 'sm_60'
Including CUDA code.
/home/lin/pedestrian_detection/lib/model/roi_pooling
generating /tmp/tmpBbxVPx/_roi_pooling.c
setting the current directory to '/tmp/tmpBbxVPx'
running build_ext
building '_roi_pooling' extension
creating home
creating home/lin
creating home/lin/pedestrian_detection
creating home/lin/pedestrian_detection/lib
creating home/lin/pedestrian_detection/lib/model
creating home/lin/pedestrian_detection/lib/model/roi_pooling
creating home/lin/pedestrian_detection/lib/model/roi_pooling/src
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DWITH_CUDA -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include/TH -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/usr/include/python2.7 -c _roi_pooling.c -o ./_roi_pooling.o
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DWITH_CUDA -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include/TH -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/usr/include/python2.7 -c /home/lin/pedestrian_detection/lib/model/roi_pooling/src/roi_pooling.c -o ./home/lin/pedestrian_detection/lib/model/roi_pooling/src/roi_pooling.o
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DWITH_CUDA -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include/TH -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/usr/include/python2.7 -c /home/lin/pedestrian_detection/lib/model/roi_pooling/src/roi_pooling_cuda.c -o ./home/lin/pedestrian_detection/lib/model/roi_pooling/src/roi_pooling_cuda.o
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security ./_roi_pooling.o ./home/lin/pedestrian_detection/lib/model/roi_pooling/src/roi_pooling.o ./home/lin/pedestrian_detection/lib/model/roi_pooling/src/roi_pooling_cuda.o /home/lin/pedestrian_detection/lib/model/roi_pooling/src/roi_pooling.cu.o -o ./_roi_pooling.so
x86_64-linux-gnu-gcc: error: /home/lin/pedestrian_detection/lib/model/roi_pooling/src/roi_pooling.cu.o: 沒有此一檔案或目錄
Traceback (most recent call last):
File "build.py", line 34, in
ffi.build()
File "/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/init.py", line 164, in build
_build_extension(ffi, cffi_wrapper_name, target_dir, verbose)
File "/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/init.py", line 100, in _build_extension
ffi.compile(tmpdir=tmpdir, verbose=verbose, target=libname)
File "/usr/local/lib/python2.7/dist-packages/cffi/api.py", line 690, in compile
compiler_verbose=verbose, debug=debug, **kwds)
File "/usr/local/lib/python2.7/dist-packages/cffi/recompiler.py", line 1515, in recompile
compiler_verbose, debug)
File "/usr/local/lib/python2.7/dist-packages/cffi/ffiplatform.py", line 22, in compile
outputfilename = _build(tmpdir, ext, compiler_verbose, debug)
File "/usr/local/lib/python2.7/dist-packages/cffi/ffiplatform.py", line 58, in _build
raise VerificationError('%s: %s' % (e.class.name, e))
cffi.error.VerificationError: LinkError: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Compiling roi align kernels by nvcc...
nvcc fatal : Unsupported gpu architecture 'sm_60'
Including CUDA code.
/home/lin/pedestrian_detection/lib/model/roi_align
generating /tmp/tmpVe3R1j/_roi_align.c
setting the current directory to '/tmp/tmpVe3R1j'
running build_ext
building '_roi_align' extension
creating home
creating home/lin
creating home/lin/pedestrian_detection
creating home/lin/pedestrian_detection/lib
creating home/lin/pedestrian_detection/lib/model
creating home/lin/pedestrian_detection/lib/model/roi_align
creating home/lin/pedestrian_detection/lib/model/roi_align/src
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DWITH_CUDA -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include/TH -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/usr/include/python2.7 -c _roi_align.c -o ./_roi_align.o
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DWITH_CUDA -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include/TH -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/usr/include/python2.7 -c /home/lin/pedestrian_detection/lib/model/roi_align/src/roi_align_cuda.c -o ./home/lin/pedestrian_detection/lib/model/roi_align/src/roi_align_cuda.o
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security ./_roi_align.o ./home/lin/pedestrian_detection/lib/model/roi_align/src/roi_align_cuda.o /home/lin/pedestrian_detection/lib/model/roi_align/src/roi_align_kernel.cu.o -o ./_roi_align.so
Compiling roi crop kernels by nvcc...
nvcc fatal : Unsupported gpu architecture 'sm_60'
Including CUDA code.
/home/lin/pedestrian_detection/lib/model/roi_crop
generating /tmp/tmpiGi6Iz/_roi_crop.c
setting the current directory to '/tmp/tmpiGi6Iz'
running build_ext
building '_roi_crop' extension
creating home
creating home/lin
creating home/lin/pedestrian_detection
creating home/lin/pedestrian_detection/lib
creating home/lin/pedestrian_detection/lib/model
creating home/lin/pedestrian_detection/lib/model/roi_crop
creating home/lin/pedestrian_detection/lib/model/roi_crop/src
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DWITH_CUDA -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include/TH -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/usr/include/python2.7 -c _roi_crop.c -o ./_roi_crop.o
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DWITH_CUDA -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include/TH -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/usr/include/python2.7 -c /home/lin/pedestrian_detection/lib/model/roi_crop/src/roi_crop.c -o ./home/lin/pedestrian_detection/lib/model/roi_crop/src/roi_crop.o
/home/lin/pedestrian_detection/lib/model/roi_crop/src/roi_crop.c: In function ‘BilinearSamplerBHWD_updateGradInput’:
/home/lin/pedestrian_detection/lib/model/roi_crop/src/roi_crop.c:190:14: warning: unused variable ‘inBottomRight’ [-Wunused-variable]
real inBottomRight=0;
^
/home/lin/pedestrian_detection/lib/model/roi_crop/src/roi_crop.c:189:14: warning: unused variable ‘inBottomLeft’ [-Wunused-variable]
real inBottomLeft=0;
^
/home/lin/pedestrian_detection/lib/model/roi_crop/src/roi_crop.c:188:14: warning: unused variable ‘inTopRight’ [-Wunused-variable]
real inTopRight=0;
^
/home/lin/pedestrian_detection/lib/model/roi_crop/src/roi_crop.c:187:14: warning: unused variable ‘inTopLeft’ [-Wunused-variable]
real inTopLeft=0;
^
/home/lin/pedestrian_detection/lib/model/roi_crop/src/roi_crop.c:186:14: warning: unused variable ‘v’ [-Wunused-variable]
real v=0;
^
/home/lin/pedestrian_detection/lib/model/roi_crop/src/roi_crop.c: In function ‘BilinearSamplerBCHW_updateGradInput’:
/home/lin/pedestrian_detection/lib/model/roi_crop/src/roi_crop.c:441:14: warning: unused variable ‘inBottomRight’ [-Wunused-variable]
real inBottomRight=0;
^
/home/lin/pedestrian_detection/lib/model/roi_crop/src/roi_crop.c:440:14: warning: unused variable ‘inBottomLeft’ [-Wunused-variable]
real inBottomLeft=0;
^
/home/lin/pedestrian_detection/lib/model/roi_crop/src/roi_crop.c:439:14: warning: unused variable ‘inTopRight’ [-Wunused-variable]
real inTopRight=0;
^
/home/lin/pedestrian_detection/lib/model/roi_crop/src/roi_crop.c:438:14: warning: unused variable ‘inTopLeft’ [-Wunused-variable]
real inTopLeft=0;
^
/home/lin/pedestrian_detection/lib/model/roi_crop/src/roi_crop.c:437:14: warning: unused variable ‘v’ [-Wunused-variable]
real v=0;
^
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DWITH_CUDA -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include/TH -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/usr/include/python2.7 -c /home/lin/pedestrian_detection/lib/model/roi_crop/src/roi_crop_cuda.c -o ./home/lin/pedestrian_detection/lib/model/roi_crop/src/roi_crop_cuda.o
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security ./_roi_crop.o ./home/lin/pedestrian_detection/lib/model/roi_crop/src/roi_crop.o ./home/lin/pedestrian_detection/lib/model/roi_crop/src/roi_crop_cuda.o /home/lin/pedestrian_detection/lib/model/roi_crop/src/roi_crop_cuda_kernel.cu.o -o ./_roi_crop.so
lin@lin-To-be-filled-by-O-E-M:
/pedestrian_detection/lib$

@g5996706
Copy link
Author

there is a error :
x86_64-linux-gnu-gcc: error: /home/lin/pedestrian_detection/lib/model/roi_pooling/src/roi_pooling.cu.o: No such file or director
is this problem?

@jwyang
Copy link
Owner

jwyang commented Jan 16, 2018

could you update the make.sh with "git checkout". there should be roi_pooling.cu.o after compilation.

@g5996706
Copy link
Author

sorry can you point me how to do that?

@jwyang
Copy link
Owner

jwyang commented Jan 16, 2018

simply run:

git checkout lib/mask.sh

@g5996706
Copy link
Author

fatal: Not a git repository (or any parent up to mount point /home)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).

@jwyang
Copy link
Owner

jwyang commented Jan 16, 2018

if seems that you downloaded the code instead of using git clone. In this case, just update your make.sh by copying the content on the repository to your local file.

@g5996706
Copy link
Author

I copy the content on the repository to my local file,but is still not work
is problem in CUDA_ARCH ?
my gpu is gtx 1080
should I change the code at
CUDA_ARCH="-gencode arch=compute_20,code=sm_20
-gencode arch=compute_30,code=sm_30
-gencode arch=compute_35,code=sm_35
-gencode arch=compute_50,code=sm_50
-gencode arch=compute_52,code=sm_52
-gencode arch=compute_52,code=sm_60 "

@jwyang
Copy link
Owner

jwyang commented Jan 16, 2018

yes, you might need to add sm_61

@g5996706
Copy link
Author

CUDA_ARCH="-gencode arch=compute_20,code=sm_20
-gencode arch=compute_30,code=sm_30
-gencode arch=compute_35,code=sm_35
-gencode arch=compute_50,code=sm_50
-gencode arch=compute_52,code=sm_52
-gencode arch=compute_52,code=sm_60
-gencode arch=compute_52,code=sm_61 "
is this?

@jwyang
Copy link
Owner

jwyang commented Jan 16, 2018

ops, there is a minor error in this. Change compute_XX so that it has the same number as sm_XX. I have just updated make.sh.

@g5996706
Copy link
Author

I am so sorry but I run the new code it still can not work in roi_pooling
nms and roi align is ok just roi_pooling can not work

Compiling roi pooling kernels by nvcc...
nvcc fatal : Unsupported gpu architecture 'compute_60'
Including CUDA code.
/home/lin/pedestrian_detection/faster-rcnn.pytorch/lib/model/roi_pooling
generating /tmp/tmpXcLbp5/_roi_pooling.c
setting the current directory to '/tmp/tmpXcLbp5'
running build_ext
building '_roi_pooling' extension
creating home
creating home/lin
creating home/lin/pedestrian_detection
creating home/lin/pedestrian_detection/faster-rcnn.pytorch
creating home/lin/pedestrian_detection/faster-rcnn.pytorch/lib
creating home/lin/pedestrian_detection/faster-rcnn.pytorch/lib/model
creating home/lin/pedestrian_detection/faster-rcnn.pytorch/lib/model/roi_pooling
creating home/lin/pedestrian_detection/faster-rcnn.pytorch/lib/model/roi_pooling/src
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DWITH_CUDA -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include/TH -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/usr/include/python2.7 -c _roi_pooling.c -o ./_roi_pooling.o
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DWITH_CUDA -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include/TH -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/usr/include/python2.7 -c /home/lin/pedestrian_detection/faster-rcnn.pytorch/lib/model/roi_pooling/src/roi_pooling.c -o ./home/lin/pedestrian_detection/faster-rcnn.pytorch/lib/model/roi_pooling/src/roi_pooling.o
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DWITH_CUDA -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include/TH -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/usr/include/python2.7 -c /home/lin/pedestrian_detection/faster-rcnn.pytorch/lib/model/roi_pooling/src/roi_pooling_cuda.c -o ./home/lin/pedestrian_detection/faster-rcnn.pytorch/lib/model/roi_pooling/src/roi_pooling_cuda.o
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security ./_roi_pooling.o ./home/lin/pedestrian_detection/faster-rcnn.pytorch/lib/model/roi_pooling/src/roi_pooling.o ./home/lin/pedestrian_detection/faster-rcnn.pytorch/lib/model/roi_pooling/src/roi_pooling_cuda.o /home/lin/pedestrian_detection/faster-rcnn.pytorch/lib/model/roi_pooling/src/roi_pooling.cu.o -o ./_roi_pooling.so
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
x86_64-linux-gnu-gcc: error: /home/lin/pedestrian_detection/faster-rcnn.pytorch/lib/model/roi_pooling/src/roi_pooling.cu.o: 沒有此一檔案或目錄

Traceback (most recent call last):
File "build.py", line 34, in
ffi.build()
File "/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/init.py", line 164, in build
_build_extension(ffi, cffi_wrapper_name, target_dir, verbose)
File "/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/init.py", line 100, in _build_extension
ffi.compile(tmpdir=tmpdir, verbose=verbose, target=libname)
File "/usr/local/lib/python2.7/dist-packages/cffi/api.py", line 690, in compile
compiler_verbose=verbose, debug=debug, **kwds)
File "/usr/local/lib/python2.7/dist-packages/cffi/recompiler.py", line 1515, in recompile
compiler_verbose, debug)
File "/usr/local/lib/python2.7/dist-packages/cffi/ffiplatform.py", line 22, in compile
outputfilename = _build(tmpdir, ext, compiler_verbose, debug)
File "/usr/local/lib/python2.7/dist-packages/cffi/ffiplatform.py", line 58, in _build
raise VerificationError('%s: %s' % (e.class.name, e))
cffi.error.VerificationError: LinkError: command 'x86_64-linux-gnu-gcc' failed with exit status 1

@jwyang
Copy link
Owner

jwyang commented Jan 16, 2018

did you get some *.o file in roi_pooling/src?

@g5996706
Copy link
Author

roi_pooling.c roi_pooling.h roi_pooling_cuda.c roi_pooling_cuda.h roi_pooling_kernel.cu roi_pooling_kernel.h these is all file in my ''roi_pooling/src''

@jwyang
Copy link
Owner

jwyang commented Jan 16, 2018

that looks fine. but it is weird that you cannot obtain roi_pooling.cu.o after compiling.

go to src folder and directly run in your bash:

nvcc -c -o roi_pooling.cu.o roi_pooling_kernel.cu -D GOOGLE_CUDA=1 -x cu -Xcompiler -fPIC -gencode arch=compute_61,code=sm_61

see what will happen?

@g5996706
Copy link
Author

g5996706 commented Jan 16, 2018

nvcc fatal : Unsupported gpu architecture 'compute_61'

lin@lin-To-be-filled-by-O-E-M:~/pedestrian_detection/faster-rcnn.pytorch/lib/model/roi_pooling/src$ nvidia-smi
Tue Jan 16 10:16:09 2018
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 384.111 Driver Version: 384.111 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce GTX 1080 Off | 00000000:01:00.0 On | N/A |
| 72% 79C P2 204W / 250W | 4554MiB / 8105MiB | 100% Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 1043 G /usr/lib/xorg/Xorg 215MiB |
| 0 1835 G compiz 152MiB |
| 0 2065 G fcitx-qimpanel 9MiB |
| 0 2303 G ...-token=450095704255CF635B098039C084533E 86MiB |
| 0 4490 C python 4069MiB |
| 0 4757 G /opt/teamviewer/tv_bin/TeamViewer 16MiB |
+-----------------------------------------------------------------------------+

@jwyang
Copy link
Owner

jwyang commented Jan 16, 2018

ok it seems that you gpu does not support compute_61, read this page to find which compute architecture suits for your GPU:
https://developer.nvidia.com/cuda-gpus

@g5996706
Copy link
Author

Ok,Thank you so much.
Your very nice.
Sorry to bother you so long,and thank you again.

@jwyang
Copy link
Owner

jwyang commented Jan 16, 2018

no problem.

The key is to compile roi_pooling_kernel.cu to roi_pooling.cu.o. You need to find the right command for your machine to compile it.

@liujiahui802
Copy link

first I run sh make.sh , it shows error below:
image

then I run "nvcc -c -o roi_pooling.cu.o roi_pooling_kernel.cu -D GOOGLE_CUDA=1 -x cu -Xcompiler -fPIC -gencode arch=compute_61,code=sm_61" in src folder in bash , then it says

image

how can I solve this issue ? thanks! and my make.sh file is as below ( I don't change any code but CUDA_ARCH line):

image

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

3 participants