DCNv2 icon indicating copy to clipboard operation
DCNv2 copied to clipboard

Support building with GPU support even when CUDA is not currently available

Open vnavkal opened this issue 4 years ago • 2 comments

Currently we use this conditional to determine whether to build with GPU support: https://github.com/CharlesShang/DCNv2/blob/c7f778f28b84c66d3af2bf16f19148a07051dac1/setup.py#L33

But it would be nice to be able to build the library with GPU support even in environments where CUDA is not available. In particular, I'd like to be able to do this while building a docker image.

If this sounds like a reasonable change, I'm happy to submit a PR for it. I think it would look quite similar to https://github.com/pytorch/vision/pull/927.

vnavkal avatar Jun 18 '20 02:06 vnavkal

Hi, I met the same problem. Did you solve it? It would be better to be able to build on a login-node without GPU and to run on a gpu-node

zhaotf16 avatar Apr 06 '21 07:04 zhaotf16

@zhaotf16 I solved it by modifying the conditional to allow being overridden by a FORCE_CUDA environment variable, as in the torchvision commit I linked to. (I did this only in my copy of the repo and didn't submit a PR for that change.)

vnavkal avatar Apr 07 '21 01:04 vnavkal