fundamentalvision / Deformable-DETR

Deformable DETR: Deformable Transformers for End-to-End Object Detection.
Apache License 2.0
3.22k stars 520 forks source link

Building inside a dockerfile gives CUDA is not available #146

Open cypriendker opened 2 years ago

cypriendker commented 2 years ago

Hi,

I'm trying to setup a docker image with the everything already preinstalled so I'm running the make.sh as part of a RUN command but I always ends up with

  File "setup.py", line 69, in <module>
    ext_modules=get_extensions(),
  File "setup.py", line 47, in get_extensions
    raise NotImplementedError('Cuda is not available')
NotImplementedError: Cuda is not available

If I run my docker image with the --runtime nvidia parameter I can build successfully the library. So all the libraries are correctly installed.

I have tried different things but none of them works :

For some reason I can't force torch.cuda.is_available() while building the docker image

here is what my docker files looks like at the end:

ENV CUDA_HOME=/usr/local/cuda-11.3
ARG FORCE_CUDA="1"
ARG TORCH_CUDA_ARCH_LIST="Volta"
COPY etc/docker/daemon.json /etc/docker
RUN make.sh

with /etc/docker/daemon.json being :

{
    "default-runtime": "nvidia",
    "runtimes": {
        "nvidia": {
            "path": "nvidia-container-runtime",
            "runtimeArgs": []
        }
    }
}

thanks for the help

dyp-miffy commented 2 years ago

Hi~ Do you solve this problem?

cypriendker commented 2 years ago

Hi, not yet, for the moment I'm doing the compiling on start up of the docker image, it adds a bit of latency for autoscaling, but this is acceptable. If you have a better solution I would be very interested :)