1

I have to build yolact++ in docker enviromment (i'm using sagemaker notebook). Like this

ARG PYTORCH="1.3"
ARG CUDA="10.1"
ARG CUDNN="7"
 
FROM pytorch/pytorch:${PYTORCH}-cuda${CUDA}-cudnn${CUDNN}-devel

And i want to run this

COPY yolact/external/DCNv2/setup.py /opt/ml/code/external/DCNv2/setup.py
RUN cd /opt/ml/code/external/DCNv2 && \
python setup.py build develop

But i got this error :

No CUDA runtime is found, using CUDA_HOME='/usr/local/cuda'
Traceback (most recent call last):
File "setup.py", line 64, in <module>
ext_modules=get_extensions(),
File "setup.py", line 41, in get_extensions
raise NotImplementedError('Cuda is not available')
NotImplementedError: Cuda is not available

But the enviromment supports CUDA. Anyone have an idea where is the problem ?

Thank you.

4
  • The error message indicate CUDA is not considered installed by the python compiler. Did you try to check the presence (and the path) of the CUDA installation ? Commented May 18, 2021 at 8:07
  • I cheched if cuda is available it returns False, but when i check the version of cuda is returns me 10.1, i set CUDA_PATH to CUDA_HOME="/usr/local/cuda-10.1". Commented May 18, 2021 at 9:17
  • Ok so if it still says using CUDA_HOME='/usr/local/cuda' then your setting of CUDA_HOME does not work. Commented May 18, 2021 at 9:25
  • And How i can solve this ? Commented May 18, 2021 at 9:34

2 Answers 2

3

SOLUTION :

i edit the /etc/docker/daemon.json with content:

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

Then i Restart docker daemon:

sudo system restart docker

it solved my problem.

Sign up to request clarification or add additional context in comments.

Comments

0

You should try setting your CUDA_HOME variable in your dockerfile like this :

ARG PYTORCH="1.3"
ARG CUDA="10.1"
ARG CUDNN="7"

FROM pytorch/pytorch:${PYTORCH}-cuda${CUDA}-cudnn${CUDNN}-devel
ARG CUDA_HOME="/usr/local/cuda-10.1"

...and see if the python compiler sees it then.

2 Comments

it still says : No CUDA runtime is found, using CUDA_HOME='/usr/local/cuda-10.1'
So it's not a problem with the path. You said cuda.is_available() returns false... then you have to figure out why. Maybe you can check stackoverflow.com/questions/48152674/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.