AlphaPose icon indicating copy to clipboard operation
AlphaPose copied to clipboard

AlphaPose/detector/nms/src/nms_kernel.cu:5:10: fatal error: THC/THC.h: No such file or directory 5 | #include <THC/THC.h>

Open lucasjinreal opened this issue 4 years ago • 8 comments

For decent pytorch version 1.11 (maybe 1.10), this file removed:

AlphaPose/detector/nms/src/nms_kernel.cu:5:10: fatal error: THC/THC.h: No such file or directory
    5 | #include <THC/THC.h>

image

lucasjinreal avatar Jan 28 '22 05:01 lucasjinreal

Oh... Did you manage to fix it?

Fang-Haoshu avatar Feb 16 '22 12:02 Fang-Haoshu

No, I suggest using torchvision.ops.boxes.nms to do nms operation, however, which needs modification on detector. But since Alphapose already included that source code, it also worthy to modificate to standard way

lucasjinreal avatar Feb 16 '22 13:02 lucasjinreal

Please using my fork version: it works on torch 1.11

https://github.com/jinfagang/AlphaPose

lucasjinreal avatar Apr 01 '22 05:04 lucasjinreal

I cloned your repo:

git clone https://github.com/jinfagang/AlphaPose.git

And then ran:

python3 setup.py build develop --user

And I get the same error message:

detector/nms/src/nms_kernel.cu:5:10: fatal error: THC/THC.h: No such file or directory
    5 | #include <THC/THC.h>
      |          ^~~~~~~~~~~
compilation terminated.
error: command '/usr/local/cuda/bin/nvcc' failed with exit status 1

Do I need to use a certain branch?

peteruhrig avatar Apr 29 '22 20:04 peteruhrig

And it turns out that this is a real show-stopper for A40 and A100 cards. They require CUDA 11.1 or higher, thus PyTorch 1.11 or higher, which does not contain the THC component any more. Thus, as of now, I don't see how to run AlphaPose on recent cards.

peteruhrig avatar Apr 29 '22 22:04 peteruhrig

@jinfagang Still the same error. You didn't modify the code in detector/nms/src/nms_kernel.cu at branch master.

yc-cui avatar Apr 30 '22 10:04 yc-cui

And it turns out that this is a real show-stopper for A40 and A100 cards. They require CUDA 11.1 or higher, thus PyTorch 1.11 or higher, which does not contain the THC component any more. Thus, as of now, I don't see how to run AlphaPose on recent cards.

@peteruhrig Any good suggestions?

yc-cui avatar Apr 30 '22 10:04 yc-cui

I don't speak C/C++ well enough, but my understanding is that it is possible to replace the functions used with ones that are still supported, as discussed here: https://www.exxactcorp.com/blog/Deep-Learning/pytorch-1-11-0-now-available (scroll down to the CUDA section) My guess is that this is not very difficult for someone who knows what they are doing, and maybe that is what @jinfagang did but forgot to push back to his repo, but I don't understand it enough to be able to do this myself.

peteruhrig avatar Apr 30 '22 11:04 peteruhrig