OpenGVLab / InternImage

[CVPR 2023 Highlight] InternImage: Exploring Large-Scale Vision Foundation Models with Deformable Convolutions
https://arxiv.org/abs/2211.05778
MIT License
2.52k stars 234 forks source link

error in dcnv3_im2col_cuda: no kernel image is available for execution on the device #164

Open jeonga0303 opened 1 year ago

jeonga0303 commented 1 year ago

Why am I getting these errors?

I installed DCNv3 in Docker via whl file. I want to avoid that error

python test.py err

image
SSZ1 commented 1 year ago

I met the same error as I installed DCNv3 in conda env via whl file. Do you solve it ? If so, let me know.

jeonga0303 commented 1 year ago

I met the same error as I installed DCNv3 in conda env via whl file. Do you solve it ? If so, let me know.

I kept getting errors like that and ended up not using the whl installation file. Instead, we could proceed through dockerfile.

It was very difficult to install DCNv3 related to CUDA inside dockfile. Therefore, I made a sh file so that it can be installed when docker is running.

Add the following to the dockerfile. ADD start.sh . RUN chmod +x ./start.sh CMD ["./start.sh"]

And the sh file is as follows. #!/bin/sh cd /app/detection/ops_dcnv3 python setup.py install --user

finaly, let dockerfile build & docker-compose up

SSZ1 commented 1 year ago

I met the same error as I installed DCNv3 in conda env via whl file. Do you solve it ? If so, let me know.

I kept getting errors like that and ended up not using the whl installation file. Instead, we could proceed through dockerfile.

It was very difficult to install DCNv3 related to CUDA inside dockfile. Therefore, I made a sh file so that it can be installed when docker is running.

Add the following to the dockerfile. ADD start.sh . RUN chmod +x ./start.sh CMD ["./start.sh"]

And the sh file is as follows. #!/bin/sh cd /app/detection/ops_dcnv3 python setup.py install --user

finaly, let dockerfile build & docker-compose up

Oh! Thanks a lot! I'll try.

monologuesmw commented 1 year ago

这种情况还有一种隐藏的可能,InternImage代码是从别的服务器拷贝过来的,里面关于ops_dcnv3已经编译过了,在新环境安装的时候没有将旧的build 删掉。

itsMorteza commented 1 year ago

I met the same error as I installed DCNv3 in conda env via whl file. Do you solve it ? If so, let me know.

Before using the sh./make.sh, this technique worked for me, and I didn't get the same error: https://github.com/oobabooga/text-generation-webui/issues/1456#issuecomment-1561633919

MahendraSachindra commented 1 year ago

@jeonga0303 @SSZ1

To build the DCNV3 docker image with nvidia runtime follow the below steps:

  1. Install nvidia-container-runtime
    sudo apt-get install nvidia-container-runtime
  2. Edit/create the /etc/docker/daemon.json with content
    {
    "runtimes": {
        "nvidia": {
            "path": "/usr/bin/nvidia-container-runtime",
            "runtimeArgs": []
         } 
    },
    "default-runtime": "nvidia" 
    }
  3. Restart docker daemon
    sudo systemctl restart docker
  4. Build your image (now GPU will be available during build)
    
    DOCKER_BUILDKIT=0 docker build -t my_image_name:latest .

Below is my success log

![Capture](https://github.com/OpenGVLab/InternImage/assets/120447481/60813e63-2741-49e0-805a-a3ace7df5097)

Source: https://stackoverflow.com/questions/59691207/docker-build-with-nvidia-runtime/61737404#61737404