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

A problem about nms #2

Closed
bobwan1995 opened this issue Mar 16, 2018 · 6 comments
Closed

A problem about nms #2

bobwan1995 opened this issue Mar 16, 2018 · 6 comments

Comments

@bobwan1995
Copy link

Hi Rowan, thanks for your codes sharing. However, I find nms.nms_apply(keep, boxes_sorted, nms_thresh) in lib/fpn/nms/functions/nms.py would make pytorch break up. Before I execute that line, the operation of Tensor.cuda()+int() is legal, but after I execute that line this operation will raise error: RuntimeError: cuda runtime error (48) : no kernel image is available for execution on the device at /pytorch/torch/lib/THC/generic/THCTensorMathPairwise.cu:21 when it goes on keep_im + s at line 24. Could you please help me? Thanks!

@rowanz
Copy link
Owner

rowanz commented Mar 16, 2018

what GPU do you have? I think you might have to change the compilation flags; I hardcoded them for my Titan X setup.

@bobwan1995
Copy link
Author

bobwan1995 commented Mar 18, 2018

Thanks for your kind answering.
My GPU is Tesla P100, so I tried to make the cuda file with /usr/local/cuda/bin/nvcc -c -o file.cu.o file.cu --compiler-options -fPIC -gencode arch=compute_60,code=sm_60, but it still fails with error cudaCheckError() failed : no kernel image is available for execution on the device. I think it might be compilation problem. Except for changing all sm_61 and compute_60 to *_61, do I need to change other places? I've replaced nms and roi_align with other's codes and it works. Thank you a lot!

@rowanz
Copy link
Owner

rowanz commented Mar 19, 2018

Yeah, you'll need to change the LSTM compilation: https://github.com/rowanz/neural-motifs/blob/master/lib/lstm/highway_lstm_cuda/make.sh

I believe that should be everything. Also, have you verified that pytorch usually runs on your machine?

@bobwan1995
Copy link
Author

I use pytorch 0.3.1. Now I can run your code, thank you!

@YiwuZhong
Copy link

YiwuZhong commented Oct 4, 2018

Hi, I've met the same problem using Tesla P100. So did you solve your problem only changing from _61 to _60 in 3 files (nms, roi_align and highway_lstm_cuda)?
And you said "replaced nms and roi_align with other's codes", could you please tell what "other's codes" did you use to solve the problem? Thanks. :D

@alibabadoufu
Copy link

alibabadoufu commented Dec 15, 2019

For those who are still solving this issues, here are the steps you should consider to follow:

  1. Change SM_# (at places listed below) that suits your current GPU cards (see this for your reference)
  • lib/lstm/highway_lstm_cuda/make.sh (line 15)
  • lib/fpn/roi_align/src/cuda/Makefile (line 2)
  • lib/fpn/nms/src/cuda/Makefile (line 2)
  1. Afterwards, you should also delete *.o files (at places listed below) before you try recompiling nms, roi_align and highway_lstm)
  • lib/lstm/highway_lstm_cuda/src/highway_lstm_kernel.cu.o
  • lib/fpn/roi_align/src/cuda/roi_align.cu.o
  • lib/fpn/nms/src/cuda/nms.cu.o
  1. Run 'make' in your home directory.

That's all you need to do to change your faulty SM setup to the correct one.

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

4 participants